@@ -26,7 +26,8 @@ module Graphics.Rendering.OpenGL.GL.VertexArrays (
26
26
clientState , clientActiveTexture ,
27
27
28
28
-- * Dereferencing and Rendering
29
- ArrayIndex , NumArrayIndices , NumIndexBlocks ,
29
+ ArrayIndex , NumArrayIndices , NumIndexBlocks , NumInstances ,
30
+ BaseInstance , BaseVertex ,
30
31
arrayElement ,
31
32
32
33
drawArrays , drawArraysInstancedBaseInstance , drawArraysInstanced ,
@@ -333,6 +334,16 @@ type NumArrayIndices = GLsizei
333
334
334
335
type NumIndexBlocks = GLsizei
335
336
337
+ type NumInstances = GLsizei
338
+
339
+ type BaseInstance = GLuint
340
+
341
+ type BaseVertex = GLint
342
+
343
+ -- TODO: The ranges (ArrayIndex, ArrayIndex) below should actually use GLuint:
344
+ -- type RangeStart = GLuint
345
+ -- type RangeEnd = GLuint
346
+
336
347
--------------------------------------------------------------------------------
337
348
338
349
arrayElement :: ArrayIndex -> IO ()
@@ -341,52 +352,43 @@ arrayElement = glArrayElement
341
352
drawArrays :: PrimitiveMode -> ArrayIndex -> NumArrayIndices -> IO ()
342
353
drawArrays = glDrawArrays . marshalPrimitiveMode
343
354
344
- drawArraysInstancedBaseInstance :: PrimitiveMode -> ArrayIndex -> NumArrayIndices -> GLsizei -> GLuint -> IO () -- TODO: type
355
+ drawArraysInstancedBaseInstance :: PrimitiveMode -> ArrayIndex -> NumArrayIndices -> NumInstances -> BaseInstance -> IO ()
345
356
drawArraysInstancedBaseInstance = glDrawArraysInstancedBaseInstance . marshalPrimitiveMode
346
357
347
- drawArraysInstanced :: PrimitiveMode -> ArrayIndex -> NumArrayIndices -> GLsizei -> IO () -- TODO: type
358
+ drawArraysInstanced :: PrimitiveMode -> ArrayIndex -> NumArrayIndices -> NumInstances -> IO ()
348
359
drawArraysInstanced = glDrawArraysInstanced . marshalPrimitiveMode
349
360
350
- multiDrawArrays ::
351
- PrimitiveMode -> Ptr ArrayIndex -> Ptr NumArrayIndices -> NumIndexBlocks
352
- -> IO ()
361
+ multiDrawArrays :: PrimitiveMode -> Ptr ArrayIndex -> Ptr NumArrayIndices -> NumIndexBlocks -> IO ()
353
362
multiDrawArrays = glMultiDrawArrays . marshalPrimitiveMode
354
363
355
364
drawElements :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> IO ()
356
365
drawElements m c = glDrawElements (marshalPrimitiveMode m) c . marshalDataType
357
366
358
- drawElementsInstancedBaseInstance :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> GLsizei -> GLuint -> IO () -- TODO: type
367
+ drawElementsInstancedBaseInstance :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> NumInstances -> BaseInstance -> IO ()
359
368
drawElementsInstancedBaseInstance m c = glDrawElementsInstancedBaseInstance (marshalPrimitiveMode m) c . marshalDataType
360
369
361
- drawElementsInstanced :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> GLsizei -> IO () -- TODO: type
370
+ drawElementsInstanced :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> NumInstances -> IO ()
362
371
drawElementsInstanced m c = glDrawElementsInstanced (marshalPrimitiveMode m) c . marshalDataType
363
372
364
- multiDrawElements ::
365
- PrimitiveMode -> Ptr NumArrayIndices -> DataType -> Ptr (Ptr a )
366
- -> NumIndexBlocks -> IO ()
367
- multiDrawElements m c =
368
- glMultiDrawElements (marshalPrimitiveMode m) c . marshalDataType
373
+ multiDrawElements :: PrimitiveMode -> Ptr NumArrayIndices -> DataType -> Ptr (Ptr a ) -> NumIndexBlocks -> IO ()
374
+ multiDrawElements m c = glMultiDrawElements (marshalPrimitiveMode m) c . marshalDataType
369
375
370
- drawRangeElements ::
371
- PrimitiveMode -> (ArrayIndex , ArrayIndex ) -> NumArrayIndices -> DataType
372
- -> Ptr a -> IO ()
373
- drawRangeElements m (s, e) c =
374
- glDrawRangeElements (marshalPrimitiveMode m) (fromIntegral s)
375
- (fromIntegral e) c . marshalDataType
376
+ drawRangeElements :: PrimitiveMode -> (ArrayIndex , ArrayIndex ) -> NumArrayIndices -> DataType -> Ptr a -> IO ()
377
+ drawRangeElements m (s, e) c = glDrawRangeElements (marshalPrimitiveMode m) (fromIntegral s) (fromIntegral e) c . marshalDataType
376
378
377
- drawElementsBaseVertex :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> GLint -> IO () -- TODO: type
379
+ drawElementsBaseVertex :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> BaseVertex -> IO ()
378
380
drawElementsBaseVertex m c = glDrawElementsBaseVertex (marshalPrimitiveMode m) c . marshalDataType
379
381
380
- drawRangeElementsBaseVertex :: PrimitiveMode -> (ArrayIndex , ArrayIndex ) -> NumArrayIndices -> DataType -> Ptr a -> GLint -> IO () -- TODO: type
382
+ drawRangeElementsBaseVertex :: PrimitiveMode -> (ArrayIndex , ArrayIndex ) -> NumArrayIndices -> DataType -> Ptr a -> BaseVertex -> IO ()
381
383
drawRangeElementsBaseVertex m (s, e) c = glDrawRangeElementsBaseVertex (marshalPrimitiveMode m) (fromIntegral s) (fromIntegral e) c . marshalDataType
382
384
383
- drawElementsInstancedBaseVertex :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> GLsizei -> GLint -> IO () -- TODO: type
385
+ drawElementsInstancedBaseVertex :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> NumInstances -> BaseVertex -> IO ()
384
386
drawElementsInstancedBaseVertex m c = glDrawElementsInstancedBaseVertex (marshalPrimitiveMode m) c . marshalDataType
385
387
386
- drawElementsInstancedBaseVertexBaseInstance :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> GLsizei -> GLint -> GLuint -> IO () -- TODO: type
388
+ drawElementsInstancedBaseVertexBaseInstance :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> NumInstances -> BaseVertex -> BaseInstance -> IO ()
387
389
drawElementsInstancedBaseVertexBaseInstance m c = glDrawElementsInstancedBaseVertexBaseInstance (marshalPrimitiveMode m) c . marshalDataType
388
390
389
- multiDrawElementsBaseVertex :: PrimitiveMode -> Ptr NumArrayIndices -> DataType -> Ptr (Ptr a ) -> GLsizei -> Ptr GLint -> IO () -- TODO: type
391
+ multiDrawElementsBaseVertex :: PrimitiveMode -> Ptr NumArrayIndices -> DataType -> Ptr (Ptr a ) -> NumIndexBlocks -> Ptr BaseVertex -> IO ()
390
392
multiDrawElementsBaseVertex m c = glMultiDrawElementsBaseVertex (marshalPrimitiveMode m) c . marshalDataType
391
393
392
394
maxElementsVertices :: GettableStateVar NumArrayIndices
0 commit comments