Texture

A texture, only format supported is unsigned 8 bit RGBA

Constructors

this
this(string file, int channels)

Loads texture from image file Supported file types: * PNG 8-bit * BMP 8-bit * TGA 8-bit non-palleted * JPEG baseline

this
this(ShallowTexture shallow)

Creates a texture from a ShallowTexture

this
this(int width, int height, int channels)

Creates a new empty texture

this
this(ubyte[] data, int width, int height, int inChannels, int outChannels)

Creates a new texture from specified data

Destructor

~this
~this()
Undocumented in source.

Members

Functions

bind
void bind(uint unit)

Bind this texture

center
vec2i center()

Center of texture

channels
int channels()

Gets the channel count

colorMode
GLuint colorMode()

Gets the OpenGL color mode

dispose
void dispose()

Disposes texture from GL

genMipmap
void genMipmap()

Generate mipmaps

getRuntimeUUID
uint getRuntimeUUID()

Returns runtime UUID for texture

getTextureData
ubyte[] getTextureData(bool unmultiply)

Gets the texture data for the texture

getTextureId
GLuint getTextureId()

Gets this texture's texture id

height
int height()

Height of texture

save
void save(string file)

Saves the texture to file

setAnisotropy
void setAnisotropy(float value)
Undocumented in source. Be warned that the author may not have intended to support it.
setData
void setData(ubyte[] data)

Sets the data of the texture

setDataRegion
void setDataRegion(ubyte[] data, int x, int y, int width, int height, int channels)

Sets a region of a texture to new data

setFiltering
void setFiltering(Filtering filtering)

Set the filtering mode used for the texture

setWrapping
void setWrapping(Wrapping wrapping)

Set the wrapping mode used for the texture

size
vec2i size()

Gets the size of the texture

width
int width()

Width of texture

Meta