mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-15 02:33:12 +00:00
Update core_custom_frame_control.c to work properly on web
This commit is contained in:
parent
20a07a65d7
commit
9e908e4a76
@ -61,7 +61,9 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
#ifndef PLATFORM_WEB // NOTE: On non web platforms the PollInputEvents just works before the inputs checks
|
||||||
PollInputEvents(); // Poll input events (SUPPORT_CUSTOM_FRAME_CONTROL)
|
PollInputEvents(); // Poll input events (SUPPORT_CUSTOM_FRAME_CONTROL)
|
||||||
|
#endif
|
||||||
|
|
||||||
if (IsKeyPressed(KEY_SPACE)) pause = !pause;
|
if (IsKeyPressed(KEY_SPACE)) pause = !pause;
|
||||||
|
|
||||||
@ -76,6 +78,10 @@ int main(void)
|
|||||||
if (position >= GetScreenWidth()) position = 0;
|
if (position >= GetScreenWidth()) position = 0;
|
||||||
timeCounter += deltaTime; // We count time (seconds)
|
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
|
// Draw
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user