I set a vertex buffer object (VBO) with vertex and index data. I also created GLprogram to use custom shaders, so I call glUseProgram in my code.
My vertex data changes every frame, so I sent GL_STREAM_DRAW to my two glBufferData (one for vertex data, one for indexes).
I use glBufferSubData to change the areas of my vertex data when they change. In each frame, I want to draw from the first vertex to Nth, with N being a changing value.
My question is: what commands should I call every time I call glDrawElements ? Ideally, I would just call glDrawElements own for every frame for performance reasons.
I look through the book "OpenGL ES 2.0 Programming Guide", but nowhere does it tell me which commands I should use each time I draw, and which I need to call only once.
source share