]> git.localhorst.tv Git - sdl-test8.git/blobdiff - src/sdl/InitSDL.cpp
added collision engine, more or less stole gameplay from sdl-test7
[sdl-test8.git] / src / sdl / InitSDL.cpp
diff --git a/src/sdl/InitSDL.cpp b/src/sdl/InitSDL.cpp
new file mode 100644 (file)
index 0000000..0f2eacd
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * InitSDL.cpp
+ *
+ *  Created on: Apr 22, 2012
+ *      Author: holy
+ */
+
+#include "InitSDL.h"
+
+#include <stdexcept>
+
+using std::runtime_error;
+
+
+namespace sdl {
+
+InitSDL::InitSDL(Uint32 flags) {
+       if (SDL_Init(flags) != 0) {
+               throw runtime_error("failed to initialize SDL");
+       }
+}
+
+InitSDL::~InitSDL(void) {
+       SDL_Quit();
+}
+
+}