diff 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
line wrap: on
line diff
--- a/Applications/Sdl/SdlWindow.cpp	Fri Jun 01 18:09:09 2018 +0200
+++ b/Applications/Sdl/SdlWindow.cpp	Fri Jun 01 18:33:34 2018 +0200
@@ -26,6 +26,8 @@
 #include <Core/Logging.h>
 #include <Core/OrthancException.h>
 
+#include <SDL.h>
+
 namespace OrthancStone
 {
   SdlWindow::SdlWindow(const char* title,
@@ -145,6 +147,22 @@
       maximized_ = true;
     }
   }
+
+
+  void SdlWindow::GlobalInitialize()
+  {
+    if (SDL_Init(SDL_INIT_VIDEO) != 0)
+    {
+      LOG(ERROR) << "Cannot initialize SDL";
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
+    }
+  }
+
+
+  void SdlWindow::GlobalFinalize()
+  {
+    SDL_Quit();
+  }
 }
 
 #endif