diff options
| author | raysan5 <[email protected]> | 2021-10-22 11:53:47 +0200 |
|---|---|---|
| committer | raysan5 <[email protected]> | 2021-10-22 11:53:47 +0200 |
| commit | dd6e006d78b92f03c73d4b6157cd8d66e2a74d52 (patch) | |
| tree | 7d6a52730d4c8f54f35d9533f6bfce2e3c9fc549 /src | |
| parent | cbeb29d9d114c5b61ea274d30a6454e65a3fad3a (diff) | |
| download | raylib-dd6e006d78b92f03c73d4b6157cd8d66e2a74d52.tar.gz raylib-dd6e006d78b92f03c73d4b6157cd8d66e2a74d52.zip | |
Reviewed multitouch example #1988
Diffstat (limited to 'src')
| -rw-r--r-- | src/rcore.c | 7 |
1 files changed, 6 insertions, 1 deletions
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 |
