How to draw two or more rectangles in OpenGL ES 1.x
Hi!
I am new in OpenGL. Just started to play with drawing triangles and rectangles.
When I want to draw one rectangle I have to define 4 vertices.
Then I call:
glVertexPointer(2, GL_FLOAT, 0, squareVertices);
glColorPointer(4, GL_UNSIGNED_BYTE, 0, squareColors);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
Everything is working and I can see the results in the simulator.
But how to draw to two or more separate rectangles which don't touch each other with one call to glDrawArrays?
Is it possible? When I add next vertices to the array and increment the count
it does not work.
Cheers
axfo
|