PDA

View Full Version : DrawElements with VBOs



PaladinOfKaos
08-25-2008, 09:53 AM
I've always used client-side arrays, and the spec isn't very clear on this point, so...

When VBOs are used, and glDrawElements() is called, is the indices pointer an offset into the current VBO, or is it still a pointer to client memory?

Lord crc
08-25-2008, 10:23 AM
If you've bound an element buffer, the indices pointer is an offset into that buffer. If you've not bound an element buffer (but use vertex buffers for the vertex attributes), then it's client memory as usual.

I found tutorial very nice: http://www.g-truc.net/article/vbo-en.pdf.

mfort
08-25-2008, 10:25 AM
I think it is pretty clear:


How is the decision whether to use the array pointer as an offset or
as a real pointer made?

RESOLVED: When the default buffer object (object zero) is
bound, all pointers behave as real pointers. When any other
object is bound, all pointers are treated as offsets.