Here is a fiddle of the simplest case: http://jsfiddle.net/headchem/r28mm/10/
Is there any way to avoid calling this line for every single triangle I wish to draw?
gl.drawArrays(gl.TRIANGLES, 0, numItems);
As a learning exercise, I'm trying to create a 2D game out of simple colored triangles. I'd like to put several hundred moving triangles on screen each frame, but my framerate is very slow with my current attempts. I suspect it's because of the hundreds of drawArrays() calls I am making each frame.
I've read a bit about Vertex Buffer Objects, and this question sounds promising, but I'm having trouble putting all the pieces together in my fiddle demo above. Is it possible to render hundreds of unique 2D triangle shapes + different colors + transparency in a single draw call with good performance?