From 1fc6762e3176843ffc378c8b4f43dd73fed25ebe Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 13 Sep 2013 15:13:30 -0700 Subject: emscripten_async_load_script --- system/include/emscripten/emscripten.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'system/include') 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,8 +45,26 @@ 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 -- cgit v1.2.3-18-g5258