PDA

View Full Version : VBO arrays and index arrays



jide
03-16-2006, 11:43 AM
Is there a way for a single one VBO to store both vertex arrays and index arrays ?

From within the specs I could understand there aren't but maybe I missed something.

sqrt[-1]
03-16-2006, 12:57 PM
I am not sure if it is possible, but is there any reason you would want to? (I cannot think of any advantages..)

jide
03-16-2006, 10:33 PM
The only reason is that I would have liked to avoid binding VBO twice more. Am I not obliged to bind them each time I swap from an array buffer to an element array buffer ?

sqrt[-1]
03-16-2006, 11:27 PM
Not sure I understand, vertex arrays and element arrays have different binding points.

eg.

glBindBuffer(GL_ARRAY_BUFFER, vertexVBO);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexVBO);


//Setup vertex pointers

//Draw with index and vertex VBO


Anyway, binding a VBO is intended to be a lightweight operation.

jide
03-17-2006, 03:35 AM
Okay, I didn't understood this point like that. Thanks.