Texture

Image living on the graphics card that can be used for drawing.

Constructors

this
this()

Default constructor

this
this(sfTexture* texturePointer)
Undocumented in source.

Destructor

~this
~this()

Destructor.

Members

Functions

copyToImage
Image copyToImage()

Copy the texture pixels to an image.

create
bool create(uint width, uint height)

Create the texture.

getSize
Vector2u getSize()

Return the size of the texture.

isRepeated
bool isRepeated()

Tell whether the texture is repeated or not.

isSmooth
bool isSmooth()

Tell whether the smooth filter is enabled or not.

loadFromFile
bool loadFromFile(const(char)[] filename, IntRect area)

Load the texture from a file on disk.

loadFromImage
bool loadFromImage(Image image, IntRect area)

Load the texture from an image.

loadFromMemory
bool loadFromMemory(const(void)[] data, IntRect area)

Load the texture from a file in memory.

setRepeated
void setRepeated(bool repeated)

Enable or disable repeating.

setSmooth
void setSmooth(bool smooth)

Enable or disable the smooth filter.

update
void update(const(ubyte)[] pixels)

Update the whole texture from an array of pixels.

update
void update(const(ubyte)[] pixels, uint width, uint height, uint x, uint y)

Update part of the texture from an array of pixels.

update
void update(const(Image) image)

Update the texture from an image.

update
void update(const(Image) image, uint x, uint y)

Update the texture from an image.

update
void update(const(T) window)

Update the texture from the contents of a window

update
void update(const(T) window, uint x, uint y)

Update a part of the texture from the contents of a window.

updateFromImage
void updateFromImage(Image image, uint x, uint y)

Update the texture from an image.

updateFromPixels
void updateFromPixels(const(ubyte)[] pixels, uint width, uint height, uint x, uint y)

Update part of the texture from an array of pixels.

updateFromWindow
void updateFromWindow(Window window, uint x, uint y)

Update a part of the texture from the contents of a window.

updateFromWindow
void updateFromWindow(RenderWindow window, uint x, uint y)

Update a part of the texture from the contents of a window.

Properties

dup
Texture dup [@property getter]

Creates a new texture from the same data (this means copying the entire set of pixels).

Static functions

bind
void bind(Texture texture)

Bind a texture for rendering.

getMaximumSize
uint getMaximumSize()

Get the maximum texture size allowed.

Variables

managed
bool managed;
Undocumented in source.
sfPtr
sfTexture* sfPtr;
Undocumented in source.

Meta