diff Framework/Viewport/WebAssemblyViewport.h @ 947:1091b2adeb5a toa2019081001

Fixed animation frame stopping when returning false + big work on the OpenGL objects to make them lost context-safe + debug code to forcefully tag a context as lost + debug macros
author Benjamin Golinvaux <bgo@osimis.io>
date Sat, 10 Aug 2019 13:07:31 +0200
parents 685c9a2d115f
children a7351ad54960
line wrap: on
line diff
--- a/Framework/Viewport/WebAssemblyViewport.h	Tue Aug 06 15:07:23 2019 +0200
+++ b/Framework/Viewport/WebAssemblyViewport.h	Sat Aug 10 13:07:31 2019 +0200
@@ -58,15 +58,20 @@
     // This function must be called each time the browser window is resized
     void UpdateSize();
 
-    virtual ICompositor& GetCompositor()
+    virtual ICompositor* GetCompositor() ORTHANC_OVERRIDE
     {
-      return *compositor_;
+      return compositor_.get();
     }
 
+    virtual void Refresh() ORTHANC_OVERRIDE;
+
     bool OpenGLContextLost();
     bool OpenGLContextRestored();
 
   private:
+    virtual void DisableCompositor() ORTHANC_OVERRIDE;
+    virtual void RestoreCompositor() ORTHANC_OVERRIDE;
+
     void RegisterContextCallbacks();
   };
 
@@ -86,9 +91,9 @@
 
     virtual void Refresh();
 
-    virtual ICompositor& GetCompositor()
+    virtual ICompositor* GetCompositor()
     {
-      return compositor_;
+      return &compositor_;
     }
   };