From b6bb9169c170546f8e87d565dad305f24a81902a Mon Sep 17 00:00:00 2001 From: marvin Date: Thu, 10 Mar 2022 16:10:02 -0600 Subject: [PATCH] Fixed "custom frame_control" example for PLATFORM_WEB (#2379) After a lot of head-scratching I realized that PollInputEvents must always be called as late as possible! When SUPPORT_CUSTOM_FRAME_CONTROL is disabled, EndDrawing already calls PollInputEvents last. It seems that the following pull request was on to something: https://github.com/raysan5/raylib/pull/1573 --- examples/core/core_custom_frame_control.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/core/core_custom_frame_control.c b/examples/core/core_custom_frame_control.c index 93181e763..11f62c4ab 100644 --- a/examples/core/core_custom_frame_control.c +++ b/examples/core/core_custom_frame_control.c @@ -54,8 +54,6 @@ int main(void) { // Update //---------------------------------------------------------------------------------- - PollInputEvents(); // Poll input events (SUPPORT_CUSTOM_FRAME_CONTROL) - if (IsKeyPressed(KEY_SPACE)) pause = !pause; if (IsKeyPressed(KEY_UP)) targetFPS += 20; @@ -113,6 +111,8 @@ int main(void) else deltaTime = updateDrawTime; // Framerate could be variable previousTime = currentTime; + + PollInputEvents(); // Poll input events (SUPPORT_CUSTOM_FRAME_CONTROL) //---------------------------------------------------------------------------------- }