Safe Haskell | None |
---|---|
Language | Haskell2010 |
VBO and ElementArrays. Both are buffer objects but are used for two different things.
- data VBO
- data ElementArray
- data UsageHint
- newVBO :: Vector Word8 -> UsageHint -> IO VBO
- updateVBO :: Vector Word8 -> Int -> IO ()
- bindVBO :: VBO -> IO ()
- newElementArray :: Vector Word8 -> UsageHint -> IO ElementArray
- updateElementArray :: Vector Word8 -> Int -> IO ()
- bindElementArray :: ElementArray -> IO ()
- deleteBufferObject :: BufferObject a => a -> IO ()
Documentation
data VBO
A VBO is a buffer object which has vertex data. Shader programs use VBOs as input to their vertex attributes according to the configuration of the bound VAO.
data ElementArray
A buffer object which has a packed sequence of vertex indices. Indexed rendering uses the ElementArray bound to the element array binding target.
data UsageHint
Usage hint for allocation of buffer object storage.
StaticDraw | Data will seldomly change. |
DynamicDraw | Data will change. |
StreamDraw | Data will change very often. |
newVBO :: Vector Word8 -> UsageHint -> IO VBO
Create a buffer object from a blob of bytes. The usage argument hints at how often you will modify the data.
updateVBO :: Vector Word8 -> Int -> IO ()
Modify the data in the currently bound VBO starting from the specified index in bytes.
Bind a VBO to the array buffer binding target. The buffer object bound there will be replaced, if any.
newElementArray :: Vector Word8 -> UsageHint -> IO ElementArray
Create a new ElementArray buffer object from the blob of packed indices. The usage argument hints at how often you plan to modify the data.
updateElementArray :: Vector Word8 -> Int -> IO ()
Modify contents in the currently bound ElementArray starting at the specified index in bytes.
bindElementArray :: ElementArray -> IO ()
Assign an ElementArray to the element array binding target. It will replace the ElementArray already bound there, if any. Note that the state of the element array binding target is a function of the current VAO.
deleteBufferObject :: BufferObject a => a -> IO ()
Delete a VBO or ElementArray.