I am developing a 2D Open GL
game and i have to draw many squares on screen for a tilemap, with a diferent glTexCoordPointer
from the texture.
Now, I don't know how to use Gldrawelements
for draw many squares, which would be the structure of the indices if I want to draw many squares?
And, how can I put each array (vertices), which contains the coordinates of each square on the vertexbuffer
?
Also, will it be possible to set different glTexCoordPointer
for each square in just one call to the method or is necessary a loop like with GlDrawArrays
? But, I want to use gldrawelements
because i dont want to make a loop which execute many times gldrawarrays
for each square, my fps
drops notably.