OpenGL-2.8.0.0: A binding for the OpenGL graphics system

Stability | Portability :
Maintainer | Sven Panne <sven.panne@aedion.de>
Safe Haskell | None

Graphics.Rendering.OpenGL.GL.Shaders.Program

Contents

- Program Objects
- internals

Description

This module correspons with section 2.20.2 (Program Objects) of the OpenGL 3.1 spec.

Synopsis

- newtype Program = Program {
  - programID :: GLuint
  }
- programDeleteStatus :: Program -> GettableStateVar Bool
- attachedShaders :: Program -> StateVar ([VertexShader], [FragmentShader])
- linkProgram :: Program -> IO ()
- linkStatus :: Program -> GettableStateVar Bool
- programInfoLog :: Program -> GettableStateVar String
- validateProgram :: Program -> IO ()
- validateStatus :: Program -> GettableStateVar Bool
- currentProgram :: StateVar (Maybe Program)
- bindFragDataLocation :: Program -> String -> SettableStateVar DrawBufferIndex
- getFragDataLocation :: Program -> String -> IO (Maybe DrawBufferIndex)
- data GetProgramPName
  - = ProgramDeleteStatus
  - | LinkStatus
  - | ValidateStatus
  - | ProgramInfoLogLength
  - | AttachedShaders
  - | ActiveAttributes
  - | ActiveAttributeMaxLength
  - | ActiveUniforms
  - | ActiveUniformMaxLength
  - | TransformFeedbackBufferMode
  - | TransformFeedbackVaryings
  - | TransformFeedbackVaryingMaxLength
- programVar :: (GLint -> a) -> GetProgramPName -> Program -> GettableStateVar a
- getCurrentProgram :: IO Program

# Program Objects

newtype Program

Constructors

Program |

Fields

programID :: GLuint

Instances

Eq Program |
Ord Program |
Show Program |
ObjectName Program |

programDeleteStatus :: Program -> GettableStateVar Bool

attachedShaders :: Program -> StateVar ([VertexShader], [FragmentShader])

linkProgram :: Program -> IO ()

linkStatus :: Program -> GettableStateVar Bool

programInfoLog :: Program -> GettableStateVar String

validateProgram :: Program -> IO ()

validateStatus :: Program -> GettableStateVar Bool

currentProgram :: StateVar (Maybe Program)

bindFragDataLocation :: Program -> String -> SettableStateVar DrawBufferIndex

`bindFragDataLocation` binds a varying variable, specified by program and name, to a drawbuffer. The effects only take place after succesfull linking of the program. invalid arguments and conditions are - an index larger than maxDrawBufferIndex - names starting with `gl_` linking failure will ocure when - one of the arguments was invalid - more than one varying varuable name is bound to the same index It's not an error to specify unused variables, those will be ingored.

getFragDataLocation :: Program -> String -> IO (Maybe DrawBufferIndex)

query the binding of a given variable, specified by program and name. The program has to be linked. The result is Nothing if an error occures or the name is not a name of a varying variable. If the program hasn't been linked an `InvalidOperation` error is generated.

# internals

data GetProgramPName

Constructors

ProgramDeleteStatus |
LinkStatus |
ValidateStatus |
ProgramInfoLogLength |
AttachedShaders |
ActiveAttributes |
ActiveAttributeMaxLength |
ActiveUniforms |
ActiveUniformMaxLength |
TransformFeedbackBufferMode |
TransformFeedbackVaryings |
TransformFeedbackVaryingMaxLength |

programVar :: (GLint -> a) -> GetProgramPName -> Program -> GettableStateVar a

getCurrentProgram :: IO Program