summaryrefslogtreecommitdiffhomepage
path: root/examples/web/core/core_input_gamepad.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/web/core/core_input_gamepad.c')
-rw-r--r--examples/web/core/core_input_gamepad.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/examples/web/core/core_input_gamepad.c b/examples/web/core/core_input_gamepad.c
index 9ba3d7e..d3349fc 100644
--- a/examples/web/core/core_input_gamepad.c
+++ b/examples/web/core/core_input_gamepad.c
@@ -21,6 +21,10 @@
#include <emscripten/emscripten.h>
#endif
+#if defined(PLATFORM_ANDROID)
+ #include "android_native_app_glue.h"
+#endif
+
// NOTE: Gamepad name ID depends on drivers and OS
#if defined(PLATFORM_RPI)
#define XBOX360_NAME_ID "Microsoft X-Box 360 pad"
@@ -47,11 +51,19 @@ void UpdateDrawFrame(void); // Update and Draw one frame
//----------------------------------------------------------------------------------
// Main Enry Point
//----------------------------------------------------------------------------------
-int main()
+#if defined(PLATFORM_ANDROID)
+void android_main(struct android_app *app)
+#else
+int main(void)
+#endif
{
// Initialization
//--------------------------------------------------------------------------------------
+#if defined(PLATFORM_ANDROID)
+ InitWindow(screenWidth, screenHeight, app);
+#else
InitWindow(screenWidth, screenHeight, "raylib [core] example - gamepad input");
+#endif
texPs3Pad = LoadTexture("resources/ps3.png");
texXboxPad = LoadTexture("resources/xbox.png");
@@ -76,8 +88,9 @@ int main()
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
-
+#if !defined(PLATFORM_ANDROID)
return 0;
+#endif
}
//----------------------------------------------------------------------------------