Login  Register

Re: How to use VBO?

Posted by gouessej on Jan 18, 2015; 4:25pm
URL: https://forum.jogamp.org/How-to-use-VBO-tp4033871p4033881.html

Replace:
gl.glBindVertexArray(targetsBuffer.get(0));
by
gl.glBindBuffer(gl.GL_ARRAY_BUFFER,targetsBuffer.get(0));

glBindVertexArray is used for VAOs, not for VBOs. Please ensure that you call fBuff.rewind() to avoid to ask OpenGL to read beyond the size of the buffer.

If you really want to use VAOs, look at this example:
http://jogamp.org/git/?p=jogl-demos.git;a=blob;f=src/demos/es2/RawGL2ES2demo.java;hb=HEAD

Always look at the documentation when you're not sure of what to pass to an OpenGL method.
Julien Gouesse | Personal blog | Website