aboutsummaryrefslogtreecommitdiff
path: root/include/mgl/graphics/texture.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/mgl/graphics/texture.h')
-rw-r--r--include/mgl/graphics/texture.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/include/mgl/graphics/texture.h b/include/mgl/graphics/texture.h
index e6fc97b..3aec07d 100644
--- a/include/mgl/graphics/texture.h
+++ b/include/mgl/graphics/texture.h
@@ -1,16 +1,17 @@
#ifndef MGL_TEXTURE_H
#define MGL_TEXTURE_H
+#include "image.h"
#include <stdbool.h>
typedef struct mgl_texture mgl_texture;
typedef enum {
- MGL_TEXTURE_ALPHA,
- MGL_TEXTURE_GRAY,
- MGL_TEXTURE_GRAY_ALPHA,
- MGL_TEXTURE_RGB,
- MGL_TEXTURE_RGBA
+ MGL_TEXTURE_FORMAT_ALPHA,
+ MGL_TEXTURE_FORMAT_GRAY,
+ MGL_TEXTURE_FORMAT_GRAY_ALPHA,
+ MGL_TEXTURE_FORMAT_RGB,
+ MGL_TEXTURE_FORMAT_RGBA
} mgl_texture_format;
struct mgl_texture {
@@ -27,7 +28,9 @@ typedef struct {
/* |load_options| can be null, in which case the default options are used */
int mgl_texture_load_from_file(mgl_texture *self, const char *filepath, mgl_texture_load_options *load_options);
/* |load_options| can be null, in which case the default options are used */
-int mgl_texture_load_from_memory(mgl_texture *self, const unsigned char *data, int width, int height, mgl_texture_format format, mgl_texture_load_options *load_options);
+int mgl_texture_load_from_image(mgl_texture *self, mgl_image *image, mgl_texture_load_options *load_options);
+/* |load_options| can be null, in which case the default options are used */
+int mgl_texture_load_from_memory(mgl_texture *self, const unsigned char *data, int width, int height, mgl_image_format format, mgl_texture_load_options *load_options);
void mgl_texture_unload(mgl_texture *self);
#endif /* MGL_TEXTURE_H */