aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2015-11-30 22:50:01 +0000
committerHarry Jeffery <harry@exec64.co.uk>2015-11-30 22:50:01 +0000
commit8bc695b88955b47d8cf36fdc143edb092ae0ca4d (patch)
treee697faa66cb0275664160ca606ecbe296bc809d4 /src
parent2457991e3e882fa091439797000ba6f269410ede (diff)
downloadimv-8bc695b88955b47d8cf36fdc143edb092ae0ca4d.tar.gz
Document imv_loader's methods
Diffstat (limited to 'src')
-rw-r--r--src/loader.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/loader.h b/src/loader.h
index 7be7aa2..5f5a85e 100644
--- a/src/loader.h
+++ b/src/loader.h
@@ -40,15 +40,30 @@ struct imv_loader {
double frame_time;
};
+/* Initialises an instance of imv_loader */
void imv_init_loader(struct imv_loader *img);
+
+/* Cleans up all resources owned by a imv_loader instance */
void imv_destroy_loader(struct imv_loader *img);
+/* Asynchronously load the given file */
void imv_loader_load_path(struct imv_loader *ldr, const char *path);
+/* Returns image data if available. NULL if not. Caller is responsible for
+ * cleaning up the data returned. Each image is only returned once. */
FIBITMAP *imv_loader_get_image(struct imv_loader *ldr);
+
+/* If a file failed to loadd, return the path to that file. Otherwise returns
+ * NULL. Only returns the path once. Caller is responsible for cleaning up the
+ * string returned. */
char *imv_loader_get_error(struct imv_loader *ldr);
+/* Trigger the next frame of the currently loaded image to be loaded and
+ * returned as soon as possible. */
void imv_loader_load_next_frame(struct imv_loader *ldr);
+
+/* Tell the loader that dt time has passed. If the current image is animated,
+ * the loader will automatically load the next frame when it is due. */
void imv_loader_time_passed(struct imv_loader *ldr, double dt);
#endif