lowgl-0.2.0.1: Basic gl wrapper and reference

Safe HaskellNone
LanguageHaskell2010

Graphics.GL.Low.Shader

Synopsis

Documentation

data Program Source

A Program object is the combination of a compiled vertex shader and fragment shader. Programs have three kinds of inputs: vertex attributes, uniforms, and samplers. Programs have two outputs: fragment color and fragment depth. At most one program can be "in use" at a time. Same idea as binding targets it's just not called that.

Instances

data ProgramError Source

The error message emitted by the driver when shader compilation or linkage fails.

newProgramSafe :: String -> String -> IO (Either ProgramError Program) Source

Same as newProgram but does not throw exceptions.

deleteProgram :: Program -> IO () Source

Delete a program.

newProgram Source

Arguments

:: String

vertex shader source code

-> String

fragment shader source code

-> IO Program 

Compile the code for a vertex shader and a fragment shader, then link them into a new program. If the compiler or linker fails it will throw a ProgramError.

useProgram :: Program -> IO () Source

Install a program into the rendering pipeline. Replaces the program already in use, if any.