I’m making a game for iOS using GLKit (OpenGL ES 2), and would like to use VBOs and VAOs as I think they would increase performance quite a lot (and Instruments is recommending it when I test my app in it).
I have a lot of textured objects that don’t actually change position, size, texture etc, so I would assume VBOs would help.
At the moment I am using arrays of GLKVector2 to store vertex and texture coordinate data, and I’m not quite sure how to go from here to VBOs.
Can anyone help with this?
Cheers,
Nick.
You can pass them directly to
glBufferData (), like this:This tell OpenGL to generate a buffer and bind it.
glBufferData()actually uploads it to the card. The call toglVertexPointer ()says where you want to start pulling vertices from in the array. The pointer in the last parameter becomes an offset when you’re using VBOs.EDIT: Sorry – filled in some details. Had a brain fart. See here for details.