OpenGL-2.9.2.0: A binding for the OpenGL graphics system

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

Graphics.Rendering.OpenGL.GL.Colors

Contents

- Lighting
- Lighting Parameter Specification
- ColorMaterial
- Flatshading
- Color clamping

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
- data ClampTarget
  - = ClampVertexColor
  - | ClampFragmentColor
  - | ClampReadColor
- data ClampMode
  - = ClampOn
  - | FixedOnly
  - | ClampOff
- clampColor :: ClampTarget -> StateVar ClampMode

# 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

# Color clamping

data ClampTarget

Constructors

ClampVertexColor |
ClampFragmentColor |
ClampReadColor |

Instances

Eq ClampTarget |
Ord ClampTarget |
Show ClampTarget |

data ClampMode

Constructors

ClampOn |
FixedOnly |
ClampOff |

Instances

Eq ClampMode |
Ord ClampMode |
Show ClampMode |

clampColor :: ClampTarget -> StateVar ClampMode