summaryrefslogtreecommitdiff
path: root/lib/engine.cc
blob: 6e3f30337e257dd95cc8a4c460fab17ae0145df9 (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
25
#include <SDL/SDL.h>
#include "engine.h"

#define _(x) x

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;
}