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
This commit is contained in:
marvin 2022-03-10 16:10:02 -06:00
parent cda1324e87
commit b6bb9169c1

View File

@ -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)
//----------------------------------------------------------------------------------
}