aboutsummaryrefslogtreecommitdiff
path: root/raylib/rcore.c
diff options
context:
space:
mode:
authorUneven Prankster <unevenprankster@protonmail.com>2023-07-18 13:27:44 -0300
committerUneven Prankster <unevenprankster@protonmail.com>2023-07-18 13:27:44 -0300
commit049779039009991b39d62df7823baa21c53bfbf4 (patch)
tree685141a1c512133ca41724517ea9e5e4d5a71310 /raylib/rcore.c
parent88d82c6eaee88398af1de57cddca692a1f74b087 (diff)
Latest raylib changes.
Diffstat (limited to 'raylib/rcore.c')
-rw-r--r--raylib/rcore.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/raylib/rcore.c b/raylib/rcore.c
index 6ef25c0..45495bb 100644
--- a/raylib/rcore.c
+++ b/raylib/rcore.c
@@ -124,12 +124,12 @@
#include "raymath.h" // Vector3, Quaternion and Matrix functionality
#if defined(SUPPORT_GESTURES_SYSTEM)
- #define GESTURES_IMPLEMENTATION
+ #define RGESTURES_IMPLEMENTATION
#include "rgestures.h" // Gestures detection functionality
#endif
#if defined(SUPPORT_CAMERA_SYSTEM)
- #define CAMERA_IMPLEMENTATION
+ #define RCAMERA_IMPLEMENTATION
#include "rcamera.h" // Camera system functionality
#endif
@@ -5593,8 +5593,14 @@ static void MouseButtonCallback(GLFWwindow *window, int button, int action, int
gestureEvent.position[0].y /= (float)GetScreenHeight();
// Gesture data is sent to gestures-system for processing
+#if defined(PLATFORM_WEB)
+ // Prevent calling ProcessGestureEvent() when Emscripten is present and there's a touch gesture, so EmscriptenTouchCallback() can handle it itself
+ if (GetMouseX() != 0 || GetMouseY() != 0) ProcessGestureEvent(gestureEvent);
+#else
ProcessGestureEvent(gestureEvent);
#endif
+
+#endif
}
// GLFW3 Cursor Position Callback, runs on mouse move
@@ -6139,6 +6145,9 @@ static EM_BOOL EmscriptenTouchCallback(int eventType, const EmscriptenTouchEvent
// Gesture data is sent to gestures system for processing
ProcessGestureEvent(gestureEvent);
+
+ // Reset the pointCount for web, if it was the last Touch End event
+ if (eventType == EMSCRIPTEN_EVENT_TOUCHEND && CORE.Input.Touch.pointCount == 1) CORE.Input.Touch.pointCount = 0;
#endif
return 1; // The event was consumed by the callback handler