diff options
Diffstat (limited to 'lib/engine.cc')
-rw-r--r-- | lib/engine.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/engine.cc b/lib/engine.cc new file mode 100644 index 0000000..919fcb4 --- /dev/null +++ b/lib/engine.cc @@ -0,0 +1,23 @@ +#include <SDL/SDL.h> +#include "engine.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; +} |