I’m getting this error …
Exception in thread “AWT-EventQueue-0” javax.media.opengl.GLException: element v
ertex_buffer_object must be enabled to call this method
at com.sun.opengl.impl.GLImpl.checkBufferObject(GLImpl.java:27718)
at com.sun.opengl.impl.GLImpl.checkElementVBOEnabled(GLImpl.java:27785)
at com.sun.opengl.impl.GLImpl.glDrawElements(GLImpl.java:3542)
… and as far as I can tell, I have GL_VERTEX_ARRAY enabled, or am I not understanding what a vertex buffer object is?
Any help much appreciated.
gl.glEnableClientState(GL.GL_VERTEX_ARRAY);
if (options != null && options.getCullFace()) {
gl.glEnable(GL.GL_CULL_FACE);
gl.glCullFace(GL.GL_BACK);
}
int i = 0;
vElementsBuffer[region].rewind();
gl.glVertexPointer(3, GL.GL_FLOAT, 0, vElementsBuffer[region]);
indBuffers[region].rewind();
while (indBuffers[region].position() < indBuffers[region].capacity()) {
gl.glLoadName(i++);
gl.glDrawElements(GL.GL_TRIANGLES, indBuffers[region].capacity(),
GL.GL_UNSIGNED_INT, indBuffers[region].get());
}
if (options != null && options.getCullFace()) {
gl.glDisable(GL.GL_CULL_FACE);
}
gl.glDisableClientState(GL.GL_VERTEX_ARRAY);