OpenGL-2.8.0.0: A binding for the OpenGL graphics system

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

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 Source

newtype Light Source

Constructors

Light GLsizei |

Instances

Eq Light |
Ord Light |
Show Light |

light :: Light -> StateVar Capability Source

maxLights :: GettableStateVar GLsizei Source

data FrontFaceDirection Source

Constructors

CW |
CCW |

Instances

Eq FrontFaceDirection |
Ord FrontFaceDirection |
Show FrontFaceDirection |

frontFace :: StateVar FrontFaceDirection Source

# Lighting Parameter Specification

data Face Source

Constructors

Front |
Back |
FrontAndBack |

Instances

Eq Face |
Ord Face |
Show Face |

materialAmbient :: Face -> StateVar (Color4 GLfloat)Source

materialDiffuse :: Face -> StateVar (Color4 GLfloat)Source

materialAmbientAndDiffuse :: Face -> StateVar (Color4 GLfloat)Source

materialSpecular :: Face -> StateVar (Color4 GLfloat)Source

materialEmission :: Face -> StateVar (Color4 GLfloat)Source

materialShininess :: Face -> StateVar GLfloat Source

maxShininess :: GettableStateVar GLfloat Source

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

ambient :: Light -> StateVar (Color4 GLfloat)Source

diffuse :: Light -> StateVar (Color4 GLfloat)Source

specular :: Light -> StateVar (Color4 GLfloat)Source

position :: Light -> StateVar (Vertex4 GLfloat)Source

spotDirection :: Light -> StateVar (Normal3 GLfloat)Source

spotExponent :: Light -> StateVar GLfloat Source

maxSpotExponent :: GettableStateVar GLfloat Source

spotCutoff :: Light -> StateVar GLfloat Source

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

lightModelAmbient :: StateVar (Color4 GLfloat)Source

lightModelLocalViewer :: StateVar Capability Source

lightModelTwoSide :: StateVar Capability Source

vertexProgramTwoSide :: StateVar Capability Source

data LightModelColorControl Source

Constructors

SingleColor |
SeparateSpecularColor |

Instances

Eq LightModelColorControl |
Ord LightModelColorControl |
Show LightModelColorControl |

lightModelColorControl :: StateVar LightModelColorControl Source

# ColorMaterial

data ColorMaterialParameter Source

Constructors

Ambient |
Diffuse |
Specular |
Emission |
AmbientAndDiffuse |

Instances

Eq ColorMaterialParameter |
Ord ColorMaterialParameter |
Show ColorMaterialParameter |

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

# Flatshading

data ShadingModel Source

Constructors

Flat |
Smooth |

Instances

Eq ShadingModel |
Ord ShadingModel |
Show ShadingModel |

shadeModel :: StateVar ShadingModel Source

# Color clamping

data ClampTarget Source

Constructors

ClampVertexColor |
ClampFragmentColor |
ClampReadColor |

data ClampMode Source

Constructors

ClampOn |
FixedOnly |
ClampOff |

clampColor :: ClampTarget -> StateVar ClampMode Source