Re: array vertex_buffer_object must be disabled to call this method
Posted by gmseed on Dec 01, 2011; 1:42pm
URL: https://forum.jogamp.org/array-vertex-buffer-object-must-be-disabled-to-call-this-method-tp3551291p3551615.html
Hi
Now I get it!!
The code logic was:
mIsVBOSupported = GLUtilities.isVBOSupported(gl);
if (mIsVBOSupported)
{
// Generate And Bind The Vertex Buffer
GL2 gl2 = gl.getGL2();
gl2.glGenBuffers(1, mVBOVertices, 0); // Get A Valid Name
gl2.glBindBuffer(GL2.GL_ARRAY_BUFFER, mVBOVertices[0]); // Bind The Buffer
// Load The Data - "Static" means the data in VBO will not be changed (specified once and used many times)
gl2.glBufferData(GL.GL_ARRAY_BUFFER, mVertexCount * 3 * Buffers.SIZEOF_FLOAT, mVertices, GL2.GL_STATIC_DRAW);
int[] bufferSizeArray = new int[1];
gl2.glGetBufferParameteriv(GL2.GL_ARRAY_BUFFER, GL2.GL_BUFFER_SIZE,bufferSizeArray,0);
int actualBufferSize = bufferSizeArray[0];
// Our Copy Of The Data Is No Longer Necessary, It Is Safe In The Graphics Card
mVertices = null;
}
else
{
//...
}
Thus, is VBOs are supported but NOT used and VAs are used instead then the VBO binding had already taken place. Thus, the logic has to be replaced with:
if (mIsVBOSupported && mUseVBOs)
{
}
Graham