summaryrefslogtreecommitdiff
path: root/mogltk/engine.cpp
diff options
context:
space:
mode:
authorPixel <Pixel>2002-11-04 15:19:18 +0000
committerPixel <Pixel>2002-11-04 15:19:18 +0000
commitec510c6361cf39fe3d1cad02c77de887b9d70e7a (patch)
treecb4d50380b0dfb5ef693b691156d26742d0c7de9 /mogltk/engine.cpp
parent419a05e177eb34815d6f8fad64654376805f1552 (diff)
Working on mogltk
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;
+}