Mercurial > hg > orthanc-stone
diff Framework/Scene2D/OpenGLCompositor.cpp @ 897:9c2f6d6b9f4a am-dev
Merge
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Tue, 16 Jul 2019 12:37:29 +0200 |
parents | 80829436ce0c 50cd372e2460 |
children | 685c9a2d115f |
line wrap: on
line diff
--- a/Framework/Scene2D/OpenGLCompositor.cpp Fri Jul 12 14:57:48 2019 +0200 +++ b/Framework/Scene2D/OpenGLCompositor.cpp Tue Jul 16 12:37:29 2019 +0200 @@ -134,7 +134,6 @@ canvasWidth_(0), canvasHeight_(0) { - UpdateSize(); } @@ -148,20 +147,14 @@ } - void OpenGLCompositor::UpdateSize() - { - canvasWidth_ = context_.GetCanvasWidth(); - canvasHeight_ = context_.GetCanvasHeight(); - - context_.MakeCurrent(); - glViewport(0, 0, canvasWidth_, canvasHeight_); - } - - void OpenGLCompositor::Refresh() { context_.MakeCurrent(); + canvasWidth_ = context_.GetCanvasWidth(); + canvasHeight_ = context_.GetCanvasHeight(); + + glViewport(0, 0, canvasWidth_, canvasHeight_); glClearColor(0, 0, 0, 1); glClear(GL_COLOR_BUFFER_BIT); @@ -174,6 +167,8 @@ void OpenGLCompositor::SetFont(size_t index, const GlyphBitmapAlphabet& dict) { + context_.MakeCurrent(); + std::auto_ptr<Font> font(new Font(dict)); Fonts::iterator found = fonts_.find(index);