SFML-2.3.2.2: SFML bindings

Safe HaskellNone
LanguageHaskell98

SFML.Graphics.SFRenderTarget

Documentation

class SFRenderTarget a where Source

Methods

drawSprite Source

Arguments

:: a 
-> Sprite

Sprite to draw

-> Maybe RenderStates

Render states to use for drawing (Nothing to use the default states)

-> IO () 

Draw a sprite to the render-target.

drawText Source

Arguments

:: a 
-> Text

Text to draw

-> Maybe RenderStates

Render states to use for drawing (Nothing to use the default states)

-> IO () 

Draw text to the render-target.

drawShape Source

Arguments

:: a 
-> Shape

Shape to draw

-> Maybe RenderStates

Render states to use for drawing (Nothing to use the default states)

-> IO () 

Draw a sprite to the render-target.

drawCircle Source

Arguments

:: a 
-> CircleShape

CircleShape to draw

-> Maybe RenderStates

Render states to use for drawing (Nothing to use the default states)

-> IO () 

Draw a sprite to the render-target.

drawConvexShape Source

Arguments

:: a 
-> ConvexShape

ConvexShape to draw

-> Maybe RenderStates

Render states to use for drawing (Nothing to use the default states)

-> IO () 

Draw a sprite to the render-target.

drawRectangle Source

Arguments

:: a 
-> RectangleShape

RectangleShape to draw

-> Maybe RenderStates

Render states to use for drawing (Nothing to use the default states)

-> IO () 

Draw a sprite to the render-target.

drawVertexArray Source

Arguments

:: a 
-> VertexArray

VertexArray to draw

-> Maybe RenderStates

Render states to use for drawing (Nothing to use the default states)

-> IO () 

Draw a sprite to the render-target.

drawPrimitives Source

Arguments

:: a 
-> [Vertex]

Vertices to render

-> PrimitiveType

Type of primitives to draw

-> Maybe RenderStates

Render states to use for drawing (Nothing to use the default states)

-> IO () 

Draw primitives defined by an array of vertices to a render texture.

drawPrimitives' Source

Arguments

:: a 
-> Ptr Vertex

Pointer to the vertices

-> Int

Number of vertices in the array

-> PrimitiveType

Type of primitives to draw

-> Maybe RenderStates

Render states to use for drawing (Nothing to use the default states)

-> IO () 

pushGLStates :: a -> IO () Source

Save the current OpenGL render states and matrices.

This function can be used when you mix SFML drawing and direct OpenGL rendering. Combined with popGLStates, it ensures that:

  • SFML's internal states are not messed up by your OpenGL code
  • Your OpenGL states are not modified by a call to a SFML function

Note that this function is quite expensive: it saves all the possible OpenGL states and matrices, even the ones you don't care about. Therefore it should be used wisely. It is provided for convenience, but the best results will be achieved if you handle OpenGL states yourself (because you know which states have really changed, and need to be saved and restored). Take a look at the resetGLStates function if you do so.

popGLStates :: a -> IO () Source

Restore the previously saved OpenGL render states and matrices.

See the description of pushGLStates to get a detailed description of these functions.

resetGLStates :: a -> IO () Source

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

This function can be used when you mix SFML drawing and direct OpenGL rendering, if you choose not to use pushGLStates or popGLStates. It makes sure that all OpenGL states needed by SFML are set, so that subsequent draw calls will work as expected.