RenderTexture

Target for off-screen 2D rendering into a texture.

Constructors

this
this()

Default constructor.

Destructor

~this
~this()

Desructor.

Members

Functions

clear
void clear(Color color)

Clear the entire target with a single color.

create
bool create(uint width, uint height, bool depthBuffer)

Create the render-texture.

display
void display()

Update the contents of the target texture.

draw
void draw(Drawable drawable, RenderStates states)

Draw a drawable object to the render target.

draw
void draw(const(Vertex)[] vertices, PrimitiveType type, RenderStates states)

Draw primitives defined by an array of vertices.

getDefaultView
View getDefaultView()

Get the default view of the render target.

getSize
Vector2u getSize()

Return the size of the rendering region of the target.

getTexture
const(Texture) getTexture()

Get a read-only reference to the target texture.

popGLStates
void popGLStates()

Restore the previously saved OpenGL render states and matrices.

pushGLStates
void pushGLStates()

Save the current OpenGL render states and matrices.

resetGLStates
void resetGLStates()

Reset the internal OpenGL states so that the target is ready for drawing.

setActive
void setActive(bool active)

Activate or deactivate the render-texture for rendering.

Properties

smooth
bool smooth [@property setter]
bool smooth [@property getter]

Enable or disable texture smoothing.

view
View view [@property setter]
View view [@property getter]

Change the current active view.

Variables

sfPtr
sfRenderTexture* sfPtr;
Undocumented in source.

Inherited Members

From RenderTarget

view
View view [@property setter]
View view [@property getter]

The current active view.

getDefaultView
View getDefaultView()

Get the default view of the render target.

getSize
Vector2u getSize()

Return the size of the rendering region of the target.

getViewport
IntRect getViewport(View view)

Get the viewport of a view, applied to this render target.

clear
void clear(Color color)

Clear the entire target with a single color.

draw
void draw(Drawable drawable, RenderStates states)

Draw a drawable object to the render target.

draw
void draw(const(Vertex)[] vertices, PrimitiveType type, RenderStates states)

Draw primitives defined by an array of vertices.

mapPixelToCoords
Vector2f mapPixelToCoords(Vector2i point)

Convert a point fom target coordinates to world coordinates, using the current view.

mapPixelToCoords
Vector2f mapPixelToCoords(Vector2i point, View theView)

Convert a point from target coordinates to world coordinates.

mapCoordsToPixel
Vector2i mapCoordsToPixel(Vector2f point)

Convert a point from target coordinates to world coordinates, using the curtheView.view.

mapCoordsToPixel
Vector2i mapCoordsToPixel(Vector2f point, View theView)

Convert a point from world coordinates to target coordinates.

popGLStates
void popGLStates()

Restore the previously saved OpenGL render states and matrices.

pushGLStates
void pushGLStates()

Save the current OpenGL render states and matrices.

resetGLStates
void resetGLStates()

Reset the internal OpenGL states so that the target is ready for drawing.

Meta