Mercurial > molko
comparison src/libmlk-core/core/drawable.h @ 368:15bdac29ba4b
core: split drawable and drawable_stack
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sun, 24 Oct 2021 17:07:20 +0200 |
parents | 19782ea1cf4a |
children | 460c78706989 |
comparison
equal
deleted
inserted
replaced
367:74f9cb70fc5d | 368:15bdac29ba4b |
---|---|
19 #ifndef MLK_CORE_DRAWABLE_H | 19 #ifndef MLK_CORE_DRAWABLE_H |
20 #define MLK_CORE_DRAWABLE_H | 20 #define MLK_CORE_DRAWABLE_H |
21 | 21 |
22 #include "core.h" | 22 #include "core.h" |
23 | 23 |
24 #define DRAWABLE_STACK_MAX (128) | |
25 | |
26 struct drawable { | 24 struct drawable { |
27 void *data; | 25 void *data; |
28 int x; | 26 int x; |
29 int y; | 27 int y; |
30 int (*update)(struct drawable *, unsigned int); | 28 int (*update)(struct drawable *, unsigned int); |
31 void (*draw)(struct drawable *); | 29 void (*draw)(struct drawable *); |
32 void (*end)(struct drawable *); | 30 void (*end)(struct drawable *); |
33 void (*finish)(struct drawable *); | 31 void (*finish)(struct drawable *); |
34 }; | |
35 | |
36 struct drawable_stack { | |
37 struct drawable *objects[DRAWABLE_STACK_MAX]; | |
38 }; | 32 }; |
39 | 33 |
40 CORE_BEGIN_DECLS | 34 CORE_BEGIN_DECLS |
41 | 35 |
42 int | 36 int |
49 drawable_end(struct drawable *); | 43 drawable_end(struct drawable *); |
50 | 44 |
51 void | 45 void |
52 drawable_finish(struct drawable *); | 46 drawable_finish(struct drawable *); |
53 | 47 |
54 void | |
55 drawable_stack_init(struct drawable_stack *); | |
56 | |
57 int | |
58 drawable_stack_add(struct drawable_stack *, struct drawable *); | |
59 | |
60 int | |
61 drawable_stack_update(struct drawable_stack *, unsigned int); | |
62 | |
63 void | |
64 drawable_stack_draw(struct drawable_stack *); | |
65 | |
66 int | |
67 drawable_stack_completed(const struct drawable_stack *); | |
68 | |
69 void | |
70 drawable_stack_finish(struct drawable_stack *); | |
71 | |
72 CORE_END_DECLS | 48 CORE_END_DECLS |
73 | 49 |
74 #endif /* !MLK_CORE_DRAWABLE_H */ | 50 #endif /* !MLK_CORE_DRAWABLE_H */ |