glesv2: add integer variants to operations on buffers
authorAlexis Laferrière <alexis.laf@xymus.net>
Thu, 16 Mar 2017 03:50:32 +0000 (23:50 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Thu, 23 Mar 2017 21:17:55 +0000 (17:17 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/glesv2/glesv2.nit

index abccb02..7161422 100644 (file)
@@ -375,16 +375,26 @@ fun glDisableVertexAttribArray(index: Int) `{ glDisableVertexAttribArray(index);
 # Render primitives from array data
 fun glDrawArrays(mode: GLDrawMode, from, count: Int) `{ glDrawArrays(mode, from, count); `}
 
-# Render primitives from array data by their index
+# Render primitives from array data by their index listed in `indices`
 fun glDrawElements(mode: GLDrawMode, count: Int, typ: GLDataType, indices: Pointer) `{
        glDrawElements(mode, count, typ, indices);
 `}
 
+# Render primitives from array data, at `offset` in the element buffer
+fun glDrawElementsi(mode: GLDrawMode, count: Int, typ: GLDataType, offset: Int) `{
+       glDrawElements(mode, count, typ, (const GLvoid*)offset);
+`}
+
 # Define an array of generic vertex attribute data
 fun glVertexAttribPointer(index, size: Int, typ: GLDataType, normalized: Bool, stride: Int, array: NativeGLfloatArray) `{
        glVertexAttribPointer(index, size, typ, normalized, stride, array);
 `}
 
+# Define an array of generic vertex attribute data, at `offset` in the array buffer
+fun glVertexAttribPointeri(index, size: Int, typ: GLDataType, normalized: Bool, stride: Int, offset: Int) `{
+       glVertexAttribPointer(index, size, typ, normalized, stride, (const GLvoid*)offset);
+`}
+
 # Specify the value of a generic vertex attribute
 fun glVertexAttrib1f(index: Int, x: Float) `{ glVertexAttrib1f(index, x); `}