diff Applications/Platforms/Sdl/SdlViewport.h @ 1804:5a872e69c74f

reorganization
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 20 May 2021 14:48:51 +0200
parents 9ac2a65d4172
children 3889ae96d2e9
line wrap: on
line diff
--- a/Applications/Platforms/Sdl/SdlViewport.h	Thu May 20 14:15:00 2021 +0200
+++ b/Applications/Platforms/Sdl/SdlViewport.h	Thu May 20 14:48:51 2021 +0200
@@ -32,15 +32,14 @@
 #  error The macro ORTHANC_ENABLE_OPENGL must be defined
 #endif
 
-#if ORTHANC_ENABLE_OPENGL != 1
-#  error Support for OpenGL is disabled
-#endif
-
 #include "SdlOpenGLContext.h"
-#include "../../../OrthancStone/Sources/Scene2D/OpenGLCompositor.h"
 #include "../../../OrthancStone/Sources/Scene2D/CairoCompositor.h"
 #include "../../../OrthancStone/Sources/Viewport/IViewport.h"
 
+#if ORTHANC_ENABLE_OPENGL == 1
+#  include "../../../OrthancStone/Sources/Scene2D/OpenGLCompositor.h"
+#endif
+
 #include <SDL_events.h>
 
 // TODO: required for UndoStack injection
@@ -139,6 +138,7 @@
   };
 
 
+#if ORTHANC_ENABLE_OPENGL == 1
   class SdlOpenGLViewport : public SdlViewport
   {
   private:
@@ -153,7 +153,7 @@
     virtual void RefreshCanvasSize() ORTHANC_OVERRIDE;
     
   public:
-    static boost::shared_ptr<SdlOpenGLViewport> Create(const std::string&,
+    static boost::shared_ptr<SdlOpenGLViewport> Create(const std::string& title,
                                                        unsigned int width,
                                                        unsigned int height,
                                                        bool allowDpiScaling = true);
@@ -167,6 +167,7 @@
 
     virtual void ToggleMaximize() ORTHANC_OVERRIDE;
   };
+#endif
 
 
   class SdlCairoViewport : public SdlViewport
@@ -177,20 +178,19 @@
 
     void CreateSdlSurfaceFromCompositor(const CairoCompositor& compositor);
 
-    SdlCairoViewport(const char* title,
+    SdlCairoViewport(const std::string& title,
                      unsigned int width,
                      unsigned int height,
-                     bool allowDpiScaling = true);
+                     bool allowDpiScaling);
 
   protected:
     virtual void RefreshCanvasSize() ORTHANC_OVERRIDE;
     
   public:
-    static boost::shared_ptr<SdlCairoViewport> Create(const char* title,
-                     unsigned int width,
-                     unsigned int height,
-                     bool allowDpiScaling = true);
-
+    static boost::shared_ptr<SdlCairoViewport> Create(const std::string& title,
+                                                      unsigned int width,
+                                                      unsigned int height,
+                                                      bool allowDpiScaling = true);
 
     virtual ~SdlCairoViewport();