因为Qt后台是用framebufferobject 来实现的,所以要在paintGL()中开始你的fbo之前,通过glGetIntegerv(GL_FRAMEBUFFER_BINDING,&originalFBO),保存QT原有的FBO,结束绘制你的FBO,就要glBindFrameBuffer(GL_FRAMEBUFFER,originalFBO)再次绑定了
paintGL()
{
fun->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &originalFBO);
/*使用自己的FBO*/
/*结束自己的FBO*/
glBindFrameBuffer(GL_FRAMEBUFFER, originalFBO);
}