RendererTexture

This is a wrapper for the hardware acceleration of SDL_Surfaces, called SDL_Textures. That means it is the same as if you use the HW_ACCEL Flag in SDL 1.2.

Constructors

this
this(SDL_Texture* tex, Access access)

CTor

Destructor

~this
~this()
Undocumented in source.

Members

Enums

Access
enum Access

Supported Access modes

Functions

copy
void copy(RendererTexture hw, ShortRect* rect)

Copy hw onto this RendererTexture. rect is the position and size.

copy
void copy(Surface srfc, ShortRect* rect)

Copy srfc onto this RendererTexture. rect is the position and size.

free
void free()

Destroy the RendererTexture <b>and all</b> which are linked to this.

getAlphaMod
ubyte getAlphaMod()

Use this function to get the additional alpha value multiplied into render copy operations.

getBlendMode
Renderer.BlendMode getBlendMode()

Use this function to get the blend mode used for texture copy operations.

getColorMod
Color getColorMod()

Use this function to get the additional color value multiplied into render copy operations

getSize
int[2] getSize()

Returns a two dimensional array filled with the width and the height

isLockable
bool isLockable()

Checks whether this Surface is lockable and therefore accessable.

isValid
bool isValid()

Checks whether the RendererTexture is valid.

lock
void* lock(int pitch, ShortRect* area)

Use this function to lock a portion of the texture for write-only pixel access. Returns the pixel data of given area. If area is null, the whole pixel data returns.

setAlphaMod
void setAlphaMod(ubyte alpha)

Use this function to set an additional alpha value multiplied into render copy operations.

setBlendMode
void setBlendMode(Renderer.BlendMode bmode)

Use this function to set the blend mode for a texture, used by 'copy'.

setColorMod
void setColorMod(Color col)

Rvalue version

setColorMod
void setColorMod(Color col)

Use this function to set an additional color value multiplied into render copy operations.

setColorMod
void setColorMod(ubyte r, ubyte g, ubyte b)

Use this function to set an additional color value multiplied into render copy operations.

unlock
void unlock()

Use this function to unlock a texture, uploading the changes to video memory, if needed.

update
void update(void* pixels, ShortRect* rect, int pitch)

Use this function to update the given texture rectangle with new pixel data.

Properties

height
ushort height [@property getter]

Returns the width

ptr
inout(SDL_Texture)* ptr [@property getter]

Returns a pointer of the SDL_Texture* struct.

width
ushort width [@property getter]

Returns the width

Variables

access
Access access;
Undocumented in source.

Meta

Authors

rschuett