aboutsummaryrefslogtreecommitdiff
path: root/include/mgl/graphics/sprite.h
blob: 8c84153ebbe4faa626c9eaa2815e70c3e18ac66c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef MGL_SPRITE_H
#define MGL_SPRITE_H

#include "../system/vec.h"
#include "color.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;

/* |texture| may be NULL */
void mgl_sprite_init(mgl_sprite *self, mgl_texture *texture, float x, float y);

/* |texture| may be NULL */
void mgl_sprite_set_texture(mgl_sprite *self, mgl_texture *texture);
void mgl_sprite_set_position(mgl_sprite *self, mgl_vec2f position);
void mgl_sprite_set_color(mgl_sprite *self, mgl_color color);
void mgl_sprite_draw(mgl_context *context, mgl_sprite *sprite);

#endif /* MGL_SPRITE_H */