From dd6e006d78b92f03c73d4b6157cd8d66e2a74d52 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 22 Oct 2021 11:53:47 +0200 Subject: Reviewed multitouch example #1988 --- src/rcore.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/rcore.c b/src/rcore.c index 9ab34e15..3e357118 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -3876,7 +3876,7 @@ static bool InitGraphicsDevice(int width, int height) #if defined(PLATFORM_DESKTOP) // NOTE: GLFW 3.4+ defers initialization of the Joystick subsystem on the first call to any Joystick related functions. - // Forcing this initialization here avoids doing it on `PollInputEvents` called by `EndDrawing` after first frame has been just drawn. + // Forcing this initialization here avoids doing it on PollInputEvents() called by EndDrawing() after first frame has been just drawn. // The initialization will still happen and possible delays still occur, but before the window is shown, which is a nicer experience. // REF: https://github.com/raysan5/raylib/issues/1554 if (MAX_GAMEPADS > 0) glfwSetJoystickCallback(NULL); @@ -4765,6 +4765,11 @@ void PollInputEvents(void) // Register previous touch states for (int i = 0; i < MAX_TOUCH_POINTS; i++) CORE.Input.Touch.previousTouchState[i] = CORE.Input.Touch.currentTouchState[i]; + + // Reset touch positions + // TODO: It resets on PLATFORM_WEB the mouse position and not filled again until a move-event, + // so, if mouse is not moved it returns a (0, 0) position... this behaviour should be reviewed! + //for (int i = 0; i < MAX_TOUCH_POINTS; i++) CORE.Input.Touch.position[i] = (Vector2){ 0, 0 }; #if defined(PLATFORM_DESKTOP) // Check if gamepads are ready -- cgit v1.2.3