SFML-2.3.2.2: SFML bindings

Safe HaskellNone
LanguageHaskell98

SFML.Graphics.VertexArray

Synopsis

Documentation

createVA :: IO VertexArray Source

Create a new vertex array.

copy :: SFCopyable a => a -> IO a Source

Copy the given SFML resource.

destroy :: SFResource a => a -> IO () Source

Destroy the given SFML resource.

getVertexCount :: VertexArray -> IO Int Source

Return the vertex count of a vertex array.

getVertex :: VertexArray -> Int -> IO (Ptr Vertex) Source

Return the ith vertex.

clearVA :: VertexArray -> IO () Source

Clear a vertex array.

This function removes all the vertices from the array. It doesn't deallocate the corresponding memory, so that adding new vertices after clearing doesn't involve reallocating all the memory.

resizeVA Source

Arguments

:: VertexArray 
-> Int

Vertex count; New size of the array (number of vertices)

-> IO () 

Resize the vertex array.

If vertex count is greater than the current size, the previous vertices are kept and new (default-constructed) vertices are added.

If vertex count is less than the current size, existing vertices are removed from the array.

appendVA :: VertexArray -> Vertex -> IO () Source

Add a vertex to a vertex array array.

setPrimitiveType :: VertexArray -> PrimitiveType -> IO () Source

Set the type of primitives of a vertex array.

This function defines how the vertices must be interpreted when it's time to draw them:

  • As points
  • As lines
  • As triangles
  • As quads

The default primitive type is sfPoints.

getPrimitiveType :: VertexArray -> IO PrimitiveType Source

Get the type of primitives drawn by a vertex array.

getVABounds :: VertexArray -> IO FloatRect Source

Compute the bounding rectangle of a vertex array.

This function returns the axis-aligned rectangle that contains all the vertices of the array.