mirror of
https://github.com/raysan5/raylib.git
synced 2025-10-10 20:06:29 +00:00
removed hardcoded sleep (#4713)
This commit is contained in:
@@ -154,14 +154,15 @@ static const char *GetCanvasId(void);
|
|||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Check if application should close
|
// Check if application should close
|
||||||
|
// This will always return false on a web-build as web builds have no control over this functionality
|
||||||
|
// Sleep is handled in EndDrawing for sync code
|
||||||
bool WindowShouldClose(void)
|
bool WindowShouldClose(void)
|
||||||
{
|
{
|
||||||
// Emterpreter-Async required to run sync code
|
// Emterpreter-Async required to run sync code
|
||||||
// https://github.com/emscripten-core/emscripten/wiki/Emterpreter#emterpreter-async-run-synchronous-code
|
// https://github.com/emscripten-core/emscripten/wiki/Emterpreter#emterpreter-async-run-synchronous-code
|
||||||
// By default, this function is never called on a web-ready raylib example because we encapsulate
|
// This function should not called on a web-ready raylib build because you instead want to encapsulate
|
||||||
// frame code in a UpdateDrawFrame() function, to allow browser manage execution asynchronously
|
// frame code in an UpdateDrawFrame() function, to allow the browser to manage execution asynchronously
|
||||||
// but now emscripten allows sync code to be executed in an interpreted way, using emterpreter!
|
// using emscripten_set_main_loop
|
||||||
emscripten_sleep(16);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user