Skip to content

Commit 804829b

Browse files
committed
Exposed ARB_draw_instanced, ARB_base_instance and ARB_draw_elements_base_vertex commands. Typing needs more work...
1 parent f8a1ff1 commit 804829b

File tree

1 file changed

+40
-2
lines changed

1 file changed

+40
-2
lines changed

src/Graphics/Rendering/OpenGL/GL/VertexArrays.hs

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,19 @@ module Graphics.Rendering.OpenGL.GL.VertexArrays (
2727

2828
-- * Dereferencing and Rendering
2929
ArrayIndex, NumArrayIndices, NumIndexBlocks,
30-
arrayElement, drawArrays, multiDrawArrays, drawElements, multiDrawElements,
31-
drawRangeElements, maxElementsVertices, maxElementsIndices, lockArrays,
30+
arrayElement,
31+
32+
drawArrays, drawArraysInstancedBaseInstance, drawArraysInstanced,
33+
multiDrawArrays,
34+
35+
drawElements, drawElementsInstancedBaseInstance, drawElementsInstanced,
36+
multiDrawElements, drawRangeElements,
37+
38+
drawElementsBaseVertex, drawRangeElementsBaseVertex,
39+
drawElementsInstancedBaseVertex, drawElementsInstancedBaseVertexBaseInstance,
40+
multiDrawElementsBaseVertex,
41+
42+
maxElementsVertices, maxElementsIndices, lockArrays,
3243
primitiveRestartIndex, primitiveRestartIndexNV,
3344

3445
-- * Generic Vertex Attribute Arrays
@@ -330,6 +341,12 @@ arrayElement = glArrayElement
330341
drawArrays :: PrimitiveMode -> ArrayIndex -> NumArrayIndices -> IO ()
331342
drawArrays = glDrawArrays . marshalPrimitiveMode
332343

344+
drawArraysInstancedBaseInstance :: PrimitiveMode -> ArrayIndex -> NumArrayIndices -> GLsizei -> GLuint -> IO () -- TODO: type
345+
drawArraysInstancedBaseInstance = glDrawArraysInstancedBaseInstance . marshalPrimitiveMode
346+
347+
drawArraysInstanced :: PrimitiveMode -> ArrayIndex -> NumArrayIndices -> GLsizei -> IO () -- TODO: type
348+
drawArraysInstanced = glDrawArraysInstanced . marshalPrimitiveMode
349+
333350
multiDrawArrays ::
334351
PrimitiveMode -> Ptr ArrayIndex -> Ptr NumArrayIndices -> NumIndexBlocks
335352
-> IO ()
@@ -338,6 +355,12 @@ multiDrawArrays = glMultiDrawArrays . marshalPrimitiveMode
338355
drawElements :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> IO ()
339356
drawElements m c = glDrawElements (marshalPrimitiveMode m) c . marshalDataType
340357

358+
drawElementsInstancedBaseInstance :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> GLsizei -> GLuint -> IO () -- TODO: type
359+
drawElementsInstancedBaseInstance m c = glDrawElementsInstancedBaseInstance (marshalPrimitiveMode m) c . marshalDataType
360+
361+
drawElementsInstanced :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> GLsizei -> IO () -- TODO: type
362+
drawElementsInstanced m c = glDrawElementsInstanced (marshalPrimitiveMode m) c . marshalDataType
363+
341364
multiDrawElements ::
342365
PrimitiveMode -> Ptr NumArrayIndices -> DataType -> Ptr (Ptr a)
343366
-> NumIndexBlocks -> IO ()
@@ -351,6 +374,21 @@ drawRangeElements m (s, e) c =
351374
glDrawRangeElements (marshalPrimitiveMode m) (fromIntegral s)
352375
(fromIntegral e) c . marshalDataType
353376

377+
drawElementsBaseVertex :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> GLint -> IO () -- TODO: type
378+
drawElementsBaseVertex m c = glDrawElementsBaseVertex (marshalPrimitiveMode m) c . marshalDataType
379+
380+
drawRangeElementsBaseVertex :: PrimitiveMode -> (ArrayIndex, ArrayIndex) -> NumArrayIndices -> DataType -> Ptr a -> GLint -> IO () -- TODO: type
381+
drawRangeElementsBaseVertex m (s, e) c = glDrawRangeElementsBaseVertex (marshalPrimitiveMode m) (fromIntegral s) (fromIntegral e) c . marshalDataType
382+
383+
drawElementsInstancedBaseVertex :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> GLsizei -> GLint -> IO () -- TODO: type
384+
drawElementsInstancedBaseVertex m c = glDrawElementsInstancedBaseVertex (marshalPrimitiveMode m) c . marshalDataType
385+
386+
drawElementsInstancedBaseVertexBaseInstance :: PrimitiveMode -> NumArrayIndices -> DataType -> Ptr a -> GLsizei -> GLint -> GLuint -> IO () -- TODO: type
387+
drawElementsInstancedBaseVertexBaseInstance m c = glDrawElementsInstancedBaseVertexBaseInstance (marshalPrimitiveMode m) c . marshalDataType
388+
389+
multiDrawElementsBaseVertex :: PrimitiveMode -> Ptr NumArrayIndices -> DataType -> Ptr (Ptr a) -> GLsizei -> Ptr GLint -> IO () -- TODO: type
390+
multiDrawElementsBaseVertex m c = glMultiDrawElementsBaseVertex (marshalPrimitiveMode m) c . marshalDataType
391+
354392
maxElementsVertices :: GettableStateVar NumArrayIndices
355393
maxElementsVertices = makeGettableStateVar (getSizei1 id GetMaxElementsVertices)
356394

0 commit comments

Comments
 (0)