org.lwjgl.opengl.OpenGLException: Cannot use Buffers

Started by Wolftein, August 12, 2009, 18:03:59

Previous topic - Next topic

Wolftein

When i try to use VBO, im getting this error.

Exception in thread "main" org.lwjgl.opengl.OpenGLException: Cannot use Buffers when Array Buffer Object is enabled
        at org.lwjgl.opengl.GLChecks.ensureArrayVBOdisabled(GLChecks.java:90)
        at org.lwjgl.opengl.GL11.glVertexPointer(GL11.java:2742)

        ARBVertexBufferObject.glBindBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, vertexID);
        GL11.glVertexPointer(3,renderBuffer.getOffsetPosition(),sharedMemory.asFloatBuffer() );


im using Interleaved Arrays

Fool Running

Your getting that error because you're calling the wrong version of GL11.glVertexPointer(). The version you're using is for using arrays, not VBOs. The version you want to use is GL11.glVertexPointer(int size, int type, int stride, long pointer_buffer_offset).

Take a look at http://lwjgl.org/wiki/doku.php/lwjgl/tutorials/opengl/basicvbo for a simple tutorial.
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D