Skip to content

Commit

Permalink
Update web.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaweees committed Dec 25, 2024
1 parent a2cc37c commit ad39b78
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/web/web.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ int main(int argc, char** argv) {
g_display->loadMesh("assets/bunny.obj");

#ifdef __EMSCRIPTEN__
// Set up the main loop for Emscripten
emscripten_set_main_loop(mainLoop, 0, 1);
// Set up the main loop for Emscripten with proper timing
emscripten_set_main_loop(mainLoop, 0, true);
// Note: The second parameter (0) means use browser's requestAnimationFrame
// The third parameter (true) means simulate infinite loop
#else
// Traditional loop for native builds
while (!g_display->shouldClose()) { mainLoop(); }
Expand Down

0 comments on commit ad39b78

Please sign in to comment.