All Bundles
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
Name | Type | Description |
---|
renderer | Renderer | the rendering context |
format | Int | one of the enumerated values in SDL_PixelFormatEnum; see Remarks for details |
access | Int | one of the enumerated values in SDL_TextureAccess; see Remarks for details |
w | Int | the width of the texture in pixels |
h | Int | the height of the texture in pixels |
Return
Type | Description |
---|
@return_type | created 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:IntRef) ~ Int
Parameters
Name | Type | Description |
---|
alpha | IntRef | a holder filled in with the current alpha value |
Return
Type | Description |
---|
Int | 0 on success or a negative error code on failure |
GetBlendMode
get the blend mode used for texture copy operations
method : public : GetBlendMode(blendMode:IntRef) ~ Int
Parameters
Name | Type | Description |
---|
blendMode | IntRef | a holder filled in with the current BlendMode |
Return
Type | Description |
---|
Int | 0 on success or a negative error code on failure |
GetColorMod
Get the additional color value multiplied into render copy operations.
method : public : GetColorMod(r:IntRef, g:IntRef, b:IntRef) ~ Int
Parameters
Name | Type | Description |
---|
r | IntRef | a holder filled in with the current red color value |
g | IntRef | a holder filled in with the current green color value |
b | IntRef | a holder filled in with the current blue color value |
Return
Type | Description |
---|
Int | 0 on success or a negative error code on failure |
IsNull
Determines if the underlying SDL C-struct is NULL
method : public : IsNull() ~ Bool
Return
Type | Description |
---|
Bool | true if NULL, false otherwise |
Lock
Lock a portion of the texture for write-only pixel access
method : public : Lock(rect:Rect) ~ PixelData
Parameters
Name | Type | Description |
---|
rect | Rect | an SDL_Rect structure representing the area to lock for access; NULL to lock the entire texture |
Return
Type | Description |
---|
PixelData | access to raw pixel data |
Query
Query the attributes of a texture
method : public : Query(format:IntRef, access:IntRef, w:IntRef, h:IntRef) ~ Int
Parameters
Name | Type | Description |
---|
format | IntRef | a holder filled in with the raw format of the texture |
access | IntRef | a holder filled in with the actual access to the texture (one of the SDL_TextureAccess values) |
w | IntRef | a holder filled in with the width of the texture in pixels |
h | IntRef | a holder filled in with the height of the texture in pixels |
Return
Type | Description |
---|
Int | 0 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
Name | Type | Description |
---|
alpha | Int | the source alpha value multiplied into copy operations |
Return
Type | Description |
---|
Int | 0 on success or a negative error code on failure |
SetBlendMode
Set the blend mode for a texture
method : public : SetBlendMode(blendMode:BlendMode) ~ Int
Parameters
Name | Type | Description |
---|
blendMode | BlendMode | the BlendMode to use for texture blending |
Return
Type | Description |
---|
Int | 0 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
Name | Type | Description |
---|
r | Int | the red color value multiplied into copy operations |
g | Int | the green color value multiplied into copy operations |
b | Int | the blue color value multiplied into copy operations |
Return
Type | Description |
---|
Int | 0 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