Safe Haskell | None |
---|
Graphics.GLUtil.Shaders
Description
Utilities for working with fragment and vertex shader programs.
- loadShader :: ShaderType -> FilePath -> IO Shader
- linkShaderProgram :: [Shader] -> IO Program
- linkShaderProgramWith :: [Shader] -> (Program -> IO ()) -> IO Program
- namedUniform :: Uniform a => String -> StateVar a
- uniformScalar :: UniformComponent a => UniformLocation -> SettableStateVar a
- uniformVec :: UniformLocation -> SettableStateVar [GLfloat]
- uniformMat :: UniformLocation -> SettableStateVar [[GLfloat]]
- namedUniformMat :: String -> SettableStateVar [[GLfloat]]
- uniformGLMat4 :: UniformLocation -> SettableStateVar (GLmatrix GLfloat)
Documentation
loadShader :: ShaderType -> FilePath -> IO ShaderSource
Load a shader program from a file.
linkShaderProgramWith :: [Shader] -> (Program -> IO ()) -> IO ProgramSource
Link shaders into a Program
with the given action performed
after attaching shaders, but before linking the program. This is
most commonly used to set the bindFragDataLocation
state
variable.
namedUniform :: Uniform a => String -> StateVar aSource
Work with a named uniform shader parameter. Note that this looks
up the variable name on each access, so uniform parameters that
will be accessed frequently should instead be resolved to a
UniformLocation
.
uniformScalar :: UniformComponent a => UniformLocation -> SettableStateVar aSource
Set a UniformLocation
to a scalar value.
uniformVec :: UniformLocation -> SettableStateVar [GLfloat]Source
Set a UniformLocation
from a list representation of a
low-dimensional vector of GLfloat
s. Only 2, 3, and 4 dimensional
vectors are supported.
uniformMat :: UniformLocation -> SettableStateVar [[GLfloat]]Source
Set a uniform shader location from a nested list matrix representation. Only 3x3 and 4x4 matrices are supported.
namedUniformMat :: String -> SettableStateVar [[GLfloat]]Source
Set a named uniform shader parameter from a nested list matrix representation. Only 3x3 and 4x4 matrices are supported.
uniformGLMat4 :: UniformLocation -> SettableStateVar (GLmatrix GLfloat)Source
Set a uniform shader location with a 4x4 GLmatrix
.