I’m trying to compile some example code from the Cocos2d for iPhone 0.99 Beginner’s Guide.:
-(void)draw
{
if(isSelected)
{
[self.mySprite setOpacity:100];
glColor4f(255 / 255.0f, 0 / 255.0f, 0 / 255.0f, 255 / 255.0f);
glPointSize( 30.0 );
ccDrawPoint( self.mySprite.position);
}
[super draw];
}
Apart from this not actually drawing a rectangular highlight on top of the sprite when isSelected = YES, the gl functions are also giving me warnings:
- Implicit declaration of function ‘glPointSize’ is invalid in C99
- Implicit declaration of function ‘glColor4f’ is invalid in C99
Are you using Cocos2D 2.x? Try
ccDrawColor4Finstead ofglColor4fandccPointSizeinstead ofglPointSize.