aboutsummaryrefslogtreecommitdiff
path: root/include/mgui/image.h
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-12-04 01:37:07 +0100
committerdec05eba <dec05eba@protonmail.com>2021-12-04 01:37:07 +0100
commitd3a5b3d579e30ce02afd5e270dfdd511af195c31 (patch)
tree7d5aaa9d8289e7f8af2d62f796336f207375b610 /include/mgui/image.h
parent9644f3c05b808a3cac3892aae36ffca2cce9357d (diff)
Add image
Diffstat (limited to 'include/mgui/image.h')
-rw-r--r--include/mgui/image.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/mgui/image.h b/include/mgui/image.h
new file mode 100644
index 0000000..c1072d4
--- /dev/null
+++ b/include/mgui/image.h
@@ -0,0 +1,22 @@
+#ifndef MGUI_IMAGE_H
+#define MGUI_IMAGE_H
+
+#include "widget.h"
+#include <mgl/graphics/sprite.h>
+
+typedef struct {
+ mgui_widget widget;
+ mgl_sprite sprite;
+} mgui_image;
+
+mgui_image* mgui_image_create(const char *filepath);
+mgui_widget* mgui_image_to_widget(mgui_image *list);
+mgui_image* mgui_widget_to_image(mgui_widget *widget);
+
+void mgui_image_set_position(mgui_image *self, mgl_vec2i position);
+void mgui_image_set_width(mgui_image *self, int width);
+void mgui_image_on_event(mgui_image *self, mgl_window *window, mgl_event *event);
+/* Returns the size of the widget */
+mgl_vec2i mgui_image_draw(mgui_image *self, mgl_window *window);
+
+#endif /* MGUI_IMAGE_H */