I am having trouble understanding what to use as the "indices" parameter when calling glDrawElementsInstanced() in JOGL.
From looking over some C++ tutorials, it seems that you can just pass in 0 for indices as long as you want to start rendering your vertices from the beginning of the index buffer. JOGL requires that the indices parameter be a Buffer object. I tried creating an IntBuffer with one element, 0, inside it but that didn't work.
When I use this to draw my vertices, I see things drawn on the screen:
gl.glDrawElements(GL.GL_TRIANGLES, 10, GL.GL_UNSIGNED_BYTE, 0)
But when I use this instead, the screen is black:
gl.glDrawElementsInstanced(
GL.GL_TRIANGLES, 10, GL.GL_UNSIGNED_BYTE, IntBuffer.wrap(Array(0)), 1
)
When I use this, I get a type mismatch error:
gl.glDrawElementsInstanced(
GL.GL_TRIANGLES, 10, GL.GL_UNSIGNED_BYTE, 0, 1
)
I am using OpenGL 4 and Scala. I have also set my program to use DebugGL4 and am not getting any error messages.