Safe Haskell | None |
---|---|
Language | Haskell2010 |
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 (PlainFieldRec ts) => ShaderProgram -> PlainFieldRec ts -> IO ()
- setSomeUniforms :: forall ts. UniformFields (PlainFieldRec ts) => ShaderProgram -> PlainFieldRec ts -> IO ()
- setUniforms :: forall ts. UniformFields (PlainFieldRec ts) => ShaderProgram -> PlainFieldRec ts -> IO ()
- class HasFieldGLTypes a where
- fieldGLTypes :: a -> [VariableType]
- class SetUniformFields a
Documentation
setAllUniforms :: forall ts. UniformFields (PlainFieldRec ts) => ShaderProgram -> PlainFieldRec 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 (PlainFieldRec ts) => ShaderProgram -> PlainFieldRec 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 (PlainFieldRec ts) => ShaderProgram -> PlainFieldRec ts -> IO () Source
Set GLSL uniform parameters from a PlainRec
representing a
subset of all uniform parameters used by a program.
class HasFieldGLTypes a where Source
Provide the VariableType
of each field in a Rec
. The list
of types has the same order as the fields of the Rec
.
fieldGLTypes :: a -> [VariableType] Source
(HasVariableType t, HasFieldGLTypes (PlainFieldRec ts)) => HasFieldGLTypes (PlainFieldRec ((:) * ((:::) Symbol sy t) ts)) | |
HasFieldGLTypes (FieldRec f ([] *)) |
class SetUniformFields a Source
setUniformFields
(AsUniform t, SetUniformFields (PlainFieldRec ts)) => SetUniformFields (PlainFieldRec ((:) * ((:::) Symbol sy t) ts)) | |
SetUniformFields (FieldRec f ([] *)) |