diff libmlk-core/mlk/core/image.h @ 641:fcd124e513ea

core: reintroduce VFS
author David Demelier <markand@malikania.fr>
date Sun, 01 Oct 2023 09:18:01 +0200
parents d307f93d79af
children
line wrap: on
line diff
--- a/libmlk-core/mlk/core/image.h	Wed Sep 27 22:03:17 2023 +0200
+++ b/libmlk-core/mlk/core/image.h	Sun Oct 01 09:18:01 2023 +0200
@@ -27,6 +27,7 @@
 #include <stddef.h>
 
 struct mlk_texture;
+struct mlk_vfs_file;
 
 #if defined(__cplusplus)
 extern "C" {
@@ -60,6 +61,20 @@
 int
 mlk_image_openmem(struct mlk_texture *texture, const void *data, size_t datasz);
 
+/**
+ * Open an image from a virtual file system.
+ *
+ * The VFS file can be discarded after loading the image.
+ *
+ * \pre texture != NULL
+ * \pre file != NULL
+ * \param texture the texture to initialize
+ * \param file the VFS file
+ * \return 0 on success or -1 on error
+ */
+int
+mlk_image_openvfs(struct mlk_texture *texture, struct mlk_vfs_file *file);
+
 #if defined(__cplusplus)
 }
 #endif