source: trunk/monsterz/monsterz.cpp @ 838

Last change on this file since 838 was 838, checked in by sam, 9 years ago

ps3: add a simple PS3 input system that currently merely emulates mouse
movements with the right stick and one mouse button with the L1 or R1 buttons.

  • Property svn:keywords set to Id
File size: 1.4 KB
Line 
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
23using namespace std;
24using namespace lol;
25
26#if defined __CELLOS_LV2__
27#   include "ps3app.h"
28#   include "ps3input.h"
29#elif defined HAVE_GLES_2X
30#   include "eglapp.h"
31#else
32#   include "sdlapp.h"
33#   include "sdlinput.h"
34#endif
35#include "interface.h"
36
37#if defined _WIN32
38#   undef main /* FIXME: still needed? */
39#endif
40
41int main(int argc, char **argv)
42{
43#if defined __CELLOS_LV2__
44    Ps3App app("Monsterz", vec2i(640, 480), 60.0f);
45#elif defined HAVE_GLES_2X
46    EglApp app("Monsterz", vec2i(640, 480), 60.0f);
47#else
48    SdlApp app("Monsterz", vec2i(640, 480), 60.0f);
49#endif
50
51#if defined _WIN32
52    _chdir(".."); /* Temporary Win32 hack */
53#endif
54
55    /* Register an input driver and some debug stuff */
56#if defined __CELLOS_LV2__
57    new Ps3Input();
58#elif !defined HAVE_GLES_2X
59    new SdlInput();
60#endif
61    new Interface();
62    new DebugFps(20, 20);
63    //new DebugRecord("monsterz.ogm", FPS);
64
65    app.Run();
66
67    return EXIT_SUCCESS;
68}
69
Note: See TracBrowser for help on using the repository browser.