root / proj / libs / graph / include / sprite.h @ 331
History | View | Annotate | Download (1.21 KB)
1 | 331 | up20180642 | #ifndef SPRITE_H_INCLUDED
|
---|---|---|---|
2 | #define SPRITE_H_INCLUDED
|
||
3 | |||
4 | /**
|
||
5 | * @defgroup sprite_t sprite_t
|
||
6 | * @ingroup graph
|
||
7 | * @brief Sprite module.
|
||
8 | *
|
||
9 | * A sprite allows to draw a basic_sprite_t, while also providing some transformations for that basic_sprite_t.
|
||
10 | *
|
||
11 | * @{
|
||
12 | */
|
||
13 | |||
14 | struct sprite;
|
||
15 | typedef struct sprite sprite_t; |
||
16 | |||
17 | sprite_t* (sprite_ctor)(const basic_sprite_t *bsp);
|
||
18 | /*
|
||
19 | * /!\ WARNING: Entity destructor does not destruct the basic_sprite passed as
|
||
20 | * constructor arguments, since it is assumed the same basic_sprite may be used to
|
||
21 | * draw several sprites. It is thus YOUR responsibility to delete basic_sprite's.
|
||
22 | * @param p Pointer to sprite_t to be destructed
|
||
23 | */
|
||
24 | void (sprite_dtor)(sprite_t *p);
|
||
25 | |||
26 | void (sprite_set_pos) (sprite_t *p, int16_t x, int16_t y);
|
||
27 | void (sprite_set_center)(sprite_t *p, int16_t u0, int16_t v0);
|
||
28 | void (sprite_set_angle) (sprite_t *p, double angle); |
||
29 | void (sprite_set_scale) (sprite_t *p, double scale); |
||
30 | |||
31 | int16_t (sprite_get_x)(const sprite_t *p);
|
||
32 | int16_t (sprite_get_y)(const sprite_t *p);
|
||
33 | double (sprite_get_angle)(const sprite_t *p); |
||
34 | uint16_t (sprite_get_w)(const sprite_t *p);
|
||
35 | uint16_t (sprite_get_h)(const sprite_t *p);
|
||
36 | |||
37 | void (sprite_draw)(const sprite_t *p); |
||
38 | |||
39 | /**
|
||
40 | * @}
|
||
41 | */
|
||
42 | |||
43 | #endif //SPRITE_H_INCLUDED |