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 ...@@ -1944,6 +1944,8 @@ void glViewer::snapshot(QImage& _image, int _width, int _height, bool _alpha, bo
if ( fb.isValid() ){ if ( fb.isValid() ){
const GLuint prevFbo = ACG::GLState::getFramebufferDraw();
ACG::GLState::bindFramebuffer(GL_FRAMEBUFFER_EXT,fb.handle()); ACG::GLState::bindFramebuffer(GL_FRAMEBUFFER_EXT,fb.handle());
makeCurrent(); makeCurrent();
...@@ -1974,6 +1976,8 @@ void glViewer::snapshot(QImage& _image, int _width, int _height, bool _alpha, bo ...@@ -1974,6 +1976,8 @@ void glViewer::snapshot(QImage& _image, int _width, int _height, bool _alpha, bo
paintGL(); paintGL();
glFinish(); glFinish();
ACG::GLState::bindFramebuffer(GL_FRAMEBUFFER_EXT, prevFbo);
// Reset alpha settings // Reset alpha settings
if(_alpha) if(_alpha)
properties()->backgroundColor(backColorBak); properties()->backgroundColor(backColorBak);
......
...@@ -1264,6 +1264,8 @@ void DepthPeelingPlugin::render(ACG::GLState* _glState, Viewer::ViewerProperties ...@@ -1264,6 +1264,8 @@ void DepthPeelingPlugin::render(ACG::GLState* _glState, Viewer::ViewerProperties
glPushAttrib(GL_ALL_ATTRIB_BITS); glPushAttrib(GL_ALL_ATTRIB_BITS);
const GLuint targetFbo = ACG::GLState::getFramebufferDraw();
int viewerId = _properties.viewerId(); int viewerId = _properties.viewerId();
ViewerResources* pViewer = &viewerRes_[viewerId]; ViewerResources* pViewer = &viewerRes_[viewerId];
...@@ -1463,7 +1465,7 @@ void DepthPeelingPlugin::render(ACG::GLState* _glState, Viewer::ViewerProperties ...@@ -1463,7 +1465,7 @@ void DepthPeelingPlugin::render(ACG::GLState* _glState, Viewer::ViewerProperties
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// enable back buffer // enable back buffer
ACG::GLState::bindFramebuffer(GL_FRAMEBUFFER_EXT, 0); ACG::GLState::bindFramebuffer(GL_FRAMEBUFFER_EXT, targetFbo);
ACG::GLState::drawBuffer(GL_BACK); ACG::GLState::drawBuffer(GL_BACK);
// program id 3 // program id 3
......
...@@ -504,6 +504,8 @@ void SSAOPlugin::render(ACG::GLState* _glState, Viewer::ViewerProperties& _prope ...@@ -504,6 +504,8 @@ void SSAOPlugin::render(ACG::GLState* _glState, Viewer::ViewerProperties& _prope
{ {
glPushAttrib(GL_ALL_ATTRIB_BITS); glPushAttrib(GL_ALL_ATTRIB_BITS);
const GLuint targetFbo = ACG::GLState::getFramebufferDraw();
int viewerId = _properties.viewerId(); int viewerId = _properties.viewerId();
ViewerResources* pViewer = &viewerRes_[viewerId]; ViewerResources* pViewer = &viewerRes_[viewerId];
...@@ -680,7 +682,7 @@ void SSAOPlugin::render(ACG::GLState* _glState, Viewer::ViewerProperties& _prope ...@@ -680,7 +682,7 @@ void SSAOPlugin::render(ACG::GLState* _glState, Viewer::ViewerProperties& _prope
//----------------------------------------- //-----------------------------------------
// 6. final pass, present result // 6. final pass, present result
glViewport(oldViewport[0], oldViewport[1], oldViewport[2], oldViewport[3]); 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::activeTexture(GL_TEXTURE1);
ACG::GLState::bindTexture(GL_TEXTURE_2D, pViewer->downsampledTex_); ACG::GLState::bindTexture(GL_TEXTURE_2D, pViewer->downsampledTex_);
......
Supports Markdown
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