OpenGL-3.0.3.0: A binding for the OpenGL graphics system

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

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

Instances details

Show Light Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Colors Methods showsPrec :: Int -> Light -> ShowS Source # show :: Light -> String Source # showList :: [Light] -> ShowS Source #
Eq Light Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Colors Methods (==) :: Light -> Light -> Bool Source # (/=) :: Light -> Light -> Bool Source #
Ord Light Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Colors Methods compare :: Light -> Light -> Ordering Source # (<) :: Light -> Light -> Bool Source # (<=) :: Light -> Light -> Bool Source # (>) :: Light -> Light -> Bool Source # (>=) :: Light -> Light -> Bool Source # max :: Light -> Light -> Light Source # min :: Light -> Light -> Light Source #

light :: Light -> StateVar Capability Source #

maxLights :: GettableStateVar GLsizei Source #

data FrontFaceDirection Source #

Constructors

CW |
CCW |

#### Instances

Instances details

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

Instance details

Defined in Graphics.Rendering.OpenGL.GL.Colors

Methods

compare :: FrontFaceDirection -> FrontFaceDirection -> Ordering Source #

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

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

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

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

max :: FrontFaceDirection -> FrontFaceDirection -> FrontFaceDirection Source #

min :: FrontFaceDirection -> FrontFaceDirection -> FrontFaceDirection Source #

frontFace :: StateVar FrontFaceDirection Source #

# Lighting Parameter Specification

data Face Source #

Constructors

Front |
Back |
FrontAndBack |

#### Instances

Instances details

Show Face Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Face Methods showsPrec :: Int -> Face -> ShowS Source # show :: Face -> String Source # showList :: [Face] -> ShowS Source #
Eq Face Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Face Methods (==) :: Face -> Face -> Bool Source # (/=) :: Face -> Face -> Bool Source #
Ord Face Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.Face Methods compare :: Face -> Face -> Ordering Source # (<) :: Face -> Face -> Bool Source # (<=) :: Face -> Face -> Bool Source # (>) :: Face -> Face -> Bool Source # (>=) :: Face -> Face -> Bool Source # max :: Face -> Face -> Face Source # min :: Face -> Face -> Face Source #

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

Instances details

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

Instance details

Defined in Graphics.Rendering.OpenGL.GL.Colors

Methods

compare :: LightModelColorControl -> LightModelColorControl -> Ordering Source #

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

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

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

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

max :: LightModelColorControl -> LightModelColorControl -> LightModelColorControl Source #

min :: LightModelColorControl -> LightModelColorControl -> LightModelColorControl Source #

lightModelColorControl :: StateVar LightModelColorControl Source #

# ColorMaterial

data ColorMaterialParameter Source #

Constructors

Ambient |
Diffuse |
Specular |
Emission |
AmbientAndDiffuse |

#### Instances

Instances details

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

Instance details

Defined in Graphics.Rendering.OpenGL.GL.Colors

Methods

compare :: ColorMaterialParameter -> ColorMaterialParameter -> Ordering Source #

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

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

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

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

max :: ColorMaterialParameter -> ColorMaterialParameter -> ColorMaterialParameter Source #

min :: ColorMaterialParameter -> ColorMaterialParameter -> ColorMaterialParameter Source #

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

# Flatshading

data ShadingModel Source #

Constructors

Flat |
Smooth |

#### Instances

Instances details

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

Instance details

Defined in Graphics.Rendering.OpenGL.GL.Colors

Methods

compare :: ShadingModel -> ShadingModel -> Ordering Source #

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

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

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

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

max :: ShadingModel -> ShadingModel -> ShadingModel Source #

min :: ShadingModel -> ShadingModel -> ShadingModel Source #

shadeModel :: StateVar ShadingModel Source #

# Color clamping

data ClampTarget Source #

Constructors

ClampVertexColor |
ClampFragmentColor |
ClampReadColor |

#### Instances

Instances details

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

Instance details

Defined in Graphics.Rendering.OpenGL.GL.Colors

Methods

compare :: ClampTarget -> ClampTarget -> Ordering Source #

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

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

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

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

max :: ClampTarget -> ClampTarget -> ClampTarget Source #

min :: ClampTarget -> ClampTarget -> ClampTarget Source #

data ClampMode Source #

Constructors

ClampOn |
FixedOnly |
ClampOff |

#### Instances

Instances details

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

Instance details

Defined in Graphics.Rendering.OpenGL.GL.Colors

Methods

compare :: ClampMode -> ClampMode -> Ordering Source #

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

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

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

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

max :: ClampMode -> ClampMode -> ClampMode Source #

min :: ClampMode -> ClampMode -> ClampMode Source #

clampColor :: ClampTarget -> StateVar ClampMode Source #