mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-16 09:48:26 +00:00
emscripten: support pseudo-synchronous screen refresh and events update using asyncify
This commit is contained in:
parent
3b71ebecd6
commit
01af7b0254
3 changed files with 28 additions and 1 deletions
|
@ -162,6 +162,12 @@ int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rec
|
|||
SDL_GetWindowID(window), ++frame_number);
|
||||
SDL_SaveBMP(surface, file);
|
||||
}*/
|
||||
|
||||
if (emscripten_has_asyncify()) {
|
||||
/* give back control to browser for screen refresh */
|
||||
emscripten_sleep(0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue