I am using cocos2d for mac.
I have overloaded the ccdrawline of a CCLayer subclass inorder to draw a line. It works fine. To change the color to red I use
glColor4f(1.0f,0,0,1.0f);
but whatever value I gave to the glColor4f the color does not change. It remains white.
but I noticed that other openGL functions such as glLineWidth(5.0f) are working correctly!.
If you’re on cocos2d 2.x you can use:
as defined in
CCDrawingPrimitives.h.Though as phix23 pointed out it’s a global function, so you can use it straight away.