소스 검색

Added touch points id to gestures

Required by ProcessGestureEvent()
pull/81/head
raysan5 9 년 전
부모
커밋
ac475f46b9
2개의 변경된 파일9개의 추가작업 그리고 1개의 파일을 삭제
  1. +1
    -1
      src/camera.c
  2. +8
    -0
      src/core.c

+ 1
- 1
src/camera.c 파일 보기

@ -2,7 +2,7 @@
*
* raylib Camera System - Camera Modes Setup and Control Functions
*
* Copyright (c) 2015 Marc Palau and Ramon Santamaria
* Copyright (c) 2015 Marc Palau and Ramon Santamaria (@raysan5)
*
* This software is provided "as-is", without any express or implied warranty. In no event
* will the authors be held liable for any damages arising from the use of this software.

+ 8
- 0
src/core.c 파일 보기

@ -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!

불러오는 중...
취소
저장