Skip to content

Commit 77c509d

Browse files
authored
removed hardcoded sleep (#4713)
1 parent 773e3f5 commit 77c509d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/platforms/rcore_web.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,15 @@ static const char *GetCanvasId(void);
154154
//----------------------------------------------------------------------------------
155155

156156
// Check if application should close
157+
// This will always return false on a web-build as web builds have no control over this functionality
158+
// Sleep is handled in EndDrawing for sync code
157159
bool WindowShouldClose(void)
158160
{
159161
// Emterpreter-Async required to run sync code
160162
// https://github.com/emscripten-core/emscripten/wiki/Emterpreter#emterpreter-async-run-synchronous-code
161-
// By default, this function is never called on a web-ready raylib example because we encapsulate
162-
// frame code in a UpdateDrawFrame() function, to allow browser manage execution asynchronously
163-
// but now emscripten allows sync code to be executed in an interpreted way, using emterpreter!
164-
emscripten_sleep(16);
163+
// This function should not called on a web-ready raylib build because you instead want to encapsulate
164+
// frame code in an UpdateDrawFrame() function, to allow the browser to manage execution asynchronously
165+
// using emscripten_set_main_loop
165166
return false;
166167
}
167168

0 commit comments

Comments
 (0)