OpenGL-2.2.3.0: A binding for the OpenGL graphics system

Portability | portable
Stability | stable
Maintainer | sven.panne@aedion.de

Graphics.Rendering.OpenGL.GL.Colors

Contents

- Lighting
- Lighting Parameter Specification
- ColorMaterial
- Flatshading

Description

This module corresponds to section 2.14 (Colors and Coloring) of the OpenGL 2.1 specs.

Synopsis

- lighting :: StateVar Capability
- newtype Light = Light GLsizei
- light :: Light -> StateVar Capability
- maxLights :: GettableStateVar GLsizei
- data FrontFaceDirection
  - = CW
  - | CCW
- frontFace :: StateVar FrontFaceDirection
- data Face
  - = Front
  - | Back
  - | FrontAndBack
- materialAmbient :: Face -> StateVar (Color4 GLfloat)
- materialDiffuse :: Face -> StateVar (Color4 GLfloat)
- materialAmbientAndDiffuse :: Face -> StateVar (Color4 GLfloat)
- materialSpecular :: Face -> StateVar (Color4 GLfloat)
- materialEmission :: Face -> StateVar (Color4 GLfloat)
- materialShininess :: Face -> StateVar GLfloat
- maxShininess :: GettableStateVar GLfloat
- materialColorIndexes :: Face -> StateVar (Index1 GLint, Index1 GLint, Index1 GLint)
- ambient :: Light -> StateVar (Color4 GLfloat)
- diffuse :: Light -> StateVar (Color4 GLfloat)
- specular :: Light -> StateVar (Color4 GLfloat)
- position :: Light -> StateVar (Vertex4 GLfloat)
- spotDirection :: Light -> StateVar (Normal3 GLfloat)
- spotExponent :: Light -> StateVar GLfloat
- maxSpotExponent :: GettableStateVar GLfloat
- spotCutoff :: Light -> StateVar GLfloat
- attenuation :: Light -> StateVar (GLfloat, GLfloat, GLfloat)
- lightModelAmbient :: StateVar (Color4 GLfloat)
- lightModelLocalViewer :: StateVar Capability
- lightModelTwoSide :: StateVar Capability
- vertexProgramTwoSide :: StateVar Capability
- data LightModelColorControl
  - = SingleColor
  - | SeparateSpecularColor
- lightModelColorControl :: StateVar LightModelColorControl
- data ColorMaterialParameter
  - = Ambient
  - | Diffuse
  - | Specular
  - | Emission
  - | AmbientAndDiffuse
- colorMaterial :: StateVar (Maybe (Face, ColorMaterialParameter))
- data ShadingModel
  - = Flat
  - | Smooth
- shadeModel :: StateVar ShadingModel

# Lighting

lighting :: StateVar Capability

newtype Light

Constructors

Light GLsizei |

Instances

Eq Light |
Ord Light |
Show Light |

light :: Light -> StateVar Capability

maxLights :: GettableStateVar GLsizei

data FrontFaceDirection

Constructors

CW |
CCW |

Instances

Eq FrontFaceDirection |
Ord FrontFaceDirection |
Show FrontFaceDirection |

frontFace :: StateVar FrontFaceDirection

# Lighting Parameter Specification

data Face

Constructors

Front |
Back |
FrontAndBack |

Instances

Eq Face |
Ord Face |
Show Face |

materialAmbient :: Face -> StateVar (Color4 GLfloat)

materialDiffuse :: Face -> StateVar (Color4 GLfloat)

materialAmbientAndDiffuse :: Face -> StateVar (Color4 GLfloat)

materialSpecular :: Face -> StateVar (Color4 GLfloat)

materialEmission :: Face -> StateVar (Color4 GLfloat)

materialShininess :: Face -> StateVar GLfloat

maxShininess :: GettableStateVar GLfloat

materialColorIndexes :: Face -> StateVar (Index1 GLint, Index1 GLint, Index1 GLint)

ambient :: Light -> StateVar (Color4 GLfloat)

diffuse :: Light -> StateVar (Color4 GLfloat)

specular :: Light -> StateVar (Color4 GLfloat)

position :: Light -> StateVar (Vertex4 GLfloat)

spotDirection :: Light -> StateVar (Normal3 GLfloat)

spotExponent :: Light -> StateVar GLfloat

maxSpotExponent :: GettableStateVar GLfloat

spotCutoff :: Light -> StateVar GLfloat

attenuation :: Light -> StateVar (GLfloat, GLfloat, GLfloat)

lightModelAmbient :: StateVar (Color4 GLfloat)

lightModelLocalViewer :: StateVar Capability

lightModelTwoSide :: StateVar Capability

vertexProgramTwoSide :: StateVar Capability

data LightModelColorControl

Constructors

SingleColor |
SeparateSpecularColor |

Instances

Eq LightModelColorControl |
Ord LightModelColorControl |
Show LightModelColorControl |

lightModelColorControl :: StateVar LightModelColorControl

# ColorMaterial

data ColorMaterialParameter

Constructors

Ambient |
Diffuse |
Specular |
Emission |
AmbientAndDiffuse |

Instances

Eq ColorMaterialParameter |
Ord ColorMaterialParameter |
Show ColorMaterialParameter |

colorMaterial :: StateVar (Maybe (Face, ColorMaterialParameter))

# Flatshading

data ShadingModel

Constructors

Flat |
Smooth |

Instances

Eq ShadingModel |
Ord ShadingModel |
Show ShadingModel |

shadeModel :: StateVar ShadingModel