summaryrefslogtreecommitdiffhomepage
path: root/examples/web/core/core_gestures_detection.c
diff options
context:
space:
mode:
authorRay San <[email protected]>2017-11-03 20:01:48 +0100
committerRay San <[email protected]>2017-11-03 20:01:48 +0100
commitd918334a2e1ce32961c0797a4b13fdd5b4ce5630 (patch)
tree1f16feb32953200c2a47cf425352f1bba70ab99a /examples/web/core/core_gestures_detection.c
parente4041e4eb8c55db0a37c8af575c7a98c17963a9a (diff)
downloadraylib.com-d918334a2e1ce32961c0797a4b13fdd5b4ce5630.tar.gz
raylib.com-d918334a2e1ce32961c0797a4b13fdd5b4ce5630.zip
Updated to support Android platform
Diffstat (limited to 'examples/web/core/core_gestures_detection.c')
-rw-r--r--examples/web/core/core_gestures_detection.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/examples/web/core/core_gestures_detection.c b/examples/web/core/core_gestures_detection.c
index 76037a4..b74f8c3 100644
--- a/examples/web/core/core_gestures_detection.c
+++ b/examples/web/core/core_gestures_detection.c
@@ -16,6 +16,10 @@
#include <emscripten/emscripten.h>
#endif
+#if defined(PLATFORM_ANDROID)
+ #include "android_native_app_glue.h"
+#endif
+
#define MAX_GESTURE_STRINGS 20
//----------------------------------------------------------------------------------
@@ -41,11 +45,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 - Gestures Detection");
+#endif
touchPosition = (Vector2){ 0, 0 };
touchArea = (Rectangle){ 220, 10, screenWidth - 230, screenHeight - 20 };
@@ -69,8 +81,9 @@ int main()
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
-
+#if !defined(PLATFORM_ANDROID)
return 0;
+#endif
}
//----------------------------------------------------------------------------------