source: trunk/src/application/application.cpp @ 1173

Last change on this file since 1173 was 1173, checked in by sam, 8 years ago

xbox: start working on an Xbox/Direct3D port.

  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1//
2// Lol Engine
3//
4// Copyright: (c) 2010-2012 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#include "core.h"
16#include "lolgl.h"
17
18#if defined __CELLOS_LV2__
19#   include "platform/ps3/ps3app.h"
20#elif defined _XBOX
21#   include "platform/xbox/xboxapp.h"
22#elif defined __native_client__
23#   include "platform/nacl/naclapp.h"
24#elif defined HAVE_GLES_2X
25#   include "eglapp.h"
26#else
27#   include "platform/sdl/sdlapp.h"
28#   include "platform/sdl/sdlinput.h"
29#endif
30
31using namespace std;
32
33namespace lol
34{
35
36class ApplicationData
37{
38    friend class Application;
39
40    ApplicationData(char const *name, ivec2 resolution, float framerate)
41        : app(name, resolution, framerate)
42    { }
43
44#if defined __CELLOS_LV2__
45    Ps3App app;
46#elif defined _XBOX
47    XboxApp app;
48#elif defined __native_client__
49    NaClApp app;
50#elif defined HAVE_GLES_2X
51    /* FIXME: this macro is only deactivated if we include "lolgl.h" */
52    EglApp app;
53#elif defined HAVE_SDL_H
54    SdlApp app;
55#else
56#   error No application class available on this platform
57#endif
58};
59
60/*
61 * Public Application class
62 */
63
64Application::Application(char const *name, ivec2 resolution, float framerate)
65{
66    data = new ApplicationData(name, resolution, framerate);
67}
68
69void Application::ShowPointer(bool show)
70{
71    data->app.ShowPointer(show);
72}
73
74void Application::Run()
75{
76    data->app.Run();
77}
78
79Application::~Application()
80{
81    delete data;
82}
83
84} /* namespace lol */
85
Note: See TracBrowser for help on using the repository browser.