comparison Applications/Sdl/SdlStoneApplicationRunner.cpp @ 1068:04a95ee91327 broker

recovery of OrthancStoneSingleFrame
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 15 Oct 2019 19:36:57 +0200
parents b537002f83a9
children 8d3936f06541
comparison
equal deleted inserted replaced
1067:05b2e71ed145 1068:04a95ee91327
32 #include <Core/HttpClient.h> 32 #include <Core/HttpClient.h>
33 #include <Core/Toolbox.h> 33 #include <Core/Toolbox.h>
34 #include <Core/OrthancException.h> 34 #include <Core/OrthancException.h>
35 #include <Plugins/Samples/Common/OrthancHttpConnection.h> 35 #include <Plugins/Samples/Common/OrthancHttpConnection.h>
36 36
37 #include <boost/make_shared.hpp>
37 #include <boost/program_options.hpp> 38 #include <boost/program_options.hpp>
38 39
39 namespace OrthancStone 40 namespace OrthancStone
40 { 41 {
41 void SdlStoneApplicationRunner::Initialize() 42 void SdlStoneApplicationRunner::Initialize()
101 **************************************************************/ 102 **************************************************************/
102 103
103 LOG(WARNING) << "Starting the application"; 104 LOG(WARNING) << "Starting the application";
104 105
105 SdlWindow window(title.c_str(), width_, height_, enableOpenGl_); 106 SdlWindow window(title.c_str(), width_, height_, enableOpenGl_);
106 SdlEngine sdl(window, context); 107 boost::shared_ptr<SdlEngine> sdl(boost::make_shared<SdlEngine>(window, context));
107 108
108 { 109 {
109 NativeStoneApplicationContext::GlobalMutexLocker locker(context); 110 NativeStoneApplicationContext::GlobalMutexLocker locker(context);
110 111
111 sdl.Register<Deprecated::IViewport::ViewportChangedMessage> 112 sdl->Register<Deprecated::IViewport::ViewportChangedMessage>
112 (locker.GetCentralViewport(), &SdlEngine::OnViewportChanged); 113 (locker.GetCentralViewport(), &SdlEngine::OnViewportChanged);
113 114
114 //context.GetCentralViewport().Register(sdl); // (*) 115 //context.GetCentralViewport().Register(sdl); // (*)
115 } 116 }
116 117
117 context.Start(); 118 context.Start();
118 sdl.Run(); 119 sdl->Run();
119 120
120 LOG(WARNING) << "Stopping the application"; 121 LOG(WARNING) << "Stopping the application";
121 122
122 // Don't move the "Stop()" command below out of the block, 123 // Don't move the "Stop()" command below out of the block,
123 // otherwise the application might crash, because the 124 // otherwise the application might crash, because the