OpenGL-3.0.3.0: A binding for the OpenGL graphics system

Copyright | (c) Sven Panne 2006-2019
License | BSD3
Maintainer | Sven Panne <svenpanne@gmail.com>
Stability | stable
Portability | portable
Safe Haskell | None
Language | Haskell2010

Graphics.Rendering.OpenGL.GL.Shaders.Uniform

Contents

- Uniform variables

Description

This module contains functions related to shader uniforms, this corresponds to section 2.20.3 of the OpenGL 3.1 spec (Shader Variables).

Synopsis

- newtype UniformLocation = UniformLocation GLint
- uniformLocation :: Program -> String -> GettableStateVar UniformLocation
- activeUniforms :: Program -> GettableStateVar [(GLint, VariableType, String)]
- class Uniform a where
  - uniform :: UniformLocation -> StateVar a
  - uniformv :: UniformLocation -> GLsizei -> Ptr a -> IO ()
- class Storable a => UniformComponent a

# Uniform variables

newtype UniformLocation Source #

Constructors

UniformLocation GLint |

#### Instances

Instances details

Show UniformLocation Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods showsPrec :: Int -> UniformLocation -> ShowS Source # show :: UniformLocation -> String Source # showList :: [UniformLocation] -> ShowS Source #
Eq UniformLocation Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods (==) :: UniformLocation -> UniformLocation -> Bool Source # (/=) :: UniformLocation -> UniformLocation -> Bool Source #
Ord UniformLocation Source # |

Instance details

Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform

Methods

compare :: UniformLocation -> UniformLocation -> Ordering Source #

(<) :: UniformLocation -> UniformLocation -> Bool Source #

(<=) :: UniformLocation -> UniformLocation -> Bool Source #

(>) :: UniformLocation -> UniformLocation -> Bool Source #

(>=) :: UniformLocation -> UniformLocation -> Bool Source #

max :: UniformLocation -> UniformLocation -> UniformLocation Source #

min :: UniformLocation -> UniformLocation -> UniformLocation Source #

uniformLocation :: Program -> String -> GettableStateVar UniformLocation Source #

activeUniforms :: Program -> GettableStateVar [(GLint, VariableType, String)] Source #

class Uniform a where Source #

Methods

uniform :: UniformLocation -> StateVar a Source #

uniformv :: UniformLocation -> GLsizei -> Ptr a -> IO () Source #

#### Instances

Instances details

Uniform TextureUnit Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods uniform :: UniformLocation -> StateVar TextureUnit Source # uniformv :: UniformLocation -> GLsizei -> Ptr TextureUnit -> IO () Source #
Uniform GLdouble Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods uniform :: UniformLocation -> StateVar GLdouble Source # uniformv :: UniformLocation -> GLsizei -> Ptr GLdouble -> IO () Source #
Uniform GLfloat Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods uniform :: UniformLocation -> StateVar GLfloat Source # uniformv :: UniformLocation -> GLsizei -> Ptr GLfloat -> IO () Source #
Uniform GLint Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods uniform :: UniformLocation -> StateVar GLint Source # uniformv :: UniformLocation -> GLsizei -> Ptr GLint -> IO () Source #
Uniform GLuint Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods uniform :: UniformLocation -> StateVar GLuint Source # uniformv :: UniformLocation -> GLsizei -> Ptr GLuint -> IO () Source #
MatrixComponent a => Uniform (GLmatrix a) Source # | Note: `uniformv` expects all matrices to be in `ColumnMajor` form.
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods uniform :: UniformLocation -> StateVar (GLmatrix a) Source # uniformv :: UniformLocation -> GLsizei -> Ptr (GLmatrix a) -> IO () Source #
UniformComponent a => Uniform (Vector1 a) Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods uniform :: UniformLocation -> StateVar (Vector1 a) Source # uniformv :: UniformLocation -> GLsizei -> Ptr (Vector1 a) -> IO () Source #
UniformComponent a => Uniform (Vector2 a) Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods uniform :: UniformLocation -> StateVar (Vector2 a) Source # uniformv :: UniformLocation -> GLsizei -> Ptr (Vector2 a) -> IO () Source #
UniformComponent a => Uniform (Vector3 a) Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods uniform :: UniformLocation -> StateVar (Vector3 a) Source # uniformv :: UniformLocation -> GLsizei -> Ptr (Vector3 a) -> IO () Source #
UniformComponent a => Uniform (Vector4 a) Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods uniform :: UniformLocation -> StateVar (Vector4 a) Source # uniformv :: UniformLocation -> GLsizei -> Ptr (Vector4 a) -> IO () Source #
UniformComponent a => Uniform (Vertex1 a) Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods uniform :: UniformLocation -> StateVar (Vertex1 a) Source # uniformv :: UniformLocation -> GLsizei -> Ptr (Vertex1 a) -> IO () Source #
UniformComponent a => Uniform (Vertex2 a) Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods uniform :: UniformLocation -> StateVar (Vertex2 a) Source # uniformv :: UniformLocation -> GLsizei -> Ptr (Vertex2 a) -> IO () Source #
UniformComponent a => Uniform (Vertex3 a) Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods uniform :: UniformLocation -> StateVar (Vertex3 a) Source # uniformv :: UniformLocation -> GLsizei -> Ptr (Vertex3 a) -> IO () Source #
UniformComponent a => Uniform (Vertex4 a) Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods uniform :: UniformLocation -> StateVar (Vertex4 a) Source # uniformv :: UniformLocation -> GLsizei -> Ptr (Vertex4 a) -> IO () Source #
UniformComponent a => Uniform (Color3 a) Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods uniform :: UniformLocation -> StateVar (Color3 a) Source # uniformv :: UniformLocation -> GLsizei -> Ptr (Color3 a) -> IO () Source #
UniformComponent a => Uniform (Color4 a) Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods uniform :: UniformLocation -> StateVar (Color4 a) Source # uniformv :: UniformLocation -> GLsizei -> Ptr (Color4 a) -> IO () Source #
UniformComponent a => Uniform (FogCoord1 a) Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods uniform :: UniformLocation -> StateVar (FogCoord1 a) Source # uniformv :: UniformLocation -> GLsizei -> Ptr (FogCoord1 a) -> IO () Source #
UniformComponent a => Uniform (Index1 a) Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods uniform :: UniformLocation -> StateVar (Index1 a) Source # uniformv :: UniformLocation -> GLsizei -> Ptr (Index1 a) -> IO () Source #
UniformComponent a => Uniform (Normal3 a) Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods uniform :: UniformLocation -> StateVar (Normal3 a) Source # uniformv :: UniformLocation -> GLsizei -> Ptr (Normal3 a) -> IO () Source #
UniformComponent a => Uniform (TexCoord1 a) Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods uniform :: UniformLocation -> StateVar (TexCoord1 a) Source # uniformv :: UniformLocation -> GLsizei -> Ptr (TexCoord1 a) -> IO () Source #
UniformComponent a => Uniform (TexCoord2 a) Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods uniform :: UniformLocation -> StateVar (TexCoord2 a) Source # uniformv :: UniformLocation -> GLsizei -> Ptr (TexCoord2 a) -> IO () Source #
UniformComponent a => Uniform (TexCoord3 a) Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods uniform :: UniformLocation -> StateVar (TexCoord3 a) Source # uniformv :: UniformLocation -> GLsizei -> Ptr (TexCoord3 a) -> IO () Source #
UniformComponent a => Uniform (TexCoord4 a) Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform Methods uniform :: UniformLocation -> StateVar (TexCoord4 a) Source # uniformv :: UniformLocation -> GLsizei -> Ptr (TexCoord4 a) -> IO () Source #

class Storable a => UniformComponent a Source #

Minimal complete definition

uniform1, uniform2, uniform3, uniform4, getUniform, uniform1v, uniform2v, uniform3v, uniform4v

#### Instances

Instances details

UniformComponent GLdouble Source # |

Instance details

Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform

Methods

uniform1 :: UniformLocation -> GLdouble -> IO ()

uniform2 :: UniformLocation -> GLdouble -> GLdouble -> IO ()

uniform3 :: UniformLocation -> GLdouble -> GLdouble -> GLdouble -> IO ()

uniform4 :: UniformLocation -> GLdouble -> GLdouble -> GLdouble -> GLdouble -> IO ()

getUniform :: Storable (b GLdouble) => GLuint -> GLint -> Ptr (b GLdouble) -> IO ()

uniform1v :: UniformLocation -> GLsizei -> Ptr GLdouble -> IO ()

uniform2v :: UniformLocation -> GLsizei -> Ptr GLdouble -> IO ()

uniform3v :: UniformLocation -> GLsizei -> Ptr GLdouble -> IO ()

uniform4v :: UniformLocation -> GLsizei -> Ptr GLdouble -> IO ()

UniformComponent GLfloat Source # |

Instance details

Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform

Methods

uniform1 :: UniformLocation -> GLfloat -> IO ()

uniform2 :: UniformLocation -> GLfloat -> GLfloat -> IO ()

uniform3 :: UniformLocation -> GLfloat -> GLfloat -> GLfloat -> IO ()

uniform4 :: UniformLocation -> GLfloat -> GLfloat -> GLfloat -> GLfloat -> IO ()

getUniform :: Storable (b GLfloat) => GLuint -> GLint -> Ptr (b GLfloat) -> IO ()

uniform1v :: UniformLocation -> GLsizei -> Ptr GLfloat -> IO ()

uniform2v :: UniformLocation -> GLsizei -> Ptr GLfloat -> IO ()

uniform3v :: UniformLocation -> GLsizei -> Ptr GLfloat -> IO ()

uniform4v :: UniformLocation -> GLsizei -> Ptr GLfloat -> IO ()

UniformComponent GLint Source # |

Instance details

Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform

Methods

uniform1 :: UniformLocation -> GLint -> IO ()

uniform2 :: UniformLocation -> GLint -> GLint -> IO ()

uniform3 :: UniformLocation -> GLint -> GLint -> GLint -> IO ()

uniform4 :: UniformLocation -> GLint -> GLint -> GLint -> GLint -> IO ()

getUniform :: Storable (b GLint) => GLuint -> GLint -> Ptr (b GLint) -> IO ()

uniform1v :: UniformLocation -> GLsizei -> Ptr GLint -> IO ()

uniform2v :: UniformLocation -> GLsizei -> Ptr GLint -> IO ()

uniform3v :: UniformLocation -> GLsizei -> Ptr GLint -> IO ()

uniform4v :: UniformLocation -> GLsizei -> Ptr GLint -> IO ()

UniformComponent GLuint Source # |

Instance details

Defined in Graphics.Rendering.OpenGL.GL.Shaders.Uniform

Methods

uniform1 :: UniformLocation -> GLuint -> IO ()

uniform2 :: UniformLocation -> GLuint -> GLuint -> IO ()

uniform3 :: UniformLocation -> GLuint -> GLuint -> GLuint -> IO ()

uniform4 :: UniformLocation -> GLuint -> GLuint -> GLuint -> GLuint -> IO ()

getUniform :: Storable (b GLuint) => GLuint -> GLint -> Ptr (b GLuint) -> IO ()

uniform1v :: UniformLocation -> GLsizei -> Ptr GLuint -> IO ()

uniform2v :: UniformLocation -> GLsizei -> Ptr GLuint -> IO ()

uniform3v :: UniformLocation -> GLsizei -> Ptr GLuint -> IO ()

uniform4v :: UniformLocation -> GLsizei -> Ptr GLuint -> IO ()