mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-21 22:13:25 -06:00
#279 Access single quad rendering as member of caf::Viewer
This commit is contained in:
parent
a83e797e63
commit
f2f6cfd77c
@ -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<cvf::Rendering> 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<cvf::Rendering> 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);
|
||||
|
@ -231,6 +231,7 @@ private:
|
||||
// Offscreen render objects
|
||||
cvf::ref<cvf::FramebufferObject> m_offscreenFbo;
|
||||
cvf::ref<cvf::Texture> m_offscreenTexture;
|
||||
cvf::ref<cvf::Rendering> m_quadRendering;
|
||||
};
|
||||
|
||||
} // End namespace caf
|
||||
|
Loading…
Reference in New Issue
Block a user