summaryrefslogtreecommitdiff
path: root/mogltk/engine.cpp
blob: ff40514fbbbaf4ac2510f26ad182cad83dd3f270 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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;
}