PDA

View Full Version : Can I use glBufferSubData to overrun the length of the original buffer?



Leadwerks
04-25-2007, 05:24 PM
Is it okay to use glBufferSubDataARB to poke data beyond the size of the vertex buffer object originally given data with glBufferDataARB? Can I use it to add new vertices to the locked buffer?

Jon Leech (oddhack)
04-25-2007, 07:41 PM
Originally posted by Leadwerks:
Is it okay to use glBufferSubDataARB to poke data beyond the size of the vertex buffer object originally given data with glBufferDataARB? Can I use it to add new vertices to the locked buffer? No. See the glBufferSubData man page in the SDK (http://www.opengl.org/sdk/docs/man/) :


glBufferSubData redefines some or all of the data store for the buffer object currently bound to target. Data starting at byte offset offset and extending for size bytes is copied to the data store from the memory pointed to by data. An error is thrown if offset and size together define a range beyond the bounds of the buffer object's data store.