summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorHumberto Yeverino Jr <[email protected]>2021-07-13 03:17:47 -0700
committerGitHub <[email protected]>2021-07-13 12:17:47 +0200
commit8277597bcf5dbfa1149d9a0dcefac671fc55d703 (patch)
tree623d6f3f5a6e451c8a5fc52d4dc9c73b0bab69c4 /src
parent8a46b5e6c0319a442d1c2f0184843c5b1f7aebef (diff)
downloadraylib-8277597bcf5dbfa1149d9a0dcefac671fc55d703.tar.gz
raylib-8277597bcf5dbfa1149d9a0dcefac671fc55d703.zip
Fix Android multi-touch (#1869)
Diffstat (limited to 'src')
-rw-r--r--src/core.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core.c b/src/core.c
index 1051355d..be41f57b 100644
--- a/src/core.c
+++ b/src/core.c
@@ -5249,6 +5249,13 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event)
CORE.Input.Touch.position[0].x = AMotionEvent_getX(event, 0);
CORE.Input.Touch.position[0].y = AMotionEvent_getY(event, 0);
+ unsigned int touchCount = AMotionEvent_getPointerCount(event);
+ for (int i = 1; i < touchCount && i < MAX_TOUCH_POINTS; i++)
+ {
+ CORE.Input.Touch.position[i].x = AMotionEvent_getX(event, i);
+ CORE.Input.Touch.position[i].y = AMotionEvent_getY(event, i);
+ }
+
int32_t action = AMotionEvent_getAction(event);
unsigned int flags = action & AMOTION_EVENT_ACTION_MASK;