aboutsummaryrefslogtreecommitdiff
path: root/include/mgl/graphics/sprite.h
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-10-16 07:04:34 +0200
committerdec05eba <dec05eba@protonmail.com>2021-10-16 07:04:34 +0200
commit97f1b1c735775d1e22412bbcf98ef403f9ee2275 (patch)
tree80c2d729a20996d673e7081c4213b09be1076a74 /include/mgl/graphics/sprite.h
parent08dcbfa7772149bcdcc0ab660a897853a30103a0 (diff)
Add rectangle and sprite, use pixel coordinates, remote opengl dependency from test
Diffstat (limited to 'include/mgl/graphics/sprite.h')
-rw-r--r--include/mgl/graphics/sprite.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/mgl/graphics/sprite.h b/include/mgl/graphics/sprite.h
new file mode 100644
index 0000000..045da19
--- /dev/null
+++ b/include/mgl/graphics/sprite.h
@@ -0,0 +1,21 @@
+#ifndef MGL_SPRITE_H
+#define MGL_SPRITE_H
+
+#include "color.h"
+#include "vec.h"
+
+typedef struct mgl_context mgl_context;
+typedef struct mgl_texture mgl_texture;
+
+typedef struct {
+ mgl_texture *texture;
+ mgl_color color;
+ mgl_vec2f position;
+ mgl_vec2f scale;
+} mgl_sprite;
+
+void mgl_sprite_init(mgl_sprite *self, mgl_texture *texture, float x, float y);
+void mgl_sprite_draw(mgl_context *context, mgl_sprite *sprite);
+void mgl_sprite_set_color(mgl_sprite *self, float r, float g, float b, float a);
+
+#endif /* MGL_SPRITE_H */