【问题标题】:OpenGL 500 error in cocos2D-iphone on CCRenderTexture endCCRenderTexture 端 cocos2D-iphone 中的 OpenGL 500 错误
【发布时间】:2011-09-23 21:23:36
【问题描述】:

为 ipad 开发绘图应用程序,并使用 CCRenderTexture 作为画布绘制精灵。我使用的绘制循环是基于 cocos 示例中渲染纹理类的循环。

[target begin];

float distance = ccpDistance(start, end);
if (distance > 1) {
    int d = (int)distance;
    float difx = end.x - start.x;
    float dify = end.y - start.y;
    for (float i = 0; i < d; i+=([self.currentBrush sprite].textureRect.size.width * [self.currentBrush sprite].scale)/4.0f) {
        float delta = i / distance;
        [[self.currentBrush sprite] setPosition:ccp(start.x + (difx * delta), start.y  + (dify * delta))];
        [[self.currentBrush sprite] visit];
    }
} else {
    [[self.currentBrush sprite] setPosition:start];
    [[self.currentBrush sprite] visit];
}

[target end];

每次调用 [target end] 我都会收到 OpenGL 0x0500 错误:

OpenGL error 0x0500 in -[EAGLView swapBuffers]

它似乎基于我在“画布”上绘制的精灵的混合功能{GL_ONE, GL_DST_COLOR}。当我使用{GL_ONE, GL_ONE}{GL_ONE, GL_ONE_MINUS_SRC_ALPHA}(橡皮擦)时,我没有遇到同样的问题。

设备和模拟器上的 iOS 4.2 和 4.3 都存在此问题。

这是我第一次使用 OpenGL,所以我在尝试寻找解决方案时感到有些迷茫,非常感谢任何帮助。

[更新]

我删除了所有设置混合的函数调用,因为 GL_DST_COLOR 似乎是导致错误的原因。删除混合调用(橡皮擦除外)后,它看起来仍然一样,所以我很满意。

在阅读 a cocos2d forum post 关于同一问题后得出此解决方案。

【问题讨论】:

  • 论坛帖子好像不存在了?我其实很好奇 Cocos2D 的讨论是什么。也许链接坏了?

标签: ios opengl-es cocos2d-iphone buffer eaglview


【解决方案1】:
May be It's bug in latest version of Cocos2d.It's give the warning and some time Performance is also decrease.I fetch same problem when we put Gesture on the view controller.

Below link is a my question discussion.


**http://stackoverflow.com/questions/21326063/glview-causes-opengl-error?noredirect=1#comment32164422_21326063**

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-27
    相关资源
    最近更新 更多