diff options
author | Pixel <Pixel> | 2002-11-04 15:19:18 +0000 |
---|---|---|
committer | Pixel <Pixel> | 2002-11-04 15:19:18 +0000 |
commit | ec510c6361cf39fe3d1cad02c77de887b9d70e7a (patch) | |
tree | cb4d50380b0dfb5ef693b691156d26742d0c7de9 /mogltk/engine.cpp | |
parent | 419a05e177eb34815d6f8fad64654376805f1552 (diff) |
Working on mogltk
Diffstat (limited to 'mogltk/engine.cpp')
-rw-r--r-- | mogltk/engine.cpp | 24 |
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; +} |