comparison src/libmlk-core/core/drawable-stack.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
children 460c78706989
comparison
equal deleted inserted replaced
367:74f9cb70fc5d 368:15bdac29ba4b
1 /*
2 * drawable-stack.h -- convenient stack of drawables
3 *
4 * Copyright (c) 2020-2021 David Demelier <markand@malikania.fr>
5 *
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18
19 #ifndef MLK_CORE_DRAWABLE_STACK_H
20 #define MLK_CORE_DRAWABLE_STACK_H
21
22 #include "core.h"
23
24 #define DRAWABLE_STACK_MAX (128)
25
26 struct drawable_stack {
27 struct drawable *objects[DRAWABLE_STACK_MAX];
28 };
29
30 CORE_BEGIN_DECLS
31
32 void
33 drawable_stack_init(struct drawable_stack *);
34
35 int
36 drawable_stack_add(struct drawable_stack *, struct drawable *);
37
38 int
39 drawable_stack_update(struct drawable_stack *, unsigned int);
40
41 void
42 drawable_stack_draw(struct drawable_stack *);
43
44 int
45 drawable_stack_completed(const struct drawable_stack *);
46
47 void
48 drawable_stack_finish(struct drawable_stack *);
49
50 CORE_END_DECLS
51
52 #endif /* !MLK_CORE_DRAWABLE_STACK_H */