Texture

A class representing a texture. A texture contains the pixeldata that can be rendered to its associated Window.

It wrapps a SDL_Texture wich can be freely retrived and manipulated

Constructors

this
this(Window window, int textureWidth, int textureHeight)

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

getDepth
int getDepth()

Returns the pixels depth

getHeight
uint getHeight()

Return the texture's height in pixels

getPitch
int getPitch()

Returns the pitch

getPixelFormat
int getPixelFormat()

Returns the pixel format * The pixel format is a SDL_PIXELFORMAT and the default is SDL_PIXELFORMAT_ARGB8888

getTexture
SDL_Texture* getTexture()

Retuens the internal SDL_Texture

getWidth
uint getWidth()

Returns the texture's width in pixels

lock
uint* lock()

Lock the texture to manipulate its pixeldata * Locks the thexture meaning that the texture can't be used for anything untill its $(CU unlock) method is called * A pointer is returned. It points to the pixeldata wich can be manipulated. The length of the pixeldata is the textures width*height. The value for a pixel at location x, y can be obtained by getting the element at index y * width + x *

unlock
void unlock()

Unlocks the texture

Meta