OpenGL-2.8.0.0: A binding for the OpenGL graphics system

Portabilityportable
Stabilitystable
Maintainersven.panne@aedion.de
Safe HaskellNone

Graphics.Rendering.OpenGL.GL.Shaders

Contents

Description

This module corresponds to sections 2.15 (Vertex Shaders) and section 3.11 (Fragment Shaders) of the OpenGL 2.1 specs.

Synopsis

Shader Objects

class (Eq s, Ord s, Show s, ObjectName s) => Shader s Source

shaderSource :: Shader s => s -> StateVar [String]Source

compileShader :: Shader s => s -> IO ()Source

Program Objects

data Program Source

Instances

FragmentData

bindFragDataLocation :: Program -> String -> SettableStateVar DrawBufferIndexSource

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)Source

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.

Vertex attributes

Uniform variables

Implementation limits related to GLSL

maxVertexTextureImageUnits :: GettableStateVar GLsizeiSource

Contains the number of hardware units that can be used to access texture maps from the vertex processor. The minimum legal value is 0.

maxTextureImageUnits :: GettableStateVar GLsizeiSource

Contains the total number of hardware units that can be used to access texture maps from the fragment processor. The minimum legal value is 2.

maxCombinedTextureImageUnits :: GettableStateVar GLsizeiSource

Contains the total number of hardware units that can be used to access texture maps from the vertex processor and the fragment processor combined. Note: If the vertex shader and the fragment processing stage access the same texture image unit, then that counts as using two texture image units. The minimum legal value is 2.

maxTextureCoords :: GettableStateVar GLsizeiSource

Contains the number of texture coordinate sets that are available. The minimum legal value is 2.

maxVertexUniformComponents :: GettableStateVar GLsizeiSource

Contains the number of individual components (i.e., floating-point, integer or boolean values) that are available for vertex shader uniform variables. The minimum legal value is 512.

maxFragmentUniformComponents :: GettableStateVar GLsizeiSource

Contains the number of individual components (i.e., floating-point, integer or boolean values) that are available for fragment shader uniform variables. The minimum legal value is 64.

maxVertexAttribs :: GettableStateVar GLsizeiSource

Contains the number of active vertex attributes that are available. The minimum legal value is 16.

maxVaryingFloats :: GettableStateVar GLsizeiSource

Contains the number of individual floating-point values available for varying variables. The minimum legal value is 32.