Class Texture
Textures are a rectangular collection of pixels
Textures are fast and can be drawn using a renderer
Textures can be created from a more easily edited surface
Textures are handled in hardware as opposed to surfaces which are handled in software
When used repeatedly and stored, textures should be preferred, but surfaces should be used when flexibility is desired
Constructors
Name | Description |
this
|
Creates a texture given explicit parameters that are required by SDL CreateTexture
Allows for more control over how the texture works
|
this
|
Constructs a new texture from a surface
|
this
|
Creates a texture from an already existing SDL_Texture
|
Properties
Name | Type | Description |
access [get]
|
int | Gets the texture's access value
Acces value determines how the texture can be accessed or modified
Potential values are:
|
alphaMod [set]
|
ubyte | Sets the texture's alpha value, or transparency, if possible
Alpha varies from 0 to 255
|
alphaMod [get]
|
ubyte | Gets the texture's alpha value, or transparency, if possible
Alpha varies from 0 to 255
|
blendMode [set]
|
derelict.sdl2.internal.sdl_types.SDL_BlendMode | Sets the texture's blend mode
Modes include:
|
blendMode [get]
|
derelict.sdl2.internal.sdl_types.SDL_BlendMode* | Gets the texture's blend mode
Modes include:
|
colorMod [set]
|
Color | Sets the color modifier for the surface
Color modification works by multiplying the colorMultiplier / 255 into the surface pixels
|
colorMod [get]
|
Color | Gets the color modifier for the surface
Color modification works by multiplying the colorMultiplier / 255 into the surface pixels
|
dimensions [get]
|
Vector!(int,2) | Gets the texture's dimensions as a point with the width being the x coordinate and the height being the y coordinate
|
format [get]
|
uint | Gets the texture's pixel format
The pixel format is the format in which information about the pixels is stored (e.g. RGBA)
|
handle [get]
|
derelict.sdl2.internal.sdl_types.SDL_Texture* | Returns the raw SDL data of this object
|
Methods
Name | Description |
lock
|
Locks a texture from editing
|
unlock
|
Unlocks a texture to edit
|
update
|
Updates a texture with new pixel data
|