| Safe Haskell | None |
|---|
Graphics.VinylGL.Uniforms
Description
Tools for binding vinyl records to GLSL program uniform
parameters. The most common usage is to use the setUniforms
function to set each field of a PlainRec to the GLSL uniform
parameter with the same name. This verifies that each field of the
record corresponds to a uniform parameter of the given shader
program, and that the types all agree.
- setAllUniforms :: forall ts. UniformFields (PlainRec ts) => ShaderProgram -> PlainRec ts -> IO ()
- setSomeUniforms :: forall ts. UniformFields (PlainRec ts) => ShaderProgram -> PlainRec ts -> IO ()
- setUniforms :: forall ts. UniformFields (PlainRec ts) => ShaderProgram -> PlainRec ts -> IO ()
- class HasFieldGLTypes a where
- fieldGLTypes :: a -> [VariableType]
Documentation
setAllUniforms :: forall ts. UniformFields (PlainRec ts) => ShaderProgram -> PlainRec ts -> IO ()Source
Set GLSL uniform parameters from a PlainRec. A check is
performed to verify that all uniforms used by a program are
represented by the record type. In other words, the record is a
superset of the parameters used by the program.
setSomeUniforms :: forall ts. UniformFields (PlainRec ts) => ShaderProgram -> PlainRec ts -> IO ()Source
Set GLSL uniform parameters from those fields of a PlainRec
whose names correspond to uniform parameters used by a program.
setUniforms :: forall ts. UniformFields (PlainRec ts) => ShaderProgram -> PlainRec ts -> IO ()Source
Set GLSL uniform parameters from a PlainRec representing a
subset of all uniform parameters used by a program.
class HasFieldGLTypes a whereSource
Provide the VariableType of each field in a Rec. The list
of types has the same order as the fields of the Rec.
Methods
fieldGLTypes :: a -> [VariableType]Source
Instances
| (HasVariableType t, HasFieldGLTypes (PlainRec ts)) => HasFieldGLTypes (PlainRec (: * (::: sy t) ts)) | |
| HasFieldGLTypes (Rec ([] *) f) |