Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Program
- data ProgramError
- newProgramSafe :: String -> String -> IO (Either ProgramError Program)
- deleteProgram :: Program -> IO ()
- newProgram :: String -> String -> IO Program
- useProgram :: Program -> IO ()
- setUniform1f :: String -> [Float] -> IO ()
- setUniform2f :: String -> [V2 Float] -> IO ()
- setUniform3f :: String -> [V3 Float] -> IO ()
- setUniform4f :: String -> [V4 Float] -> IO ()
- setUniform1i :: String -> [Int] -> IO ()
- setUniform2i :: String -> [V2 Int] -> IO ()
- setUniform3i :: String -> [V3 Int] -> IO ()
- setUniform4i :: String -> [V4 Int] -> IO ()
- setUniform44 :: String -> [M44 Float] -> IO ()
- setUniform33 :: String -> [M33 Float] -> IO ()
- setUniform22 :: String -> [M22 Float] -> IO ()
Documentation
data Program
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.
data ProgramError
The error message emitted by the driver when shader compilation or linkage fails.
newProgramSafe :: String -> String -> IO (Either ProgramError Program)
Same as newProgram
but does not throw exceptions.
deleteProgram :: Program -> IO ()
Delete a 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 ()
Install a program into the rendering pipeline. Replaces the program already in use, if any.
setUniform1f :: String -> [Float] -> IO ()
setUniform2f :: String -> [V2 Float] -> IO ()
setUniform3f :: String -> [V3 Float] -> IO ()
setUniform4f :: String -> [V4 Float] -> IO ()
setUniform1i :: String -> [Int] -> IO ()
setUniform2i :: String -> [V2 Int] -> IO ()
setUniform3i :: String -> [V3 Int] -> IO ()
setUniform4i :: String -> [V4 Int] -> IO ()
setUniform44 :: String -> [M44 Float] -> IO ()
setUniform33 :: String -> [M33 Float] -> IO ()
setUniform22 :: String -> [M22 Float] -> IO ()