diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-09-13 15:13:30 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-09-13 15:13:30 -0700 |
commit | 1fc6762e3176843ffc378c8b4f43dd73fed25ebe (patch) | |
tree | 67b1b4dfb930b3e6ee234e98c778e217aceb27f6 /system/include | |
parent | ee51b2bd829447fb83c5ebdbc3f8d157355c0fdc (diff) |
emscripten_async_load_script
Diffstat (limited to 'system/include')
-rw-r--r-- | system/include/emscripten/emscripten.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/system/include/emscripten/emscripten.h b/system/include/emscripten/emscripten.h index 1b9a8f25..430fbc1c 100644 --- a/system/include/emscripten/emscripten.h +++ b/system/include/emscripten/emscripten.h @@ -45,9 +45,27 @@ extern "C" { extern void emscripten_run_script(const char *script); extern int emscripten_run_script_int(const char *script); extern char *emscripten_run_script_string(const char *script); // uses a single buffer - shared between calls! + +/* + * Asynchronously run a script, after a specified amount of + * time. + */ extern void emscripten_async_run_script(const char *script, int millis); /* + * Asynchronously loads a script from a URL. + * + * This integrates with the run dependencies system, so your + * script can call addRunDependency multiple times, prepare + * various asynchronous tasks, and call removeRunDependency + * on them; when all are complete (or there were no run + * dependencies to begin with), onload is called. An example use + * for this is to load an asset module, that is, the output of the + * file packager. + */ +extern void emscripten_async_load_script(const char *script, void (*onload)(), void (*onerror)()); + +/* * Set a C function as the main event loop. The JS environment * will call that function at a specified number of frames per * second. Setting 0 or a negative value as the fps will use |