]> git.localhorst.tv Git - space.git/blobdiff - src/app/SDL.cpp
move to SDL2
[space.git] / src / app / SDL.cpp
diff --git a/src/app/SDL.cpp b/src/app/SDL.cpp
new file mode 100644 (file)
index 0000000..e5b48ca
--- /dev/null
@@ -0,0 +1,19 @@
+#include "SDL.h"
+
+#include <stdexcept>
+#include <string>
+
+
+namespace space {
+
+SDL::SDL(Uint32 flags) {
+       if (SDL_Init(flags) != 0) {
+               throw std::runtime_error(std::string("init SDL: ") + SDL_GetError());
+       }
+}
+
+SDL::~SDL() {
+       SDL_Quit();
+}
+
+}