Mercurial > hg > orthanc-stone
diff Framework/Scene2D/OpenGLCompositor.cpp @ 1211:d10d2acb8a02 broker
compositors do not keep a reference to the scene anymore
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 04 Dec 2019 16:47:21 +0100 |
parents | 32eaf4929b08 |
children | 3fe803f65c47 |
line wrap: on
line diff
--- a/Framework/Scene2D/OpenGLCompositor.cpp Wed Dec 04 16:13:10 2019 +0100 +++ b/Framework/Scene2D/OpenGLCompositor.cpp Wed Dec 04 16:47:21 2019 +0100 @@ -128,10 +128,8 @@ } } - OpenGLCompositor::OpenGLCompositor(OpenGL::IOpenGLContext& context, - const Scene2D& scene) : + OpenGLCompositor::OpenGLCompositor(OpenGL::IOpenGLContext& context) : context_(context), - helper_(scene, *this), colorTextureProgram_(context), floatTextureProgram_(context), linesProgram_(context), @@ -139,6 +137,7 @@ canvasWidth_(0), canvasHeight_(0) { + ResetScene(); } OpenGLCompositor::~OpenGLCompositor() @@ -154,7 +153,7 @@ } } - void OpenGLCompositor::Refresh() + void OpenGLCompositor::Refresh(const Scene2D& scene) { if (!context_.IsContextLost()) { @@ -167,11 +166,10 @@ glClearColor(0, 0, 0, 1); glClear(GL_COLOR_BUFFER_BIT); - helper_.Refresh(canvasWidth_, canvasHeight_); + helper_->Refresh(scene, canvasWidth_, canvasHeight_); context_.SwapBuffer(); } - } void OpenGLCompositor::SetFont(size_t index,