I am generating the vertex arrays on the fly on each render and I want to delete the arrays afterwards. Does glDrawArrays
immediately copy the vertex arrays to the server? Hence is it safe to delete the vertex arrays after calling glDrawArrays
?
float * vp = GetVertices(); // Regenerated on each render
glVertexPointer(3, GL_FLOAT, 3 * sizeof(float), vp);
glDrawArrays(GL_TRIANGLES, 0, nVertices);
delete[] vp; // Can I do this?
Otherwise, how can I determine when it is safe to delete the vertex arrays?