summaryrefslogtreecommitdiff
path: root/src/stage.h
blob: 59329d72a3a64420131632f847c70887f6d3b383 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
 *  Copyright (C) 2018-2019 - Vito Caputo - <vcaputo@pengaru.com>
 *
 *  This program is free software: you can redistribute it and/or modify it
 *  under the terms of the GNU General Public License version 3 as published
 *  by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _STAGE_H
#define _STAGE_H

#define STAGE_NAME_MAX		16
#define STAGE_LAYERS_MAX	10

typedef struct stage_t stage_t;

typedef void (stage_render_func_t)(const stage_t *stage, void *object, float alpha);
typedef void (stage_free_func_t)(const stage_t *stage, void *object);

stage_t * stage_new(stage_t *parent, int layer, const char *name, void *object, stage_render_func_t *render_func, stage_free_func_t *free_func);
void stage_replace(stage_t *stage, const char *name, void *object, stage_render_func_t *render_func, stage_free_func_t *free_func);
stage_t * stage_free(stage_t *stage);
void stage_render(const stage_t *stage);
void stage_clear(stage_t *stage);
void stage_set_object(stage_t *stage, void *object);
void * stage_get_object(const stage_t *stage);
void stage_set_alpha(stage_t *stage, float alpha);
float stage_get_alpha(const stage_t *stage);
void stage_set_active(stage_t *stage, int active);
int stage_get_active(const stage_t *stage);
void stage_set_locked(stage_t *stage, int locked);
int stage_get_locked(const stage_t *stage);
void stage_set_layer(stage_t *stage, int layer);
stage_t * stage_lookup_name(stage_t *stage, const char *name);

#endif
© All Rights Reserved