6
CoreImage로 그리기를 위해 GLKViewController/GLKView를 설정할 때 가끔 제목에주의를 얻습니다.CoreImage : EAGLContext 프레임 버퍼 또는 렌더 버퍼가 잘못 구성되었습니다.
셋업은 다음과 같습니다
_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의 파단을 가지고 있고 내가보기를 추가/제거 할 때 어떻게 든 일시적으로 컨텍스트를 무효화 것으로 보인다. 문제는 문제가없는 컨텍스트에서 그릴 수있는 다음 업데이트를 (일부 드문 경우를 제외하고는 여전히 코너가 필요함) 있습니다.
그리기가 실패하면 다시 시도해도되지만 상황이 잘못되었다는 것을 어떻게 알 수 있습니까? 그것을 탐지하거나 무효화되지 않게하려면 어떻게해야합니까?