Login  Register

Re: Requesting help with VBO's

Posted by gouessej on Dec 01, 2012; 8:45am
URL: https://forum.jogamp.org/Requesting-help-with-VBO-s-tp4027348p4027349.html

Hi

I used these classes (still based on JOGL 1) to handle vertex arrays and VBOs:
http://tuer.svn.sourceforge.net/viewvc/tuer/alpha/drawer/VertexArray.java?revision=123&content-type=text%2Fplain
http://tuer.svn.sourceforge.net/viewvc/tuer/alpha/drawer/DynamicVertexBufferObject.java?revision=123&content-type=text%2Fplain

Just look at the key differences. When you create a VBO, you need to call glGenBuffers (to create the identifier), glBindBuffer (to bind the current buffer) and glBufferData (to associate the data store on the GPU to a buffer on the CPU if any and to set the "update" mode). This "update" mode can be ignored by the driver, it is an hint, it changes nothing under very early implementations of VBO whereas it can be very efficient on recent graphics cards.

Call glBindBuffer when you want to use a VBO just before drawing. Sometimes you might have to call glBindBuffer with 0 to unbind a buffer.

Good luck.
Julien Gouesse | Personal blog | Website