aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/include/emscripten/emscripten.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/system/include/emscripten/emscripten.h b/system/include/emscripten/emscripten.h
index 078f87d2..94f1c860 100644
--- a/system/include/emscripten/emscripten.h
+++ b/system/include/emscripten/emscripten.h
@@ -197,6 +197,22 @@ void emscripten_async_wget(const char* url, const char* file, void (*onload)(con
int emscripten_async_prepare(const char* file, void (*onload)(const char*), void (*onerror)(const char*));
/*
+ * Data version of emscripten_async_prepare, which receives
+ * raw data as input instead of a filename (this can prevent
+ * the need to write data to a file first). onload and
+ * onerror are called back with the data pointer as the
+ * first parameter. onload also receives a second
+ * parameter, which is a 'fake' filename which you can
+ * then pass into IMG_Load (it is not an actual file,
+ * but it identifies this image for IMG_Load to be able
+ * to process it). Note that the user of this API is
+ * responsible for free()ing the memory allocated for
+ * the fake filename.
+ * @suffix The file suffix, e.g. 'png' or 'jpg'.
+ */
+void emscripten_async_prepare_data(char* data, int size, const char *suffix, void (*onload)(char*, const char*), void (*onerror)(char*));
+
+/*
* Profiling tools.
* INIT must be called first, with the maximum identifier that
* will be used. BEGIN will add some code that marks