diff options
| author | raysan5 <raysan5@gmail.com> | 2016-01-28 10:03:37 +0100 |
|---|---|---|
| committer | raysan5 <raysan5@gmail.com> | 2016-01-28 10:03:37 +0100 |
| commit | ac475f46b9609235a9db4f3057271f609c39db7b (patch) | |
| tree | e8b48281f8db55bec94ef99fd8e3062b4f8946cc /src/core.c | |
| parent | c21ca3ca1a3c68459cf75fc27bc73430228e3f0b (diff) | |
| download | raylib-ac475f46b9609235a9db4f3057271f609c39db7b.tar.gz raylib-ac475f46b9609235a9db4f3057271f609c39db7b.zip | |
Added touch points id to gestures
Required by ProcessGestureEvent()
Diffstat (limited to 'src/core.c')
| -rw-r--r-- | src/core.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -1916,6 +1916,10 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event) // Register touch points count gestureEvent.pointCount = AMotionEvent_getPointerCount(event); + // Register touch points id DESKTOP + gestureEvent.pointerId[0] = AMotionEvent_getPointerId(event, 0); + gestureEvent.pointerId[1] = AMotionEvent_getPointerId(event, 1); + // Register touch points position // NOTE: Only two points registered gestureEvent.position[0] = (Vector2){ AMotionEvent_getX(event, 0), AMotionEvent_getY(event, 0) }; @@ -2474,6 +2478,10 @@ static EM_BOOL EmscriptenInputCallback(int eventType, const EmscriptenTouchEvent // Register touch points count gestureEvent.pointCount = touchEvent->numTouches; + // Register touch points id WEB + gestureEvent.pointerId[0] = touchEvent->touches[0].identifier; + gestureEvent.pointerId[1] = touchEvent->touches[1].identifier; + // Register touch points position // NOTE: Only two points registered // TODO: Touch data should be scaled accordingly! |
