[source]
void draw()
{
Vertex* vertices = scene.GetVertexArray();
glEnableClientState(...);
glVertexPointer(..., vertices);
glDrawArrays(...);
glDisableClientState(...);
delete vertices;
}
[/source]
I'm not using VBO since I want to support older OpenGL implementations.
After calling glDrawArrays, I may want to:
- deallocate my vertex array ("delete vertices;")
- perhaps modify some of the vertices
However, GL is free to perform the glDrawArrays asynchronously, and it's not safe to deallocate or modify my array until it has finished.
I could do a glFinish to ensure that, but it'd slow down the app.
So at what moment am I free to deallocate/modify my vertex array?
I'd appreciate if you have some reliable reference for your answer. Thanks.