I am trying to draw coloured landscape around my game which is dynamically changing its shape and color when player moves on.
Even simple drawing couses framerate to drop to around 10 FPS.
-(void) draw {
glPointSize(1);
glColor4ub(100,100,100,255);
for(int i=0; i<100; i+=1){
for (int j=0; j<100; j++){
ccDrawPoint(ccp(i, j));
}
}
}
What could I do to make these operations work faster?
Drawing custom shapes with ccDrawPoint or ccDrawLine is not very good solution.
The best way to draw custom shape is to draw multiple triangles or even better – multiple polygons.
Check this thread to see how to do it: http://www.cocos2d-iphone.org/forum/topic/848