Class: Textures

gEngine.Textures()

new Textures()

Provides support for loading and unloading of textures (images)
Source:

Methods

_processLoadedImage(textureName, image) → {void}

This converts an image to the webGL texture format.

This should only be called once the texture is loaded.

Parameters:
Name Type Description
textureName String name of the texture to be stored
image String Image file path
Source:
Returns:
Type
void

activateNormalMap(textureName) → {void}

Activate gl.LINEAR_MIPMAP_LINEAR for texture

texture 1 is always normal map for this game engine

Parameters:
Name Type Description
textureName String Name of Texture
Source:
Returns:
Type
void

activateTexture(textureName) → {void}

Activate gl.LINEAR_MIPMAP_LINEAR for texture

Parameters:
Name Type Description
textureName String Name of Texture
Source:
Returns:
Type
void

deactivateTexture() → {void}

Deactivate the Textures and remove them from the GPU
Source:
Returns:
Type
void

getColorArray(textureName) → {Array.<Float>}

Return the Color Array of a texture
Parameters:
Name Type Description
textureName String Name of Texture to get Color Array
Source:
Returns:
Type
Array.<Float>

getTextureInfo(textureName) → {TextureInfo}

Return the TextureInfo of Texture
Parameters:
Name Type Description
textureName String Name of Texture
Source:
Returns:
TextureInto of Texture to get TexttureInfo
Type
TextureInfo

loadTexture(textureName) → {void}

Loads an texture so that it can be drawn.

If already in the map, will do nothing.

Parameters:
Name Type Description
textureName String Texture to load from ResourceMap
Source:
Returns:
Type
void

unloadTexture(textureName) → {void}

Remove the reference to allow associated memory

be available for subsequent garbage collection

Parameters:
Name Type Description
textureName String Texture to unload from ResourceMap
Source:
Returns:
Type
void