【问题标题】:CoreImage: EAGLContext framebuffer or renderbuffer incorrectly configuredCoreImage:EAGLContext 帧缓冲区或渲染缓冲区配置不正确
【发布时间】:2012-03-06 17:00:05
【问题描述】:

当我设置 GLKViewController/GLKView 以使用 CoreImage 进行绘图时,有时我会在标题中看到通知。

设置如下:

_context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];

self.view.context = _context;
self.view.drawableDepthFormat = GLKViewDrawableDepthFormat24;
self.view.backgroundColor = UIColor.blackColor;
self.view.contentScaleFactor = UIScreen.mainScreen.scale;

glGenRenderbuffers(1, &_render_buffer);
glBindRenderbuffer(GL_RENDERBUFFER, _render_buffer);
glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);

_core_image_context = [CIContext contextWithEAGLContext: _context];

[EAGLContext setCurrentContext:_context];

我在 GLKView 中有 UIKit 子视图,似乎当我添加/删除视图时,它以某种方式暂时使上下文无效。 问题是(除了在极少数情况下我仍然需要转角)我可以在上下文中毫无问题地绘制下一个更新。

如果绘图失败,我可以重试绘图,但我怎么知道上下文无效?我应该如何检测它或防止它失效?

【问题讨论】:

    标签: opengl-es ios5 core-image eaglcontext


    【解决方案1】:

    GLKView 设置和管理渲染缓冲区。通过显式调用glGenRenderBuffers()glBindRenderbuffer(),您会混淆GLKView 的配置。

    【讨论】:

      猜你喜欢
      • 2020-09-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多