diff options
author | pixel <pixel> | 2002-12-07 00:42:14 +0000 |
---|---|---|
committer | pixel <pixel> | 2002-12-07 00:42:14 +0000 |
commit | 11f44e36d5f02f8309fc463f9a2c6cd81b42c3ce (patch) | |
tree | e0daba1124a46dd6dc30150066324f62c6c9eedc /lib/engine.cc | |
parent | 70ab3da408f5939fbfec4237e87f503ae82b2179 (diff) |
Whoups
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; +} |