diff Framework/Scene2D/OpenGLCompositor.cpp @ 1482:5c96bf3f1d32

IOpenGL::RefreshCanvasSize()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 20 Jun 2020 11:08:28 +0200
parents 28c64c246312
children
line wrap: on
line diff
--- a/Framework/Scene2D/OpenGLCompositor.cpp	Fri Jun 19 18:43:09 2020 +0200
+++ b/Framework/Scene2D/OpenGLCompositor.cpp	Sat Jun 20 11:08:28 2020 +0200
@@ -187,7 +187,6 @@
     if (!context_.IsContextLost())
     {
       context_.MakeCurrent(); // this can throw if context lost!
-
       canvasWidth_ = context_.GetCanvasWidth();
       canvasHeight_ = context_.GetCanvasHeight();
 
@@ -244,4 +243,16 @@
     }
   }
 #endif
+
+
+  void OpenGLCompositor::RefreshCanvasSize()
+  {
+    if (!context_.IsContextLost())
+    {
+      context_.MakeCurrent(); // this can throw if context lost!
+      context_.RefreshCanvasSize();  // Difference with Refresh(scene)
+      canvasWidth_ = context_.GetCanvasWidth();
+      canvasHeight_ = context_.GetCanvasHeight();
+    }
+  }
 }