diff Applications/Samples/SampleApplicationBase.h @ 221:d7b2590744f8 am

wip: building applications reusable in SDL and WASM
author am@osimis.io
date Mon, 11 Jun 2018 14:01:02 +0200
parents 4cff7b1ed31d
children ce4405d98b92
line wrap: on
line diff
--- a/Applications/Samples/SampleApplicationBase.h	Fri Jun 08 14:41:45 2018 +0200
+++ b/Applications/Samples/SampleApplicationBase.h	Mon Jun 11 14:01:02 2018 +0200
@@ -21,27 +21,38 @@
 
 #pragma once
 
-#include "../IBasicApplication.h"
+#include "../../Applications/Sdl/BasicSdlApplication.h"
+#include "SampleApplicationContext.h"
 
 namespace OrthancStone
 {
   namespace Samples
   {
-    class SampleApplicationBase : public IBasicApplication
+
+#ifdef ORTHANC_ENABLE_SDL
+    class SampleSdlApplicationBase : BasicSdlApplication {
+    private:
+      std::unique_ptr<SampleApplicationContext> context_;
+
+      BasicApplicationContext& CreateApplicationContext(Orthanc::WebServiceParameters& orthanc) {
+        context_.reset(new SampleApplicationContext(orthanc));
+      }
+    };
+
+    typedef SampleApplicationBase_ SampleSdlApplicationBase;
+#else
+
+#endif
+
+    class SampleApplicationBase : public SampleApplicationBase_
     {
     public:
       virtual std::string GetTitle() const
       {
         return "Stone of Orthanc - Sample";
       }
-
-      virtual void DeclareCommandLineOptions(boost::program_options::options_description& options)
-      {
-      }
+    };
 
-      virtual void Finalize()
-      {
-      }
-    };
+
   }
 }