|
@@ -8,26 +8,30 @@ |
|
|
// http://www.wtfpl.net/ for more details. |
|
|
// http://www.wtfpl.net/ for more details. |
|
|
// |
|
|
// |
|
|
|
|
|
|
|
|
#if defined HAVE_CONFIG_H |
|
|
|
|
|
|
|
|
#if HAVE_CONFIG_H |
|
|
# include "config.h" |
|
|
# include "config.h" |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#if HAVE_EMSCRIPTEN_H |
|
|
|
|
|
# include <emscripten.h> |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
#include "core.h" |
|
|
#include "core.h" |
|
|
|
|
|
|
|
|
#include "lolgl.h" |
|
|
#include "lolgl.h" |
|
|
|
|
|
|
|
|
#if defined __CELLOS_LV2__ |
|
|
|
|
|
|
|
|
#if __CELLOS_LV2__ |
|
|
# include "platform/ps3/ps3app.h" |
|
|
# include "platform/ps3/ps3app.h" |
|
|
#elif defined _XBOX |
|
|
|
|
|
|
|
|
#elif _XBOX |
|
|
# include "platform/xbox/xboxapp.h" |
|
|
# include "platform/xbox/xboxapp.h" |
|
|
#elif defined __native_client__ |
|
|
|
|
|
|
|
|
#elif __native_client__ |
|
|
# include "platform/nacl/nacl-app.h" |
|
|
# include "platform/nacl/nacl-app.h" |
|
|
#elif defined __ANDROID__ |
|
|
|
|
|
|
|
|
#elif __ANDROID__ |
|
|
# include "platform/android/androidapp.h" |
|
|
# include "platform/android/androidapp.h" |
|
|
#elif defined USE_SDL |
|
|
|
|
|
|
|
|
#elif USE_SDL |
|
|
# include "platform/sdl/sdlapp.h" |
|
|
# include "platform/sdl/sdlapp.h" |
|
|
# include "platform/sdl/sdlinput.h" |
|
|
# include "platform/sdl/sdlinput.h" |
|
|
#elif defined HAVE_GLES_2X |
|
|
|
|
|
|
|
|
#elif HAVE_GLES_2X |
|
|
# include "eglapp.h" |
|
|
# include "eglapp.h" |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
@@ -44,17 +48,17 @@ class ApplicationData |
|
|
: app(name, resolution, framerate) |
|
|
: app(name, resolution, framerate) |
|
|
{ } |
|
|
{ } |
|
|
|
|
|
|
|
|
#if defined __CELLOS_LV2__ |
|
|
|
|
|
|
|
|
#if __CELLOS_LV2__ |
|
|
Ps3App app; |
|
|
Ps3App app; |
|
|
#elif defined _XBOX |
|
|
|
|
|
|
|
|
#elif _XBOX |
|
|
XboxApp app; |
|
|
XboxApp app; |
|
|
#elif defined __native_client__ |
|
|
|
|
|
|
|
|
#elif __native_client__ |
|
|
NaClApp app; |
|
|
NaClApp app; |
|
|
#elif defined __ANDROID__ |
|
|
|
|
|
|
|
|
#elif __ANDROID__ |
|
|
AndroidApp app; |
|
|
AndroidApp app; |
|
|
#elif defined USE_SDL |
|
|
|
|
|
|
|
|
#elif USE_SDL |
|
|
SdlApp app; |
|
|
SdlApp app; |
|
|
#elif defined HAVE_GLES_2X |
|
|
|
|
|
|
|
|
#elif HAVE_GLES_2X |
|
|
/* FIXME: this macro is only deactivated if we include "lolgl.h" */ |
|
|
/* FIXME: this macro is only deactivated if we include "lolgl.h" */ |
|
|
EglApp app; |
|
|
EglApp app; |
|
|
#else |
|
|
#else |
|
@@ -62,6 +66,15 @@ class ApplicationData |
|
|
#endif |
|
|
#endif |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
#if EMSCRIPTEN |
|
|
|
|
|
static Application *g_app; |
|
|
|
|
|
|
|
|
|
|
|
static void AppCallback() |
|
|
|
|
|
{ |
|
|
|
|
|
g_app->Tick(); |
|
|
|
|
|
} |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
/* |
|
|
/* |
|
|
* Public Application class |
|
|
* Public Application class |
|
|
*/ |
|
|
*/ |
|
@@ -83,6 +96,16 @@ void Application::Tick() |
|
|
data->app.Tick(); |
|
|
data->app.Tick(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Application::Run() |
|
|
|
|
|
{ |
|
|
|
|
|
#if EMSCRIPTEN |
|
|
|
|
|
emscripten_set_main_loop(AppCallback, 0, 1); |
|
|
|
|
|
#else |
|
|
|
|
|
while (MustTick()) |
|
|
|
|
|
Tick(); |
|
|
|
|
|
#endif |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void Application::ShowPointer(bool show) |
|
|
void Application::ShowPointer(bool show) |
|
|
{ |
|
|
{ |
|
|
data->app.ShowPointer(show); |
|
|
data->app.ShowPointer(show); |
|
|