소스 검색

removed hardcoded sleep (#4713)

pull/4718/head
Anthony Carbajal 8 달 전
committed by GitHub
부모
커밋
77c509db6e
No known key found for this signature in database GPG 키 ID: B5690EEEBB952194
1개의 변경된 파일5개의 추가작업 그리고 4개의 파일을 삭제
  1. +5
    -4
      src/platforms/rcore_web.c

+ 5
- 4
src/platforms/rcore_web.c 파일 보기

@ -154,14 +154,15 @@ static const char *GetCanvasId(void);
//----------------------------------------------------------------------------------
// 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)
{
// Emterpreter-Async required to run sync 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
// frame code in a UpdateDrawFrame() function, to allow browser manage execution asynchronously
// but now emscripten allows sync code to be executed in an interpreted way, using emterpreter!
emscripten_sleep(16);
// This function should not called on a web-ready raylib build because you instead want to encapsulate
// frame code in an UpdateDrawFrame() function, to allow the browser to manage execution asynchronously
// using emscripten_set_main_loop
return false;
}

불러오는 중...
취소
저장