我正在尝试从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];
}
除此之外,当 isSelected = YES 时,实际上并没有在精灵顶部绘制矩形高光,gl 函数也给我警告:
- 函数“glPointSize”的隐式声明在 C99 中无效
- 函数“glColor4f”的隐式声明在 C99 中无效