English 中文(简体)
• 如何高效地将多种价格带入宇宙电话吗?
原标题:How to efficiently draw multiple primitives in cocos2d-iphone?

我会与有方言的phone们玩 playing,看着伟大!

But i want to for each update draw another circle on screen, this lowers the framerate very fast! Can i draw multiple primitives a somewhat faster way?

这是目前我们的准则。

-(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);

    }
}
最佳回答

使用间谍,而不是施药。 然后,你可以使用CC SpriteBatchNode。

原始计算法2d主要是为了欺骗目的,而不是构成你的游戏艺术。 这些行动主要是没有中断的,这意味着你所引出的每一种新的原始行动都将发出呼吁。 这样做代价高昂。

问题回答

暂无回答




相关问题
OpenGL ES iPhone - drawing anti aliased lines

Normally, you d use something like: glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glEnable(GL_LINE_SMOOTH); glLineWidth(2.0f); glVertexPointer(2, GL_FLOAT, 0, points); ...

iPhone: Quartz2d vs. OpenGL ES

OK, I m still brand new to iPhone development. I have a free game on the app store, Winner Pong, but it s just a Pong clone (who would ve guessed) that uses the standard UIImageViews for the sprites. ...

GLPaint with white background

I m trying draw on a white background by reverse engineering GLPaint. I ve gone through every combination of kSaturation, kLuminosity and glBlendFunc, AND just about every combination I can think of ...

OpenGL ES - how to keep some object at a fixed size?

I m working on a little game in OpenGL ES. In the background, there is a world/map. The map is just a large texture. Zoom/pinch/pan is used to move around. And I m using glOrthof (left, right, bottom,...

Any free polygon library for the iPhone?

I need a library that can manage polygon modeling and basic transformation like rotating and translating. I d rather not redevelop everything from scratch Thanks

热门标签