Texture

A Texture is a 2 dimensional pixel reprasentation. It is a wrapper of an OpenGL Texture.

Constructors

this
this(void* memory, uint width, uint height, Format fmt)

CTor

this
this(const Surface srfc, Format fmt = Format.None)

CTor

Destructor

~this
~this()

DTor

Postblit

this(this)
@disable this(this)

Postblit is disabled

Copying this object is disabled.

Members

Enums

Format
enum Format

Supported Texture Format

Functions

bind
void bind()

Binds this Texture. Means this Texture is now activated.

getByteSize
size_t getByteSize()

Returns the byte size of the Texture

getPixels
void[] getPixels(void[] pixels)

Returns the pixel data of this Texture or null if this Texture isn't valid. pixels is used to store the pixel data.

getPixels
void[] getPixels()

Returns the pixel of this Texture or null if this Texture isn't valid.

isCurrentlyBound
bool isCurrentlyBound()

Returns true, if this Texture is currently activated.

isRepeated
bool isRepeated()

Returns if repeating is enabled.

isSmooth
bool isSmooth()

Returns if smooth filter are activated.

isValid
bool isValid()

Returns if the texture is used.

loadFrom
void loadFrom(const Surface srfc, Format fmt = Format.None)

Load from Surface

loadFromMemory
void loadFromMemory(const void* memory, uint width, uint height, Format fmt)

Load from memory.

setColorkey
void setColorkey(const Color4b colorkey)

Set a colorkey.

setRepeat
void setRepeat(bool repeat)

Set repeating.

setSmooth
void setSmooth(bool smooth)

Set smooth filter.

unbind
void unbind()

Binds this Texture. Means this Texture is now deactivated.

update
void update(const void* memory, const Rect* rect = null, Format fmt = Format.None)

Update the pixel data of this Texture. The second parameter is a pointer to the area which is updated. If it is null (default) the whole Texture will be updated. The third parameter is the format of the pixels.

Properties

depth
ubyte depth [@property getter]

Returns the depth. May often 24 or 32.

format
Format format [@property getter]

Returns the Format.

height
uint height [@property getter]

Returns the height of this Texture.

id
uint id [@property getter]

Returns the Texture Id.

width
uint width [@property getter]

Returns the width of this Texture

Static functions

currentlyBound
int currentlyBound()

Returns the currently bound texture id.

Meta

Authors

Randy Schuett (rswhite4@googlemail.com)