Menu - Top - Home - Donate to Me

H3DU.TextureLoader

Back to documentation index.

H3DU.TextureLoader()

An object that caches loaded textures and uploads them to WebGL contexts.

Methods

H3DU.TextureLoader#dispose()

Disposes all resources used by this texture loader.

Return Value

This method doesn't return a value. (Type: void)

H3DU.TextureLoader#getTexture(name)

Gets an already loaded texture by name from this texture loader.

Parameters

Return Value

The texture with the given name, or null if it isn't fully loaded or doesn't exist. (Type: H3DU.Texture)

H3DU.TextureLoader#loadAndMapTexture(texture, context)

Loads the texture referred to in an array of URLs and uploads its texture data to a WebGL context.

Parameters

Return Value

A promise that resolves when the texture is loaded successfully (the result will be an H3DU.Texture object) and is rejected when an error occurs. (Type: Promise.<H3DU.Texture>)

H3DU.TextureLoader#loadAndMapTexturesAll(textures, context, [resolve], [reject])

Loads one or more textures by their URL and uploads their data to a WebGL context.

Parameters

Return Value

A promise as described in H3DU.getPromiseResultsAll. If the promise resolves, each item in the resulting array will be a loaded H3DU.Texture object. (Type: Promise.<H3DU.Texture>)

H3DU.TextureLoader#loadCubeMap(texturesOrCubeMap, [resolve], [reject])

Loads the textures described in a cube map.

Parameters

Return Value

A promise that resolves when all textures used by the cube map are loaded successfully (the result will be an H3DU.CubeMap object) and is rejected when an error occurs. (Type: Promise.<H3DU.Texture>)

H3DU.TextureLoader#loadTexture(texture)

Loads a texture by its URL and stores its data.

Parameters

Return Value

A promise that resolves when the texture is fully loaded. If it resolves, the result will be an H3DU.Texture object. (Type: Promise.<H3DU.Texture>)

H3DU.TextureLoader#loadTexturesAll(textures, [resolve], [reject])

Loads the textures referred to in an array of URLs and stores their texture data.

Parameters

Return Value

A promise as described in H3DU.getPromiseResultsAll. If the promise resolves, each item in the resulting array will be a loaded H3DU.Texture object. (Type: Promise.<H3DU.Texture>)

Back to documentation index.