I’m trying to draw a simple colored circle on the screen with cocos2d, but everything I draw comes out white.
I tried glColor4f and glColor4ub but neither one works, even though they were used here to draw colored primitives: http://code.google.com/p/cocos2d-iphone/source/browse/trunk/tests/drawPrimitivesTest.m?r=1813
These are examples straight out of their code, but it’s just giving me a white circle and a white line.
-(void) draw
{
[super draw];
glEnable(GL_LINE_SMOOTH);
glColor4f(0.0, 1.0, 0.0, 1.0);
glLineWidth(2.0f);
ccDrawLine(ccp(10,100),ccp(50,79));
glLineWidth(16);
glColor4ub(0, 255, 0, 255);
ccDrawCircle( ccp(200, 200), 100, 0, 10, NO);
}
cocos2d 2.0 uses OpenGLES 2.0.
glColor4fno longer exists. To change the draw color you can use