aboutsummaryrefslogtreecommitdiff
path: root/include/mgl/graphics
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-10-10 17:29:31 +0200
committerdec05eba <dec05eba@protonmail.com>2021-10-10 17:29:31 +0200
commit4aa7273eea642bff78477b0b220c7056628b13a8 (patch)
tree014430c208905164f99b37d663944192b8d6fd8c /include/mgl/graphics
parentb81aff95e7924c38dbd1cf639011be1848af6967 (diff)
Add texture loading (and render in test)
Diffstat (limited to 'include/mgl/graphics')
-rw-r--r--include/mgl/graphics/texture.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/mgl/graphics/texture.h b/include/mgl/graphics/texture.h
new file mode 100644
index 0000000..669be1e
--- /dev/null
+++ b/include/mgl/graphics/texture.h
@@ -0,0 +1,21 @@
+#ifndef MGL_TEXTURE_H
+#define MGL_TEXTURE_H
+
+typedef enum {
+ MGL_TEXTURE_GRAY = 1,
+ MGL_TEXTURE_GRAY_ALPHA = 2,
+ MGL_TEXTURE_RGB = 3,
+ MGL_TEXTURE_RGB_ALPHA = 4
+} mgl_texture_format;
+
+typedef struct {
+ unsigned int id;
+ int width;
+ int height;
+ mgl_texture_format format;
+} mgl_texture;
+
+int mgl_texture_load_from_file(mgl_texture *self, const char *filepath);
+void mgl_texture_unload(mgl_texture *self);
+
+#endif /* MGL_TEXTURE_H */