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.VertexArrays

Contents

- Describing Data for the Arrays
- Specifying Data for the Arrays
- Enabling Arrays
- Dereferencing and Rendering
- Generic Vertex Attribute Arrays

Description

This module corresponds to section 2.8 (Vertex Arrays) of the OpenGL 2.1 specs.

Synopsis

- type NumComponents = GLint
- data DataType
  - = UnsignedByte
  - | Byte
  - | UnsignedShort
  - | Short
  - | UnsignedInt
  - | Int
  - | HalfFloat
  - | Float
  - | UnsignedByte332
  - | UnsignedByte233Rev
  - | UnsignedShort565
  - | UnsignedShort565Rev
  - | UnsignedShort4444
  - | UnsignedShort4444Rev
  - | UnsignedShort5551
  - | UnsignedShort1555Rev
  - | UnsignedInt8888
  - | UnsignedInt8888Rev
  - | UnsignedInt1010102
  - | UnsignedInt2101010Rev
  - | UnsignedInt248
  - | UnsignedInt10f11f11fRev
  - | UnsignedInt5999Rev
  - | Float32UnsignedInt248Rev
  - | Bitmap
  - | UnsignedShort88
  - | UnsignedShort88Rev
  - | Double
  - | TwoBytes
  - | ThreeBytes
  - | FourBytes
- type Stride = GLsizei
- data VertexArrayDescriptor a = VertexArrayDescriptor !NumComponents !DataType !Stride !(Ptr a)
- data Capability
  - = Disabled
  - | Enabled
- data ClientArrayType
  - = VertexArray
  - | NormalArray
  - | ColorArray
  - | IndexArray
  - | TextureCoordArray
  - | EdgeFlagArray
  - | FogCoordArray
  - | SecondaryColorArray
  - | MatrixIndexArray
- arrayPointer :: ClientArrayType -> StateVar (VertexArrayDescriptor a)
- data InterleavedArrays
  - = V2f
  - | V3f
  - | C4ubV2f
  - | C4ubV3f
  - | C3fV3f
  - | N3fV3f
  - | C4fN3fV3f
  - | T2fV3f
  - | T4fV4f
  - | T2fC4ubV3f
  - | T2fC3fV3f
  - | T2fN3fV3f
  - | T2fC4fN3fV3f
  - | T4fC4fN3fV4f
- interleavedArrays :: InterleavedArrays -> Stride -> Ptr a -> IO ()
- clientState :: ClientArrayType -> StateVar Capability
- clientActiveTexture :: StateVar TextureUnit
- type ArrayIndex = GLint
- type NumArrayIndices = GLsizei
- type NumIndexBlocks = GLsizei
- type NumInstances = GLsizei
- type BaseInstance = GLuint
- type BaseVertex = GLint
- arrayElement :: ArrayIndex -> IO ()
- drawArrays :: PrimitiveMode -> ArrayIndex -> NumArrayIndices -> IO ()
- drawArraysInstancedBaseInstance :: PrimitiveMode -> ArrayIndex -> NumArrayIndices -> NumInstances -> BaseInstance -> IO ()
- drawArraysInstanced :: PrimitiveMode -> ArrayIndex -> NumArrayIndices -> NumInstances -> IO ()
- multiDrawArrays :: PrimitiveMode -> Ptr ArrayIndex -> Ptr NumArrayIndices -> NumIndexBlocks -> IO ()
- drawElements :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> IO ()
- drawElementsInstancedBaseInstance :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> NumInstances -> BaseInstance -> IO ()
- drawElementsInstanced :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> NumInstances -> IO ()
- multiDrawElements :: PrimitiveMode -> Ptr NumArrayIndices -> DataType -> Ptr (Ptr a) -> NumIndexBlocks -> IO ()
- drawRangeElements :: PrimitiveMode -> (ArrayIndex, ArrayIndex) -> NumArrayIndices -> DataType -> Ptr a -> IO ()
- drawElementsBaseVertex :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> BaseVertex -> IO ()
- drawRangeElementsBaseVertex :: PrimitiveMode -> (ArrayIndex, ArrayIndex) -> NumArrayIndices -> DataType -> Ptr a -> BaseVertex -> IO ()
- drawElementsInstancedBaseVertex :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> NumInstances -> BaseVertex -> IO ()
- drawElementsInstancedBaseVertexBaseInstance :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> NumInstances -> BaseVertex -> BaseInstance -> IO ()
- multiDrawElementsBaseVertex :: PrimitiveMode -> Ptr NumArrayIndices -> DataType -> Ptr (Ptr a) -> NumIndexBlocks -> Ptr BaseVertex -> IO ()
- maxElementsVertices :: GettableStateVar NumArrayIndices
- maxElementsIndices :: GettableStateVar NumArrayIndices
- lockArrays :: StateVar (Maybe (ArrayIndex, NumArrayIndices))
- primitiveRestartIndex :: StateVar (Maybe ArrayIndex)
- primitiveRestartIndexNV :: StateVar (Maybe ArrayIndex)
- vertexAttribPointer :: AttribLocation -> StateVar (IntegerHandling, VertexArrayDescriptor a)
- vertexAttribArray :: AttribLocation -> StateVar Capability

# Describing Data for the Arrays

type NumComponents = GLint Source #

data DataType Source #

Constructors

UnsignedByte |
Byte |
UnsignedShort |
Short |
UnsignedInt |
Int |
HalfFloat |
Float |
UnsignedByte332 |
UnsignedByte233Rev |
UnsignedShort565 |
UnsignedShort565Rev |
UnsignedShort4444 |
UnsignedShort4444Rev |
UnsignedShort5551 |
UnsignedShort1555Rev |
UnsignedInt8888 |
UnsignedInt8888Rev |
UnsignedInt1010102 |
UnsignedInt2101010Rev |
UnsignedInt248 |
UnsignedInt10f11f11fRev |
UnsignedInt5999Rev |
Float32UnsignedInt248Rev |
Bitmap |
UnsignedShort88 |
UnsignedShort88Rev |
Double |
TwoBytes |
ThreeBytes |
FourBytes |

#### Instances

Instances details

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

Instance details

Defined in Graphics.Rendering.OpenGL.GL.DataType

Methods

compare :: DataType -> DataType -> Ordering Source #

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

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

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

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

max :: DataType -> DataType -> DataType Source #

min :: DataType -> DataType -> DataType Source #

type Stride = GLsizei Source #

data VertexArrayDescriptor a Source #

Constructors

VertexArrayDescriptor !NumComponents !DataType !Stride !(Ptr a) |

#### Instances

Instances details

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

Instance details

Defined in Graphics.Rendering.OpenGL.GL.VertexArrays

Methods

compare :: VertexArrayDescriptor a -> VertexArrayDescriptor a -> Ordering Source #

(<) :: VertexArrayDescriptor a -> VertexArrayDescriptor a -> Bool Source #

(<=) :: VertexArrayDescriptor a -> VertexArrayDescriptor a -> Bool Source #

(>) :: VertexArrayDescriptor a -> VertexArrayDescriptor a -> Bool Source #

(>=) :: VertexArrayDescriptor a -> VertexArrayDescriptor a -> Bool Source #

max :: VertexArrayDescriptor a -> VertexArrayDescriptor a -> VertexArrayDescriptor a Source #

min :: VertexArrayDescriptor a -> VertexArrayDescriptor a -> VertexArrayDescriptor a Source #

# Specifying Data for the Arrays

data Capability Source #

Constructors

Disabled |
Enabled |

#### Instances

Instances details

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

Instance details

Defined in Graphics.Rendering.OpenGL.GL.Capability

Methods

compare :: Capability -> Capability -> Ordering Source #

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

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

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

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

max :: Capability -> Capability -> Capability Source #

min :: Capability -> Capability -> Capability Source #

data ClientArrayType Source #

Constructors

VertexArray |
NormalArray |
ColorArray |
IndexArray |
TextureCoordArray |
EdgeFlagArray |
FogCoordArray |
SecondaryColorArray |
MatrixIndexArray |

#### Instances

Instances details

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

Instance details

Defined in Graphics.Rendering.OpenGL.GL.VertexArrays

Methods

compare :: ClientArrayType -> ClientArrayType -> Ordering Source #

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

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

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

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

max :: ClientArrayType -> ClientArrayType -> ClientArrayType Source #

min :: ClientArrayType -> ClientArrayType -> ClientArrayType Source #

arrayPointer :: ClientArrayType -> StateVar (VertexArrayDescriptor a) Source #

data InterleavedArrays Source #

Constructors

V2f |
V3f |
C4ubV2f |
C4ubV3f |
C3fV3f |
N3fV3f |
C4fN3fV3f |
T2fV3f |
T4fV4f |
T2fC4ubV3f |
T2fC3fV3f |
T2fN3fV3f |
T2fC4fN3fV3f |
T4fC4fN3fV4f |

#### Instances

Instances details

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

Instance details

Defined in Graphics.Rendering.OpenGL.GL.VertexArrays

Methods

compare :: InterleavedArrays -> InterleavedArrays -> Ordering Source #

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

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

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

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

max :: InterleavedArrays -> InterleavedArrays -> InterleavedArrays Source #

min :: InterleavedArrays -> InterleavedArrays -> InterleavedArrays Source #

interleavedArrays :: InterleavedArrays -> Stride -> Ptr a -> IO () Source #

# Enabling Arrays

clientState :: ClientArrayType -> StateVar Capability Source #

clientActiveTexture :: StateVar TextureUnit Source #

# Dereferencing and Rendering

type ArrayIndex = GLint Source #

type NumArrayIndices = GLsizei Source #

type NumIndexBlocks = GLsizei Source #

type NumInstances = GLsizei Source #

type BaseInstance = GLuint Source #

type BaseVertex = GLint Source #

arrayElement :: ArrayIndex -> IO () Source #

drawArrays :: PrimitiveMode -> ArrayIndex -> NumArrayIndices -> IO () Source #

drawArraysInstancedBaseInstance :: PrimitiveMode -> ArrayIndex -> NumArrayIndices -> NumInstances -> BaseInstance -> IO () Source #

drawArraysInstanced :: PrimitiveMode -> ArrayIndex -> NumArrayIndices -> NumInstances -> IO () Source #

multiDrawArrays :: PrimitiveMode -> Ptr ArrayIndex -> Ptr NumArrayIndices -> NumIndexBlocks -> IO () Source #

drawElements :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> IO () Source #

drawElementsInstancedBaseInstance :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> NumInstances -> BaseInstance -> IO () Source #

drawElementsInstanced :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> NumInstances -> IO () Source #

multiDrawElements :: PrimitiveMode -> Ptr NumArrayIndices -> DataType -> Ptr (Ptr a) -> NumIndexBlocks -> IO () Source #

drawRangeElements :: PrimitiveMode -> (ArrayIndex, ArrayIndex) -> NumArrayIndices -> DataType -> Ptr a -> IO () Source #

drawElementsBaseVertex :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> BaseVertex -> IO () Source #

drawRangeElementsBaseVertex :: PrimitiveMode -> (ArrayIndex, ArrayIndex) -> NumArrayIndices -> DataType -> Ptr a -> BaseVertex -> IO () Source #

drawElementsInstancedBaseVertex :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> NumInstances -> BaseVertex -> IO () Source #

drawElementsInstancedBaseVertexBaseInstance :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> NumInstances -> BaseVertex -> BaseInstance -> IO () Source #

multiDrawElementsBaseVertex :: PrimitiveMode -> Ptr NumArrayIndices -> DataType -> Ptr (Ptr a) -> NumIndexBlocks -> Ptr BaseVertex -> IO () Source #

maxElementsVertices :: GettableStateVar NumArrayIndices Source #

maxElementsIndices :: GettableStateVar NumArrayIndices Source #

lockArrays :: StateVar (Maybe (ArrayIndex, NumArrayIndices)) Source #

primitiveRestartIndex :: StateVar (Maybe ArrayIndex) Source #

primitiveRestartIndexNV :: StateVar (Maybe ArrayIndex) Source #

# Generic Vertex Attribute Arrays

vertexAttribPointer :: AttribLocation -> StateVar (IntegerHandling, VertexArrayDescriptor a) Source #

vertexAttribArray :: AttribLocation -> StateVar Capability Source #