Hi, all -
I'm trying to port some old-ish code, previously compiled and used in the field with both JOGL 1.1.1 and 2.0-rc5. (This is from one of the featured apps on the JOGL home page. I'm trying to dust it off and bring it up to date.)
Consider the following snippet -
***********************************
CurrentGL2.glEnableClientState(GL2.GL_VERTEX_ARRAY);
CurrentGL2.glEnableClientState(GL2.GL_NORMAL_ARRAY);
CurrentGL2.glVertexPointer(3, GL2.GL_DOUBLE, 0, VertsBuffer);
CurrentGL2.glNormalPointer(GL2.GL_DOUBLE, 0, NormsBuffer);
for (int t = 0; t < max; t++)
{
int index = t * 3;
IndexBuffer.position(index);
CurrentGL.glDrawElements(GL.GL_TRIANGLES, 3, GL.GL_UNSIGNED_INT, IndexBuffer);
}
***********************************
All buffers are rewound at the proper times, etc. - this is pretty unremarkable code, directly ported from working C code. And as I said, it had previously worked with the two above-mentioned versions of JOGL.
So I'm trying to port this to JOGL 2.2.4, and the call to glDrawElements won't compile. It no longer wants a Buffer passed as the last variable, but a long (an offset into the the buffer).
Here's the Javadoc declaration from V1.1.1 -
**********************************
public void glDrawElements(int mode,
int count,
int type,
Buffer indices)
Interface to C language function:
void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices);
**********************************
The current javadoc shows the declaration changed to the following -
**********************************
void glDrawElements(int mode,
int count,
int type,
long indices_buffer_offset)
Entry point to C language function:
void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices)
*********************************
Note what has happened to the final parameter. Also note how the current version still claims to wrap the same base GL glDrawElements function, which will still want a pointer to the index array as it's 4th parameter.
So what am I missing here? I have been away from the GL scene for a while, but as far as I can tell, the underlying C function hasn't changed, so why has the JOGL wrapper? And what would be a work-around? (This code doesn't use VBO's or any other extension-based GL feature. It's a lowest common denominator app.)
TIA for your time and help -
If you reply to this email, your message will be added to the discussion below:http://forum.jogamp.org/Port-from-V2-0rc5-to-2-4-4-breaks-glDrawElements-tp4033854.html
Free forum by Nabble | Edit this page |