Opengl es 如何在cocos2d iphone中高效地绘制多个原语?

Opengl es 如何在cocos2d iphone中高效地绘制多个原语?,opengl-es,cocos2d-iphone,Opengl Es,Cocos2d Iphone,我正在玩cocos2d iphone,它看起来很棒 但我想为每一次更新在屏幕上画一个圆圈,这会很快降低帧率! 我可以用更快的方法绘制多个基本体吗 这是我目前在美国使用的代码 -(void) draw { glLineWidth(1); glColor4ub(100,100,255,0); float angle = 0; float radius = 10.0f; int numSegments = 10; bool drawLineToCente

我正在玩cocos2d iphone,它看起来很棒

但我想为每一次更新在屏幕上画一个圆圈,这会很快降低帧率! 我可以用更快的方法绘制多个基本体吗

这是我目前在美国使用的代码

-(void) draw
{
    glLineWidth(1);
    glColor4ub(100,100,255,0);
    float angle = 0;
    float radius = 10.0f;
    int numSegments = 10;
    bool drawLineToCenter = NO;

    NSInteger point;
    for (point=0;point < [points count];point++)
    {
        ccDrawCircle([[points objectAtIndex:point] CGPointValue], radius, angle, numSegments, drawLineToCenter);

    }
}
-(无效)绘图
{
线宽(1);
glColor4ub(100100255,0);
浮动角度=0;
浮动半径=10.0f;
整数段=10;
bool drawLineToCenter=否;
恩森特格尔点;
对于(点=0;点<[点计数];点++)
{
ccDrawCircle([[points objectAtIndex:point]CGPointValue],半径、角度、数字段、drawLineToCenter);
}
}

使用精灵而不是原语。然后可以使用CCSpriteBatchNode

cocos2d的原始绘制方法主要用于调试,而不是制作游戏艺术。它们基本上不是批处理操作,这意味着您绘制的每个新原语都将发出绘制调用。而且很贵