diff Framework/Viewport/WebAssemblyViewport.h @ 942:685c9a2d115f

Added missing ORTHANC_OVERRIDE + preparation for lost GL context handling + stubs for GL context event handlers
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 05 Aug 2019 12:27:27 +0200
parents a6c12fe88bcb
children 1091b2adeb5a
line wrap: on
line diff
--- a/Framework/Viewport/WebAssemblyViewport.h	Wed Jul 31 11:29:08 2019 +0200
+++ b/Framework/Viewport/WebAssemblyViewport.h	Mon Aug 05 12:27:27 2019 +0200
@@ -47,7 +47,7 @@
   {
   private:
     OpenGL::WebAssemblyOpenGLContext  context_;
-    OpenGLCompositor                  compositor_;
+    std::auto_ptr<OpenGLCompositor>   compositor_;
 
   public:
     WebAssemblyOpenGLViewport(const std::string& canvas);
@@ -60,8 +60,14 @@
 
     virtual ICompositor& GetCompositor()
     {
-      return compositor_;
+      return *compositor_;
     }
+
+    bool OpenGLContextLost();
+    bool OpenGLContextRestored();
+
+  private:
+    void RegisterContextCallbacks();
   };
 
   class WebAssemblyCairoViewport : public WebAssemblyViewport