Commit bb02df16 authored by Martin Schultz's avatar Martin Schultz

store and restore bound fbo when makeCurrent is called for

QOpenGLWidget.

fixes #2
parent 014ec481
......@@ -226,7 +226,18 @@ glViewer::~glViewer()
void glViewer::makeCurrent() {
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,4))
const GLuint prevFbo = ACG::GLState::getFramebufferDraw();
#endif
// calling makeCurrent binds the default FBO when QOpenGLWidget is used
glWidget_->makeCurrent();
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,4))
//restore the previously bound FBO, if it was not 0 as Qt Documentation says we shall not bind 0
if(prevFbo != 0)
ACG::GLState::bindFramebuffer(GL_FRAMEBUFFER, prevFbo);
#endif
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment