Login  Register

Re: array vertex_buffer_object must be disabled to call this method

Posted by gmseed on Dec 01, 2011; 12:02pm
URL: https://forum.jogamp.org/array-vertex-buffer-object-must-be-disabled-to-call-this-method-tp3551291p3551351.html

Hi

Thanks for your reply.

You say "but you have enabled VBO".

What enables VBO in the non-VBO block:


            gl2.glEnableClientState(GL2.GL_VERTEX_ARRAY);           // enable vertex arrays
            gl2.glVertexPointer(3, GL.GL_FLOAT, 0, mVertices);      // Set The Vertex Pointer To Our Vertex Data
            gl2.glDrawArrays(GL.GL_TRIANGLES, 0, mVertexCount);     // draw arrays
            gl2.glDisableClientState(GL2.GL_VERTEX_ARRAY);          // disable vertex arrays

I don't get it?

If I replace the above 4 lines with the following using, say, glInterleavedArrays() I still get the same exception thrown:

            gl2.glInterleavedArrays(GL2.GL_C3F_V3F, 0, mVertices);
            gl2.glDrawArrays(GL.GL_TRIANGLES, 0, mVertexCount);     // draw arrays

Does JOGL assume that if a Buffer object is passed to functions such as glVertexPointer() and glInterleavedArrays() then VBOs are being used? If so, then how can we implement a non-VBO method using VAs because I only see Buffer arg versions?

Graham