Skip to content

Conversation

@AlexandreK38
Copy link
Contributor

In Webgl , there are several timings to run the main loop. Current one implemented in Axmol is the requestAnimationFrame one (RAF) but if the app loses focus the loop is paused.
If we want the app to run with or without focus, for example in a multiplayer game, we must use the timeout timing.

This PR adds the AX_WASM_TIMING_USE_TIMEOUT option to use the timeout with the FPS set by Application::setAnimationInterval.

@halx99 halx99 added this to the 2.6.2 milestone Jun 27, 2025
@halx99 halx99 added the enhancement New feature or request label Jun 27, 2025
@halx99 halx99 merged commit 8d64b2f into axmolengine:dev Jun 27, 2025
15 checks passed
#else
emscripten_set_main_loop(updateFrame, -1, false);
#endif

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!,,

@AlexandreK38 AlexandreK38 deleted the wasm-main-loop branch July 3, 2025 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants