Class: Texture

Texture(gl, image, wrapMode)

Represents a WebGL texture. Applications typically do not interact with this class.

Constructor

new Texture(gl, image, wrapMode)

Constructs a texture for a specified image.
Parameters:
Name Type Description
gl WebGLRenderingContext The current WebGL rendering context.
image Image The texture's image.
wrapMode GL.enum Optional. Specifies the wrap mode of the texture. Defaults to gl.CLAMP_TO_EDGE
Source:
Throws:
If the specified WebGL context or image is null or undefined.
Type
ArgumentError

Members

creationTime :Date

The time at which this texture was created.
Type:
  • Date
Source:

Methods

bind(dc)

Binds this texture in the current WebGL graphics context.
Parameters:
Name Type Description
dc DrawContext The current draw context.
Source:

dispose(gl)

Disposes of the WebGL texture object associated with this texture.
Parameters:
Name Type Description
gl
Source:

resizeImage(image)

Resizes an image to a power of two.
Parameters:
Name Type Description
image Image The image to resize.
Source: