From 9e908e4a76958c6922ceab4e788ccca647e68853 Mon Sep 17 00:00:00 2001 From: PanicTitan <66186142+PanicTitan@users.noreply.github.com> Date: Mon, 14 Jul 2025 00:27:56 -0300 Subject: [PATCH] Update core_custom_frame_control.c to work properly on web --- examples/core/core_custom_frame_control.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/core/core_custom_frame_control.c b/examples/core/core_custom_frame_control.c index a9b98b039..2e9595e98 100644 --- a/examples/core/core_custom_frame_control.c +++ b/examples/core/core_custom_frame_control.c @@ -61,7 +61,9 @@ int main(void) { // Update //---------------------------------------------------------------------------------- - PollInputEvents(); // Poll input events (SUPPORT_CUSTOM_FRAME_CONTROL) + #ifndef PLATFORM_WEB // NOTE: On non web platforms the PollInputEvents just works before the inputs checks + PollInputEvents(); // Poll input events (SUPPORT_CUSTOM_FRAME_CONTROL) + #endif if (IsKeyPressed(KEY_SPACE)) pause = !pause; @@ -76,6 +78,10 @@ int main(void) if (position >= GetScreenWidth()) position = 0; timeCounter += deltaTime; // We count time (seconds) } + + #ifdef PLATFORM_WEB // NOTE: On web platform for some reason the PollInputEvents only works after the inputs check, so just call it after check all your inputs (on web) + PollInputEvents(); // Poll input events (SUPPORT_CUSTOM_FRAME_CONTROL) + #endif //---------------------------------------------------------------------------------- // Draw