Safe Haskell | None |
---|---|
Language | Haskell98 |
SFML.Graphics.VertexArray
- createVA :: IO VertexArray
- copy :: SFCopyable a => a -> IO a
- destroy :: SFResource a => a -> IO ()
- getVertexCount :: VertexArray -> IO Int
- getVertex :: VertexArray -> Int -> IO (Ptr Vertex)
- clearVA :: VertexArray -> IO ()
- resizeVA :: VertexArray -> Int -> IO ()
- appendVA :: VertexArray -> Vertex -> IO ()
- setPrimitiveType :: VertexArray -> PrimitiveType -> IO ()
- getPrimitiveType :: VertexArray -> IO PrimitiveType
- getVABounds :: VertexArray -> IO FloatRect
Documentation
Create a new vertex array.
copy :: SFCopyable a => a -> IO a
Copy the given SFML resource.
destroy :: SFResource a => a -> IO ()
Destroy the given SFML resource.
getVertexCount :: VertexArray -> IO Int
Return the vertex count of a vertex array.
clearVA :: VertexArray -> IO ()
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.
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 ()
Add a vertex to a vertex array array.
setPrimitiveType :: VertexArray -> PrimitiveType -> IO ()
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
Get the type of primitives drawn by a vertex array.
getVABounds :: VertexArray -> IO FloatRect
Compute the bounding rectangle of a vertex array.
This function returns the axis-aligned rectangle that contains all the vertices of the array.