aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/mimesh/libg3d-0.0.8/include/g3d/context.h
blob: 26b2134e659e575d9cfd8bd4bbe85e8f851e293a (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/* $Id$ */

/*
    libg3d - 3D object loading library

    Copyright (C) 2005-2009  Markus Dahms <mad@automagically.de>

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library 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
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

#ifndef __G3D_CONTEXT_H__
#define __G3D_CONTEXT_H__

#include <g3d/types.h>

#ifdef __cplusplus
extern "C" {
#endif /* ifdef __cplusplus */


/**
 * SECTION:context
 * @short_description: Libg3d initialization and configuration
 * @see_also: #G3DContext
 * @include: g3d/g3d.h
 *
 * All state information is saved in the context. It also serves as an
 * interface to the application.
 */


/**
 * g3d_context_new:
 *
 * Create a new context. This initializes the library (and also the
 * plugin system so this has not to be done seperately).
 *
 * Returns: a valid context, or NULL on failure.
 */
EAPI
G3DContext *g3d_context_new(void);

/**
 * g3d_context_free:
 * @context: the context to free
 *
 * Cleans up the context and the plugin system and frees all reserved
 * memory.
 */
EAPI
void g3d_context_free(G3DContext *context);

/**
 * g3d_context_set_bgcolor:
 * @context: a valid context
 * @r: red component (range: 0.0 .. 1.0)
 * @g: green component (range: 0.0 .. 1.0)
 * @b: green component (range: 0.0 .. 1.0)
 * @a: alpha component
 *
 * Try to set the background color. This will call a function registered
 * with <link>@g3d_context_set_set_bgcolor_func</link>.
 *
 * Returns: TRUE on success, FALSE else
 */
EAPI
gboolean g3d_context_set_bgcolor(G3DContext *context,
	G3DFloat r, G3DFloat g, G3DFloat b, G3DFloat a);

/**
 * g3d_context_update_interface:
 * @context: a valid context
 *
 * Try to update the interface. This will call a function registered with
 * @g3d_context_set_update_interface_func.
 *
 * Returns: TRUE on success, FALSE else
 */
EAPI
gboolean g3d_context_update_interface(G3DContext *context);

/**
 * g3d_context_update_progress_bar:
 * @context: a valid context
 * @percentage: the percentage to set on the progress bar
 * @visibility: show or hide the progress bar
 *
 * Try to update the progress bar.
 *
 * Returns: TRUE on success, FALSE else
 */
EAPI
gboolean g3d_context_update_progress_bar(G3DContext *context,
	G3DFloat percentage, gboolean visibility);

/**
 * g3d_context_set_set_bgcolor_func:
 * @context: a valid context
 * @func: the callback function
 * @user_data: user-defined opaque pointer
 *
 * Registers a callback function for setting the background color.
 */
EAPI
void g3d_context_set_set_bgcolor_func(G3DContext *context,
	G3DSetBgColorFunc func, gpointer user_data);

/**
 * g3d_context_set_update_interface_func:
 * @context: a valid context
 * @func: the callback function
 * @user_data: user-defined opaque pointer
 *
 * Registers a callback function for updating the interface.
 */
EAPI
void g3d_context_set_update_interface_func(G3DContext *context,
	G3DUpdateInterfaceFunc func, gpointer user_data);

/**
 * g3d_context_set_update_progress_bar_func:
 * @context: a valid context
 * @func: the callback function
 * @user_data: user-defined opaque pointer
 *
 * Registers a callback function for updating the progress bar.
 */
EAPI
void g3d_context_set_update_progress_bar_func(G3DContext *context,
	G3DUpdateProgressBarFunc func, gpointer user_data);

#ifdef __cplusplus
}
#endif /* ifdef __cplusplus */

#endif /* __G3D_CONTEXT_H__ */