提交 0e75a316 编写于 作者: Z Zhang Rui

ios/GLView: render buffer only after something has been drawed

Issue: An OpenGL ES-based application displays "flashing" or "stale"
frames after a call to presentRenderBuffer.

This symptom can occur when an OpenGL ES application calls the EAGL
presentRenderbuffer method without first drawing anything. What is
seen on screen may contain uninitialized pixels or previously rendered
frames. To correct this issue, you should always draw something to your
framebuffer before calling presentRenderbuffer. Also note that unless
you set the RetainedBackbuffer property on your CAEAGLLayer to enable
retained backbuffer mode, the contents of your renderbuffer are not
guaranteed to remain valid after a call to presentRenderbuffer.
上级 0552cc0f
......@@ -567,10 +567,10 @@ exit:
#endif
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}
glBindRenderbuffer(GL_RENDERBUFFER, _renderbuffer);
[_context presentRenderbuffer:GL_RENDERBUFFER];
glBindRenderbuffer(GL_RENDERBUFFER, _renderbuffer);
[_context presentRenderbuffer:GL_RENDERBUFFER];
}
// Detach context before leaving display, to avoid multiple thread issues.
if ([EAGLContext currentContext] == _context)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册