Texture

A drawable texture which can also be a region of a larger texture

Disabled Default Constructor

A disabled default is present on this object. To use it, use one of the other constructors or a factory function.

Constructors

this
this(ubyte* data, int w, int h, PixelFormat format)

Create a Texture from data in memory

this
this(string name)

Load a texture from a file with a given path

this
this(SDL_Surface* sur)

Load a texture from an SDL_Surface in memory

Members

Functions

destroy
void destroy()

Remove the texture from GPU memory

getSlice
Texture getSlice(Rectangle region)

Get a texture that represents a region of a larger texture

Properties

size
Rectangle size [@property getter]

Get the size of the texture's region

sourceHeight
int sourceHeight [@property getter]

Get the height of the source image

sourceWidth
int sourceWidth [@property getter]

Get the width of the source image

Meta