diff --git a/Fwk/AppFwk/cafViewer/cafViewer.cpp b/Fwk/AppFwk/cafViewer/cafViewer.cpp index a9b128b256..3d742bf7f8 100644 --- a/Fwk/AppFwk/cafViewer/cafViewer.cpp +++ b/Fwk/AppFwk/cafViewer/cafViewer.cpp @@ -227,8 +227,8 @@ void caf::Viewer::setupRenderingSequence() quadRenderGen.addFragmentShaderCode(cvf::ShaderSourceProvider::instance()->getSourceFromRepository(cvf::ShaderSourceRepository::fs_Unlit)); quadRenderGen.addFragmentShaderCode(cvf::ShaderSourceProvider::instance()->getSourceFromRepository(cvf::ShaderSourceRepository::src_Texture)); - cvf::ref quadRendering = quadRenderGen.generate(); - m_renderingSequence->addRendering(quadRendering.p()); + m_quadRendering = quadRenderGen.generate(); + m_renderingSequence->addRendering(m_quadRendering.p()); } updateCamera(width(), height()); @@ -508,10 +508,7 @@ void caf::Viewer::resizeGL(int width, int height) { m_offscreenFbo->resizeAttachedBuffers(width, height); - CVF_ASSERT(m_renderingSequence->renderingCount() > 1); - - cvf::ref quadRendering = m_renderingSequence->rendering(1); - quadRendering->camera()->viewport()->set(0, 0, width, height); + m_quadRendering->camera()->viewport()->set(0, 0, width, height); } updateCamera(width, height); diff --git a/Fwk/AppFwk/cafViewer/cafViewer.h b/Fwk/AppFwk/cafViewer/cafViewer.h index 52eb2e8720..fdbc200b78 100644 --- a/Fwk/AppFwk/cafViewer/cafViewer.h +++ b/Fwk/AppFwk/cafViewer/cafViewer.h @@ -231,6 +231,7 @@ private: // Offscreen render objects cvf::ref m_offscreenFbo; cvf::ref m_offscreenTexture; + cvf::ref m_quadRendering; }; } // End namespace caf