Run Web main loop at vsync to avoid browser throttling

This could be customized in future (depending on VSync usage).
This commit is contained in:
Wojtek Figat
2026-02-20 23:51:05 +01:00
parent 366a5162b7
commit 9fc31b1021

View File

@@ -32,6 +32,7 @@ public:
// Setup main loop to be called by Emscripten
emscripten_set_main_loop(Loop, -1, false);
emscripten_set_main_loop_timing(EM_TIMING_RAF, 1); // Run main loop on each animation frame (vsync)
// Run the first loop
Loop();