diff Applications/Sdl/BasicSdlApplicationContext.cpp @ 242:092db46c6291 am

improved SDL/Wasm unification
author am@osimis.io
date Wed, 20 Jun 2018 14:20:55 +0200
parents 68856534f005
children 46c5296d867e
line wrap: on
line diff
--- a/Applications/Sdl/BasicSdlApplicationContext.cpp	Wed Jun 20 09:50:25 2018 +0200
+++ b/Applications/Sdl/BasicSdlApplicationContext.cpp	Wed Jun 20 14:20:55 2018 +0200
@@ -44,11 +44,13 @@
   }
   
 
-  BasicSdlApplicationContext::BasicSdlApplicationContext(Orthanc::WebServiceParameters& orthanc, WidgetViewport* centralViewport) :
-    oracle_(viewportMutex_, 4),  // Use 4 threads to download
-    //oracle_(viewportMutex_, 1),  // Disable threading to be reproducible
-    webService_(oracle_, orthanc),
-    centralViewport_(centralViewport),
+  BasicSdlApplicationContext::BasicSdlApplicationContext(OracleWebService& webService) : // Orthanc::WebServiceParameters& orthanc, WidgetViewport* centralViewport) :
+    BasicApplicationContext(webService),
+    oracleWebService_(&webService),
+//    oracle_(viewportMutex_, 4),  // Use 4 threads to download
+//    webService_(oracle_, orthanc),
+//    centralViewport_(centralViewport),
+    centralViewport_(new OrthancStone::WidgetViewport()),
     stopped_(true),
     updateDelay_(100)   // By default, 100ms between each refresh of the content
   {
@@ -58,7 +60,7 @@
 
   void BasicSdlApplicationContext::Start()
   {
-    oracle_.Start();
+    oracleWebService_->Start();
 
     if (centralViewport_->HasUpdateContent())
     {
@@ -77,6 +79,6 @@
       updateThread_.join();
     }
     
-    oracle_.Stop();
+    oracleWebService_->Stop();
   }
 }