summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2021-09-21 15:11:33 +0200
committerraysan5 <[email protected]>2021-09-21 15:11:33 +0200
commitc96de3a23a616030c787daf8df3593ae0f8a7aaf (patch)
treef93da5ab18dd6a183d792c365365595b1e84f3de
parent1627f3403257d81615bbc20a48d8aecd31b49ef1 (diff)
downloadraylib-c96de3a23a616030c787daf8df3593ae0f8a7aaf.tar.gz
raylib-c96de3a23a616030c787daf8df3593ae0f8a7aaf.zip
ADDED: `GetTouchPointId(index)` #1972
-rw-r--r--src/core.c10
-rw-r--r--src/raylib.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/core.c b/src/core.c
index 60924124..6428a029 100644
--- a/src/core.c
+++ b/src/core.c
@@ -3575,6 +3575,16 @@ Vector2 GetTouchPosition(int index)
return position;
}
+// Get touch point identifier for given index
+int GetTouchPointId(int index)
+{
+ int id = -1;
+
+ if (index < MAX_TOUCH_POINTS) id = CORE.Input.Touch.pointId[index];
+
+ return id;
+}
+
// Get number of touch points
int GetTouchPointCount(void)
{
diff --git a/src/raylib.h b/src/raylib.h
index 865d9d45..bb698a45 100644
--- a/src/raylib.h
+++ b/src/raylib.h
@@ -1105,8 +1105,10 @@ RLAPI void SetMouseCursor(int cursor); // Set mouse curso
RLAPI int GetTouchX(void); // Get touch position X for touch point 0 (relative to screen size)
RLAPI int GetTouchY(void); // Get touch position Y for touch point 0 (relative to screen size)
RLAPI Vector2 GetTouchPosition(int index); // Get touch position XY for a touch point index (relative to screen size)
+RLAPI int GetTouchPointId(int index); // Get touch point identifier for given index
RLAPI int GetTouchPointCount(void); // Get number of touch points
+
//------------------------------------------------------------------------------------
// Gestures and Touch Handling Functions (Module: gestures)
//------------------------------------------------------------------------------------