Commit 003a6c0c authored by Jan Möbius's avatar Jan Möbius
Browse files

Christopher: More snapshot patches. refs #373

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13747 383ad7c9-94d9-4d36-a494-682f7c89f535
parent d7d671cd
......@@ -1944,6 +1944,8 @@ void glViewer::snapshot(QImage& _image, int _width, int _height, bool _alpha, bo
if ( fb.isValid() ){
const GLuint prevFbo = ACG::GLState::getFramebufferDraw();
ACG::GLState::bindFramebuffer(GL_FRAMEBUFFER_EXT,fb.handle());
makeCurrent();
......@@ -1973,6 +1975,8 @@ void glViewer::snapshot(QImage& _image, int _width, int _height, bool _alpha, bo
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
paintGL();
glFinish();
ACG::GLState::bindFramebuffer(GL_FRAMEBUFFER_EXT, prevFbo);
// Reset alpha settings
if(_alpha)
......
......@@ -1264,6 +1264,8 @@ void DepthPeelingPlugin::render(ACG::GLState* _glState, Viewer::ViewerProperties
glPushAttrib(GL_ALL_ATTRIB_BITS);
const GLuint targetFbo = ACG::GLState::getFramebufferDraw();
int viewerId = _properties.viewerId();
ViewerResources* pViewer = &viewerRes_[viewerId];
......@@ -1463,7 +1465,7 @@ void DepthPeelingPlugin::render(ACG::GLState* _glState, Viewer::ViewerProperties
// ---------------------------------------------------------------------
// enable back buffer
ACG::GLState::bindFramebuffer(GL_FRAMEBUFFER_EXT, 0);
ACG::GLState::bindFramebuffer(GL_FRAMEBUFFER_EXT, targetFbo);
ACG::GLState::drawBuffer(GL_BACK);
// program id 3
......
......@@ -504,6 +504,8 @@ void SSAOPlugin::render(ACG::GLState* _glState, Viewer::ViewerProperties& _prope
{
glPushAttrib(GL_ALL_ATTRIB_BITS);
const GLuint targetFbo = ACG::GLState::getFramebufferDraw();
int viewerId = _properties.viewerId();
ViewerResources* pViewer = &viewerRes_[viewerId];
......@@ -680,7 +682,7 @@ void SSAOPlugin::render(ACG::GLState* _glState, Viewer::ViewerProperties& _prope
//-----------------------------------------
// 6. final pass, present result
glViewport(oldViewport[0], oldViewport[1], oldViewport[2], oldViewport[3]);
ACG::GLState::bindFramebuffer(GL_FRAMEBUFFER_EXT, 0);
ACG::GLState::bindFramebuffer(GL_FRAMEBUFFER_EXT, targetFbo);
ACG::GLState::activeTexture(GL_TEXTURE1);
ACG::GLState::bindTexture(GL_TEXTURE_2D, pViewer->downsampledTex_);
......
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