diff Framework/Viewport/IViewport.h @ 905:88bf49aebc13

introduced ICompositor and allow SdlViewport to work with a CairoCompositor (to run on machines without OpenGL drivers)
author Alain Mazy <alain@mazy.be>
date Wed, 17 Jul 2019 16:56:53 +0200
parents 0aff28f15ea2
children 685c9a2d115f
line wrap: on
line diff
--- a/Framework/Viewport/IViewport.h	Wed Jul 17 15:33:34 2019 +0200
+++ b/Framework/Viewport/IViewport.h	Wed Jul 17 16:56:53 2019 +0200
@@ -20,6 +20,7 @@
 
 #pragma once
 
+#include "../Scene2D/ICompositor.h"
 #include "../Scene2D/Scene2D.h"
 #include "../Scene2D/ScenePoint2D.h"
 
@@ -48,5 +49,13 @@
     virtual const std::string& GetCanvasIdentifier() const = 0;
 
     virtual ScenePoint2D GetPixelCenterCoordinates(int x, int y) const = 0;
+
+    virtual ICompositor& GetCompositor() = 0;
+
+    virtual const ICompositor& GetCompositor() const
+    {
+      IViewport* self = const_cast<IViewport*>(this);
+      return self->GetCompositor();
+    }
   };
 }