Texture

Represents a texture for OpenGL. Image data and various parameters can be set after creation. Image data should be set last.

Members

Functions

bind
void bind(int unit)

Binds the texture to the OpenGL context.

destroy
void destroy()
Undocumented in source. Be warned that the author may not have intended to support it.
getFormat
Format getFormat()

Returns the texture's format

getHeight
uint getHeight()

Returns the height of the image.

getID
uint getID()

Gets the ID for this texture as assigned by OpenGL.

getImageData
ubyte[] getImageData(InternalFormat format)

Returns the image data in the desired format.

getImageData
ubyte[] getImageData()

Returns the image data in the internal format.

getInternalFormat
InternalFormat getInternalFormat()

Returns the texture's internal format.

getWidth
uint getWidth()

Returns the width of the image.

setAnisotropicFiltering
void setAnisotropicFiltering(float value)

Sets the value for anisotropic filtering. Must be greater than zero. Note that this is EXT based and might not be supported on all hardware.

setBorderColor
void setBorderColor(float red, float green, float blue, float alpha)

Sets the border color.

setCompareMode
void setCompareMode(CompareMode compareMode)

Sets the compare mode.

setFilters
void setFilters(FilterMode minFilter, FilterMode magFilter)

Sets the texture's min and mag filters. The mag filter cannot require mipmap generation.

setFormat
void setFormat(Format format)

Sets the texture's format.

setFormat
void setFormat(InternalFormat format)

Sets the texture's format.

setFormat
void setFormat(Format format, InternalFormat internalFormat)

Sets the texture's format and internal format.

setImageData
void setImageData(ubyte[] imageData, uint width, uint height)

Sets the texture's image data.

setWraps
void setWraps(WrapMode horizontalWrap, WrapMode verticalWrap)

Sets the horizontal and vertical texture wraps.

unbind
void unbind()

Unbinds the texture from the OpenGL context.

Variables

id
uint id;
Undocumented in source.

Inherited Members

From Creatable

create
void create()

Creates the resources. It can now be used.

destroy
void destroy()

Releases the resource. It can not longer be used.

isCreated
bool isCreated()

Returns true if the resource was created and is ready for use, false if otherwise.

checkCreated
void checkCreated()

Throws an exception if the resource hasn't been created yet.

checkNotCreated
void checkNotCreated()

Throws an exception if the resource has been created already.

From GLVersioned

getGLVersion
GLVersion getGLVersion()

Returns the lowest OpenGL version required by this object's implementation.

Meta