Login  Register

Re: How to use VBO?

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

Hi

Please read the "man" of glBufferData:
https://www.opengl.org/sdk/docs/man/html/glBufferData.xhtml

You should rather write:
fBuff = Buffers.newDirectFloatBuffer(resolution*resolution*3*4);

gl.glBufferData(targetsBuffer.get(0), Buffers.SIZEOF_FLOAT*fBuff.capacity(),fBuff,GL.GL_STATIC_DRAW);

targetsBuffer = Buffers.newDirectIntBuffer(1);

Call fBuff.rewind() at the end of your import method.

Please post your exceptions. How can we help you if you don't show us what's wrong? (even though your code helps)
Julien Gouesse | Personal blog | Website