vinyl-gl-0.1.2: Utilities for working with OpenGL's GLSL shading language and vinyl records.

Safe HaskellNone

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.

Synopsis

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.

Instances

class SetUniformFields a Source

Instances