comparison Applications/Sdl/SdlWindow.cpp @ 214:1c5a47dda299

SdlOrthancSurface
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 01 Jun 2018 18:33:34 +0200
parents 5412adf19980
children b70e9be013e4
comparison
equal deleted inserted replaced
213:f753a7e15a73 214:1c5a47dda299
23 23
24 #if ORTHANC_ENABLE_SDL == 1 24 #if ORTHANC_ENABLE_SDL == 1
25 25
26 #include <Core/Logging.h> 26 #include <Core/Logging.h>
27 #include <Core/OrthancException.h> 27 #include <Core/OrthancException.h>
28
29 #include <SDL.h>
28 30
29 namespace OrthancStone 31 namespace OrthancStone
30 { 32 {
31 SdlWindow::SdlWindow(const char* title, 33 SdlWindow::SdlWindow(const char* title,
32 unsigned int width, 34 unsigned int width,
143 { 145 {
144 SDL_MaximizeWindow(window_); 146 SDL_MaximizeWindow(window_);
145 maximized_ = true; 147 maximized_ = true;
146 } 148 }
147 } 149 }
150
151
152 void SdlWindow::GlobalInitialize()
153 {
154 if (SDL_Init(SDL_INIT_VIDEO) != 0)
155 {
156 LOG(ERROR) << "Cannot initialize SDL";
157 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
158 }
159 }
160
161
162 void SdlWindow::GlobalFinalize()
163 {
164 SDL_Quit();
165 }
148 } 166 }
149 167
150 #endif 168 #endif