From f45e0cf5a804c57ff2396987fd1df85ac631e962 Mon Sep 17 00:00:00 2001 From: chemguerra Date: Sun, 11 Jun 2023 15:51:00 +0200 Subject: [PATCH] GetTouchPointState() --- src/Makefile | 3 ++- src/raylib.h | 1 + src/rcore.c | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 808ca8b7b..21b343d15 100644 --- a/src/Makefile +++ b/src/Makefile @@ -345,7 +345,8 @@ endif ifeq ($(RAYLIB_BUILD_MODE),RELEASE) ifeq ($(PLATFORM),PLATFORM_WEB) - CFLAGS += -Os + #CFLAGS += -Os + CFLAGS += -O3 endif ifeq ($(PLATFORM),PLATFORM_DESKTOP) CFLAGS += -O1 diff --git a/src/raylib.h b/src/raylib.h index f6a48bc73..ad920ed48 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1149,6 +1149,7 @@ RLAPI int GetTouchX(void); // Get touch posit 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 bool GetTouchPointState(int index); // Patch for touch events in web browsers RLAPI int GetTouchPointCount(void); // Get number of touch points //------------------------------------------------------------------------------------ diff --git a/src/rcore.c b/src/rcore.c index ee682e8b0..5cbdade44 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -4022,6 +4022,11 @@ int GetTouchPointId(int index) return id; } +bool GetTouchPointState(int index) +{ + return ( (index < MAX_TOUCH_POINTS) && (CORE.Input.Touch.currentTouchState[index] != 0) ); +} + // Get number of touch points int GetTouchPointCount(void) {