Home

Texture

Efficient, driver-specific representation of pixel data.

Operations

New

Create a texture for a rendering context

New(renderer:Renderer, format:Int, access:Int, w:Int, h:Int)
Parameters
NameTypeDescription
rendererRendererthe rendering context
formatIntone of the enumerated values in SDL_PixelFormatEnum; see Remarks for details
accessIntone of the enumerated values in SDL_TextureAccess; see Remarks for details
wIntthe width of the texture in pixels
hIntthe height of the texture in pixels

Return
TypeDescription
@return_typecreated texture

Destroy

Destroy the specified texture

method : public : Destroy() ~ Nil

GetAlphaMod

Get the additional alpha value multiplied into render copy operations.

method : public : GetAlphaMod(alpha:IntHolder) ~ Int
Parameters
NameTypeDescription
alphaIntHoldera holder filled in with the current alpha value

Return
TypeDescription
Int0 on success or a negative error code on failure

GetBlendMode

get the blend mode used for texture copy operations

method : public : GetBlendMode(blendMode:IntHolder) ~ Int
Parameters
NameTypeDescription
blendModeIntHoldera holder filled in with the current BlendMode

Return
TypeDescription
Int0 on success or a negative error code on failure

GetColorMod

Get the additional color value multiplied into render copy operations.

method : public : GetColorMod(r:IntHolder, g:IntHolder, b:IntHolder) ~ Int
Parameters
NameTypeDescription
rIntHoldera holder filled in with the current red color value
gIntHoldera holder filled in with the current green color value
bIntHoldera holder filled in with the current blue color value

Return
TypeDescription
Int0 on success or a negative error code on failure

IsNull

Determines if the underlying SDL C-struct is NULL

method : public : IsNull() ~ Bool
Return
TypeDescription
Booltrue if NULL, false otherwise

Lock

Lock a portion of the texture for write-only pixel access

method : public : Lock(rect:Rect) ~ PixelData
Parameters
NameTypeDescription
rectRectan SDL_Rect structure representing the area to lock for access; NULL to lock the entire texture

Return
TypeDescription
PixelDataaccess to raw pixel data

Query

Query the attributes of a texture

method : public : Query(format:IntHolder, access:IntHolder, w:IntHolder, h:IntHolder) ~ Int
Parameters
NameTypeDescription
formatIntHoldera holder filled in with the raw format of the texture
accessIntHoldera holder filled in with the actual access to the texture (one of the SDL_TextureAccess values)
wIntHoldera holder filled in with the width of the texture in pixels
hIntHoldera holder filled in with the height of the texture in pixels

Return
TypeDescription
Int0 on success or a negative error code on failure

SetAlphaMod

Set an additional alpha value multiplied into render copy operations.

method : public : SetAlphaMod(alpha:Int) ~ Int
Parameters
NameTypeDescription
alphaIntthe source alpha value multiplied into copy operations

Return
TypeDescription
Int0 on success or a negative error code on failure

SetBlendMode

Set the blend mode for a texture

method : public : SetBlendMode(blendMode:BlendMode) ~ Int
Parameters
NameTypeDescription
blendModeBlendModethe BlendMode to use for texture blending

Return
TypeDescription
Int0 on success or a negative error code on failure

SetColorMod

set an additional color value multiplied into render copy operations

method : public : SetColorMod(r:Int, g:Int, b:Int) ~ Int
Parameters
NameTypeDescription
rIntthe red color value multiplied into copy operations
gIntthe green color value multiplied into copy operations
bIntthe blue color value multiplied into copy operations

Return
TypeDescription
Int0 on success or a negative error code on failure

Unlock

Unlock a texture, uploading the changes to video memory, if needed.

method : public : Unlock() ~ Nil