I don't usually code with Java, but I often play with OpenGL and shaders, so I'll focus more on that infor this review.
I'm uncertain about this line:
GLES20.glBufferData(GLES20.GL_ARRAY_BUFFER, count * (Float.SIZE / 8), vertexBatch, GLES20.GL_STATIC_DRAW); ^^^^^^^^^^^^^^^^
glBufferData
takes the size in bytes of the buffer as its second parameter. So logically, shouldn't it be count * Float.SIZE
instead? Is count
the number of float
s in vertexBatch
, or something else? You should look into this. Try drawing a single sprite and see if the two triangles draw properly. You might have missed this if you were drawing a lot of sprites. Most of them would probably still show even with a wrong buffer size.