root / proj / libs / graph / include / sprite.h @ 332
History | View | Annotate | Download (1.24 KB)
1 |
#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 |
#include "basic_sprite.h" |
15 |
|
16 |
struct sprite;
|
17 |
typedef struct sprite sprite_t; |
18 |
|
19 |
sprite_t* (sprite_ctor)(const basic_sprite_t *bsp);
|
20 |
/*
|
21 |
* /!\ WARNING: Entity destructor does not destruct the basic_sprite passed as
|
22 |
* constructor arguments, since it is assumed the same basic_sprite may be used to
|
23 |
* draw several sprites. It is thus YOUR responsibility to delete basic_sprite's.
|
24 |
* @param p Pointer to sprite_t to be destructed
|
25 |
*/
|
26 |
void (sprite_dtor)(sprite_t *p);
|
27 |
|
28 |
void (sprite_set_pos) (sprite_t *p, int16_t x, int16_t y);
|
29 |
void (sprite_set_center)(sprite_t *p, int16_t u0, int16_t v0);
|
30 |
void (sprite_set_angle) (sprite_t *p, double angle); |
31 |
void (sprite_set_scale) (sprite_t *p, double scale); |
32 |
|
33 |
int16_t (sprite_get_x)(const sprite_t *p);
|
34 |
int16_t (sprite_get_y)(const sprite_t *p);
|
35 |
double (sprite_get_angle)(const sprite_t *p); |
36 |
uint16_t (sprite_get_w)(const sprite_t *p);
|
37 |
uint16_t (sprite_get_h)(const sprite_t *p);
|
38 |
|
39 |
void (sprite_draw)(const sprite_t *p); |
40 |
|
41 |
/**
|
42 |
* @}
|
43 |
*/
|
44 |
|
45 |
#endif //SPRITE_H_INCLUDED |