LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Wolftein on August 12, 2009, 18:03:59

Title: org.lwjgl.opengl.OpenGLException: Cannot use Buffers
Post by: Wolftein on August 12, 2009, 18:03:59
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
Title: Re: org.lwjgl.opengl.OpenGLException: Cannot use Buffers
Post by: Fool Running on August 13, 2009, 12:44:56
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.