I have a grid of semi-transparent squares being used for a game board. They are each just a single color fill. I'm declaring them as CocosNodes and the draw function looks like this:
- (void) draw
{
glColor4f(0, 0, 0, opacityLevel);
glVertexPointer(2, GL_FLOAT, 0, vertices);
glEnableClientState(GL_VERTEX_ARRAY);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 6);
glDisableClientState(GL_VERTEX_ARRAY);
}
I pre-declare the vertice array. Since they are filled-in squares each one has a vertices array of 6 points making two triangles.
I have two AtlasSpriteManagers taking care of all the drawing on top of this grid.
Performance-wise, does anyone have advice on whether I might be better served by using an AtlasSpriteManager to draw these boxes, say by having a 1x1 black dot that I stretch or by having a correctly sized black box.
Alternately I'm wondering if having one CocosNode logically handle drawing all the cells rather than having each draw itself would be better optimized.
Thanks in advance.