Texture

Represents a GPU texture.

Textures make use of manual memory management.

Members

Functions

backend
inout(FluidBackend) backend()

Get the backend for this texture. Doesn't work after freeing the tombstone.

canvasSize
Vector2 canvasSize()

Get texture size as a vector.

destroy
void destroy()

Destroy this texture. This function is thread-safe.

dpi
Vector2 dpi()

DPI value of the texture.

draw
void draw(Vector2 position, Color tint)

Draw this texture.

draw
void draw(Rectangle rectangle, Color tint)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(Texture other)
Undocumented in source. Be warned that the author may not have intended to support it.
viewportSize
Vector2 viewportSize()

Get the size the texture will occupy within the viewport.

Variables

dpiX
int dpiX;
dpiY
int dpiY;

Dots per inch for the X and Y axis. Defaults to 96, thus making a dot in the texture equivalent to a pixel.

height
int height;

Width and height of the texture, **in dots**. The meaning of a dot is defined by dpiX and dpiY

id
uint id;

GPU/backend ID of the texture.

tombstone
shared(TextureTombstone)* tombstone;

Tombstone for this texture

width
int width;

Width and height of the texture, **in dots**. The meaning of a dot is defined by dpiX and dpiY

Meta