summaryrefslogtreecommitdiff
path: root/mogltk/engine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mogltk/engine.cpp')
-rw-r--r--mogltk/engine.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/mogltk/engine.cpp b/mogltk/engine.cpp
new file mode 100644
index 0000000..ff40514
--- /dev/null
+++ b/mogltk/engine.cpp
@@ -0,0 +1,24 @@
+#include <SDL.h>
+#include "engine.h"
+#include "generic.h"
+
+int mogltk::engine::inited = 0;
+
+int mogltk::engine::setup() throw(GeneralException) {
+ if (inited) {
+ printm(M_WARNING, "mogltk::engine::startup() called twice, ignoring second call.\n");
+ return -1;
+ }
+ if (SDL_Init(0) < 0) {
+ throw GeneralException("Unable to start SDL base system");
+ }
+ atexit(SDL_Quit);
+
+ inited = 1;
+
+ return 0;
+}
+
+int mogltk::engine::GetInited() {
+ return inited;
+}