Commit 7dd634fe authored by Martin Schultz's avatar Martin Schultz
Browse files

added missing gl calls to fix GLErrors with QOpenGLWidget

parent 3a1d814a
......@@ -721,15 +721,12 @@ void glViewer::drawScene(double _aspect)
postproc_->resolveStereoAnyglyph(properties_.viewerId());
// =================================================================================
glBindFramebuffer(GL_FRAMEBUFFER, backbufferFbo);
glDrawBuffer(backbufferTarget);
// unbind vbo for qt log window
ACG::GLState::bindBuffer(GL_ARRAY_BUFFER, 0);
ACG::GLState::activeTexture(GL_TEXTURE0);
ACG::GLState::bindTexture(GL_TEXTURE_2D, 0);
// fbo.release();
//
// QRect blitRect(0,0,glstate_->viewport_width(),glstate_->viewport_height());
......@@ -739,7 +736,6 @@ void glViewer::drawScene(double _aspect)
// //time.restart();
// QGLFramebufferObject::blitFramebuffer( 0 , blitRect, &fbo, blitRect , GL_COLOR_BUFFER_BIT );
// //std::cerr << "Elapsed for blit: " << time.elapsed() << std::endl;
glFinish();
frame_time_ = timer.elapsed();
......@@ -747,7 +743,6 @@ void glViewer::drawScene(double _aspect)
// Inside the glWidget rendering, the system should not send extra updates
properties_.blockSignals(false);
}
......@@ -921,7 +916,6 @@ void glViewer::home()
void glViewer::viewAll()
{
makeCurrent();
// update scene graph (get new bounding box and set projection right, including near and far plane)
properties_.lockUpdate();
......@@ -996,7 +990,6 @@ void glViewer::initializeGL()
glstate_->translate(0.0, 0.0, -3.0);
setHome();
// pixel transfer
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
......@@ -1020,7 +1013,6 @@ void glViewer::initializeGL()
ACG::SceneGraph::analyzeSceneGraph(sceneGraphRoot_,maxPases,bbmin,bbmax);
sceneGraph ( sceneGraphRoot_, maxPases,bbmin,bbmax,true);
viewAll();
}
}
......@@ -1033,7 +1025,6 @@ void glViewer::paintGL(double _aspect)
{
if (!initialized_)
initializeGL ();
if (!properties_.updateLocked())
{
properties_.lockUpdate();
......@@ -1074,7 +1065,8 @@ void glViewer::paintGL(double _aspect)
glPopAttrib ();
}
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
}
......
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