I have a large texture atlas and I'm drawing lots of textures on the screen from this. At the moment each texture from the atlas is drawn separately with code like this:
GLfloat coordinates[] = { bla, bla, bla, bla, bla, bla, bla, bla }; GLfloat vertices[] = { bla, bla, bla, bla, bla, bla bla, bla, bla bla, bla bla }; glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, name); glVertexPointer(3, GL_FLOAT, 0, vertices); glTexCoordPointer(2, GL_FLOAT, 0, coordinates); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
So we're doing this with a triangle strip.
Now, I just tried to cache these kinds of calls by saving the coordinates/vertices, and drawing them all out in a single call. But OpenGL ES does not have quads so trying to use triangle strips means the operation will merge them all together and you get textures warping across the screen from the previous point.
I tried with both glDrawArrays and glDrawElements but I didn't get any success. Is this even possible?