Safe Haskell | None |
---|---|
Language | Haskell2010 |
Utilities for working with vertex buffer objects (VBOs) filled
with vertices represented as Records
.
- bufferVertices :: (Storable rs, BufferSource (v rs)) => v rs -> IO (BufferedVertices rs)
- bindVertices :: BufferedVertices a -> IO ()
- reloadVertices :: Storable rs => BufferedVertices rs -> Vector rs -> IO ()
- deleteVertices :: BufferedVertices a -> IO ()
- enableVertices :: forall f r. ViableVertex r => ShaderProgram -> f r -> IO (Maybe String)
- enableVertices' :: forall f r. ViableVertex r => ShaderProgram -> f r -> IO ()
- enableVertexFields :: forall p r. ViableVertex r => ShaderProgram -> p r -> IO ()
- fieldToVAD :: forall sy r v a proxy. (Field' sy r (v a), HasFieldNames r, HasFieldSizes r, HasGLType a, Storable r, Num (v a), KnownSymbol sy, Foldable v) => FieldName sy -> r -> VertexArrayDescriptor a
- type ViableVertex t = (HasFieldNames t, HasFieldSizes t, HasFieldDims t, HasFieldGLTypes t, Storable t)
- data BufferedVertices a = BufferedVertices {}
Documentation
bufferVertices :: (Storable rs, BufferSource (v rs)) => v rs -> IO (BufferedVertices rs) Source
Load vertex data into a GPU-accessible buffer.
bindVertices :: BufferedVertices a -> IO () Source
Bind previously-buffered vertex data.
reloadVertices :: Storable rs => BufferedVertices rs -> Vector rs -> IO () Source
Reload BufferedVertices
with a Vector
of new vertex data.
deleteVertices :: BufferedVertices a -> IO () Source
Delete the object name associated with BufferedVertices
enableVertices :: forall f r. ViableVertex r => ShaderProgram -> f r -> IO (Maybe String) Source
Line up a shader's attribute inputs with a vertex record. This maps vertex fields to GLSL attributes on the basis of record field names on the Haskell side, and variable names on the GLSL side.
enableVertices' :: forall f r. ViableVertex r => ShaderProgram -> f r -> IO () Source
Behaves like enableVertices
, but raises an exception if the
supplied vertex record does not include a field required by the
shader.
enableVertexFields :: forall p r. ViableVertex r => ShaderProgram -> p r -> IO () Source
Bind some of a shader's attribute inputs to a vertex record. This is useful when the inputs of a shader are split across multiple arrays.
fieldToVAD :: forall sy r v a proxy. (Field' sy r (v a), HasFieldNames r, HasFieldSizes r, HasGLType a, Storable r, Num (v a), KnownSymbol sy, Foldable v) => FieldName sy -> r -> VertexArrayDescriptor a Source
Produce a VertexArrayDescriptor
for a particular field of a
vertex record.
fieldToVAD :: forall r v a sy proxy.
(
Foldable v)
=> String -> proxy r -> GL.VertexArrayDescriptor a
type ViableVertex t = (HasFieldNames t, HasFieldSizes t, HasFieldDims t, HasFieldGLTypes t, Storable t) Source
Constraint alias capturing the requirements of a vertex type.
data BufferedVertices a Source
Representation of a VBO whose type describes the vertices.