-1
我正在制作android版的cocos2dx iOS游戏。在iOS中,我们使用本机iOS apis时,几乎没有gl apis被cocos2dx支持。现在,当我运行相同的代码库时,并且这些不受支持的API提供了错误。 followiing是purfact运行在Xcode项目和红粉错误(在各条线的弗朗提及)elcipse代码:Cocos2dx open gl问题
glPushMatrix(); //ERROR: 'glPopMatrix' was not declared in this scope
glTranslatef(x, y, 0.0); //ERROR: 'glPopMatrix' was not declared in this scope
float angle = 360.0/sparkleNum;
int idx, opacity;
idx = index % FIREWORK_TYPE_NUM;
opacity = (1.0 - step) * 255;
for(int i = 0; i < sparkleNum; ++i)
{
glPushMatrix();
glRotatef(i * angle, 0.0, 0.0, 1.0); //ERROR: 'glPopMatrix' was not declared in this scope
glTranslatef(0.0, dist, 0.0);
glScalef(scalar, scalar, scalar);//ERROR: 'glPopMatrix' was not declared in this scope
firework[idx]->setOpacity(opacity);
firework[idx]->draw();
glPopMatrix(); //ERROR: 'glPopMatrix' was not declared in this scope
}
glPopMatrix(); //ERROR: 'glPopMatrix' was not declared in this scope
帮我删除这些错误和成功使用GL的API。