aboutsummaryrefslogtreecommitdiff
path: root/system/include
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-10-04 18:13:17 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-10-04 18:13:17 -0700
commit2be2720852b990937bfbe71a8f6b65b2f20cb33d (patch)
tree77dc7a0b7decbb31a2b246a3e0c252210061826b /system/include
parent2ac61df97125086a0ecb6f00fdd08cf8d93f02c2 (diff)
emscripten_async_prepare
Diffstat (limited to 'system/include')
-rw-r--r--system/include/emscripten/emscripten.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/system/include/emscripten/emscripten.h b/system/include/emscripten/emscripten.h
index 3e69044a..1b1310c4 100644
--- a/system/include/emscripten/emscripten.h
+++ b/system/include/emscripten/emscripten.h
@@ -157,14 +157,30 @@ float emscripten_random();
*/
/*
- * Load file from url in asynchronous way.
- * When file is loaded then 'onload' callback will called.
+ * Load file from url in asynchronous way. In addition to
+ * fetching the URL from the network, the contents are
+ * prepared so that the data is usable in IMG_Load and
+ * so forth (we asynchronously do the work to make the
+ * browser decode the image or audio and so forth).
+ * When file is ready then 'onload' callback will called.
* If any error occurred 'onerror' will called.
* The callbacks are called with the file as their argument.
- */
+ */
void emscripten_async_wget(const char* url, const char* file, void (*onload)(const char*), void (*onerror)(const char*));
/*
+ * Prepare a file in asynchronous way. This does just the
+ * preparation part of emscripten_async_wget, that is, it
+ * works on file data already present, and asynchronously
+ * prepares it for use in IMG_Load, Mix_LoadWAV, etc.
+ * When file is loaded then 'onload' callback will called.
+ * If any error occurred 'onerror' will called.
+ * The callbacks are called with the file as their argument.
+ * @return 0 if successful, -1 if the file does not exist
+ */
+int emscripten_async_prepare(const char* file, void (*onload)(const char*), void (*onerror)(const char*));
+
+/*
* Profiling tools.
* INIT must be called first, with the maximum identifier that
* will be used. BEGIN will add some code that marks