diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-05-06 18:04:12 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-05-06 18:04:12 -0700 |
commit | ccf2e419785aa2fdc25396c707987ba9d7fc80a2 (patch) | |
tree | 72cafef4ba0301a57762b9a675d3b8b915c0a675 /system/include | |
parent | 1d32c296019da719f323d340882c12900e85a3c2 (diff) |
emscripten_pause_main_loop and resume
Diffstat (limited to 'system/include')
-rw-r--r-- | system/include/emscripten.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/system/include/emscripten.h b/system/include/emscripten.h index 4725e68a..fdccfe82 100644 --- a/system/include/emscripten.h +++ b/system/include/emscripten.h @@ -24,8 +24,18 @@ extern void emscripten_async_run_script(const char *script, int millis); * will call that function at a specified number of frames per * second. Setting 0 or a negative value as the fps will use * the browser's requestAnimationFrame mechanism. + * + * Pausing and resuming the main loop is useful if your app + * needs to perform some synchronous operation, for example + * to load a file from the network. It might be wrong to + * run the main loop before that finishes (the original + * code assumes that), so you can break the code up into + * asynchronous callbacks, but you must pause the main + * loop until they complete. */ extern void emscripten_set_main_loop(void (*func)(), int fps); +extern void emscripten_pause_main_loop(); +extern void emscripten_resume_main_loop(); extern void emscripten_cancel_main_loop(); /* |