1 | // |
---|
2 | // Monsterz |
---|
3 | // |
---|
4 | // Copyright: (c) 2005-2011 Sam Hocevar <sam@hocevar.net> |
---|
5 | // This program is free software; you can redistribute it and/or |
---|
6 | // modify it under the terms of the Do What The Fuck You Want To |
---|
7 | // Public License, Version 2, as published by Sam Hocevar. See |
---|
8 | // http://sam.zoy.org/projects/COPYING.WTFPL for more details. |
---|
9 | // |
---|
10 | |
---|
11 | #if defined HAVE_CONFIG_H |
---|
12 | # include "config.h" |
---|
13 | #endif |
---|
14 | |
---|
15 | #if defined _WIN32 |
---|
16 | # include <direct.h> |
---|
17 | #endif |
---|
18 | |
---|
19 | #include "core.h" |
---|
20 | #include "lolgl.h" |
---|
21 | #include "loldebug.h" |
---|
22 | |
---|
23 | using namespace std; |
---|
24 | using namespace lol; |
---|
25 | |
---|
26 | #if defined __CELLOS_LV2__ |
---|
27 | # include "platform/ps3/ps3app.h" |
---|
28 | # include "platform/ps3/ps3input.h" |
---|
29 | #elif defined HAVE_GLES_2X |
---|
30 | # include "eglapp.h" |
---|
31 | #else |
---|
32 | # include "platform/sdl/sdlapp.h" |
---|
33 | # include "platform/sdl/sdlinput.h" |
---|
34 | #endif |
---|
35 | #include "interface.h" |
---|
36 | |
---|
37 | #if USE_SDL |
---|
38 | # include <SDL_main.h> |
---|
39 | #endif |
---|
40 | |
---|
41 | #if defined _WIN32 |
---|
42 | # undef main /* FIXME: still needed? */ |
---|
43 | #endif |
---|
44 | |
---|
45 | int main(int argc, char **argv) |
---|
46 | { |
---|
47 | #if defined __CELLOS_LV2__ |
---|
48 | Ps3App app("Monsterz", ivec2(640, 480), 60.0f); |
---|
49 | #elif defined HAVE_GLES_2X |
---|
50 | EglApp app("Monsterz", ivec2(640, 480), 60.0f); |
---|
51 | #else |
---|
52 | SdlApp app("Monsterz", ivec2(640, 480), 60.0f); |
---|
53 | #endif |
---|
54 | |
---|
55 | #if defined _WIN32 |
---|
56 | _chdir(".."); /* Temporary Win32 hack */ |
---|
57 | #endif |
---|
58 | |
---|
59 | /* Register an input driver and some debug stuff */ |
---|
60 | #if defined __CELLOS_LV2__ |
---|
61 | new Ps3Input(); |
---|
62 | #elif !defined HAVE_GLES_2X |
---|
63 | new SdlInput(); |
---|
64 | #endif |
---|
65 | new Interface(); |
---|
66 | new DebugFps(20, 20); |
---|
67 | //new DebugRecord("monsterz.ogm", FPS); |
---|
68 | |
---|
69 | app.Run(); |
---|
70 | |
---|
71 | return EXIT_SUCCESS; |
---|
72 | } |
---|
73 | |
---|