File: cogl-Utility-API.html

package info (click to toggle)
clutter 0.8.0-1.1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 11,808 kB
  • ctags: 10,141
  • sloc: ansic: 60,915; xml: 27,567; sh: 9,271; makefile: 848
file content (364 lines) | stat: -rw-r--r-- 14,304 bytes parent folder | download
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Utility API</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<link rel="start" href="index.html" title="COGL 0.8.0 Reference Manual">
<link rel="up" href="ch01.html" title="COGL - GL Abstraction API">
<link rel="prev" href="cogl-Primitives.html" title="Primitives">
<link rel="next" href="cogl-Textures.html" title="Textures">
<meta name="generator" content="GTK-Doc V1.10 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="ch01.html" title="COGL - GL Abstraction API">
<link rel="index" href="ix01.html" title="Index">
<link rel="appendix" href="license.html" title="Appendix A. License">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="cogl-Primitives.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">COGL 0.8.0
 Reference Manual</th>
<td><a accesskey="n" href="cogl-Textures.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#cogl-Utility-API.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#cogl-Utility-API.description" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="cogl-Utility-API"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="cogl-Utility-API.top_of_page"></a>Utility API</span></h2>
<p>Utility API</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="cogl-Utility-API.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
gboolean            <a class="link" href="cogl-Utility-API.html#cogl-create-context" title="cogl_create_context ()">cogl_create_context</a>                 (void);
void                <a class="link" href="cogl-Utility-API.html#cogl-destroy-context" title="cogl_destroy_context ()">cogl_destroy_context</a>                (void);
#define             <a class="link" href="cogl-Utility-API.html#COGL-INVALID-HANDLE:CAPS" title="COGL_INVALID_HANDLE">COGL_INVALID_HANDLE</a>
typedef             <a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a>;
void                (<a class="link" href="cogl-Utility-API.html#CoglFuncPtr" title="CoglFuncPtr ()">*CoglFuncPtr</a>)                      (void);

enum                <a class="link" href="cogl-Utility-API.html#CoglFeatureFlags" title="enum CoglFeatureFlags">CoglFeatureFlags</a>;
ClutterFeatureFlags <a class="link" href="cogl-Utility-API.html#cogl-get-features" title="cogl_get_features ()">cogl_get_features</a>                   (void);
gboolean            <a class="link" href="cogl-Utility-API.html#cogl-features-available" title="cogl_features_available ()">cogl_features_available</a>             (<a class="link" href="cogl-Utility-API.html#CoglFeatureFlags" title="enum CoglFeatureFlags">CoglFeatureFlags</a> features);

<a class="link" href="cogl-Utility-API.html#CoglFuncPtr" title="CoglFuncPtr ()">CoglFuncPtr</a>         <a class="link" href="cogl-Utility-API.html#cogl-get-proc-address" title="cogl_get_proc_address ()">cogl_get_proc_address</a>               (const gchar *name);
gboolean            <a class="link" href="cogl-Utility-API.html#cogl-check-extension" title="cogl_check_extension ()">cogl_check_extension</a>                (const gchar *name,
                                                         const gchar *ext);
void                <a class="link" href="cogl-Utility-API.html#cogl-get-bitmasks" title="cogl_get_bitmasks ()">cogl_get_bitmasks</a>                   (gint *red,
                                                         gint *green,
                                                         gint *blue,
                                                         gint *alpha);
void                <a class="link" href="cogl-Utility-API.html#cogl-paint-init" title="cogl_paint_init ()">cogl_paint_init</a>                     (const <a
href="../clutter/clutter-Colors.html#ClutterColor"
>ClutterColor</a> *color);

int                 <a class="link" href="cogl-Utility-API.html#cogl-util-next-p2" title="cogl_util_next_p2 ()">cogl_util_next_p2</a>                   (int a);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="cogl-Utility-API.description"></a><h2>Description</h2>
<p>

</p>
</div>
<div class="refsect1" lang="en">
<a name="cogl-Utility-API.details"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="cogl-create-context"></a><h3>cogl_create_context ()</h3>
<pre class="programlisting">gboolean            cogl_create_context                 (void);</pre>
<p>
FIXME</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>


</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-destroy-context"></a><h3>cogl_destroy_context ()</h3>
<pre class="programlisting">void                cogl_destroy_context                (void);</pre>
<p>
FIXME</p>
<p>

</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="COGL-INVALID-HANDLE:CAPS"></a><h3>COGL_INVALID_HANDLE</h3>
<pre class="programlisting">#define COGL_INVALID_HANDLE NULL
</pre>
<p>
A COGL handle that is not valid, used for unitialized handles as well as
error conditions.</p>
<p>

</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="CoglHandle"></a><h3>CoglHandle</h3>
<pre class="programlisting">typedef gpointer CoglHandle;
</pre>
<p>
Type used for storing references to cogl objects, the CoglHandle is
a fully opaque type without any public data members.</p>
<p>

</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="CoglFuncPtr"></a><h3>CoglFuncPtr ()</h3>
<pre class="programlisting">void                (*CoglFuncPtr)                      (void);</pre>
<p>
The type used by cogl for function pointers, note that this type
is used as a generic catch-all cast for function pointers and the
actual arguments and return type may be different.</p>
<p>

</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="CoglFeatureFlags"></a><h3>enum CoglFeatureFlags</h3>
<pre class="programlisting">typedef enum
{
  COGL_FEATURE_TEXTURE_RECTANGLE      = (1 &lt;&lt; 1),
  COGL_FEATURE_TEXTURE_NPOT           = (1 &lt;&lt; 2),
  COGL_FEATURE_TEXTURE_YUV            = (1 &lt;&lt; 3),
  COGL_FEATURE_TEXTURE_READ_PIXELS    = (1 &lt;&lt; 4),
  COGL_FEATURE_SHADERS_GLSL           = (1 &lt;&lt; 5),
  COGL_FEATURE_OFFSCREEN              = (1 &lt;&lt; 6),
  COGL_FEATURE_OFFSCREEN_MULTISAMPLE  = (1 &lt;&lt; 7),
  COGL_FEATURE_OFFSCREEN_BLIT         = (1 &lt;&lt; 8),
  COGL_FEATURE_FOUR_CLIP_PLANES       = (1 &lt;&lt; 9),
  COGL_FEATURE_STENCIL_BUFFER         = (1 &lt;&lt; 10)

} CoglFeatureFlags;
</pre>
<p>
Flags for the supported features.</p>
<p>

</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-get-features"></a><h3>cogl_get_features ()</h3>
<pre class="programlisting">ClutterFeatureFlags cogl_get_features                   (void);</pre>
<p>
Returns all of the features supported by COGL.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A logical OR of all the supported COGL features.

</td>
</tr></tbody>
</table></div>
<p class="since">Since  0.8
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-features-available"></a><h3>cogl_features_available ()</h3>
<pre class="programlisting">gboolean            cogl_features_available             (<a class="link" href="cogl-Utility-API.html#CoglFeatureFlags" title="enum CoglFeatureFlags">CoglFeatureFlags</a> features);</pre>
<p>
Checks whether the given COGL features are available. Multiple
features can be checked for by or-ing them together with the '|'
operator. <code class="literal">TRUE</code> is only returned if all of the requested features
are available.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>features</code></em> :</span></p></td>
<td> A bitmask of features to check for
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <code class="literal">TRUE</code> if the features are available, <code class="literal">FALSE</code> otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-get-proc-address"></a><h3>cogl_get_proc_address ()</h3>
<pre class="programlisting"><a class="link" href="cogl-Utility-API.html#CoglFuncPtr" title="CoglFuncPtr ()">CoglFuncPtr</a>         cogl_get_proc_address               (const gchar *name);</pre>
<p>
Gets a pointer to a given GL or GL ES extension function. This acts
as a wrapper around <code class="function">glXGetProcAddress()</code> or whatever is the
appropriate function for the current backend.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td> the name of the function.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a pointer to the requested function or <code class="literal">NULL</code> if the
function is not available.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-check-extension"></a><h3>cogl_check_extension ()</h3>
<pre class="programlisting">gboolean            cogl_check_extension                (const gchar *name,
                                                         const gchar *ext);</pre>
<p>
Check whether <em class="parameter"><code>name</code></em> occurs in list of extensions in <em class="parameter"><code>ext</code></em>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td> extension to check for
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>ext</code></em> :</span></p></td>
<td> list of extensions
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <code class="literal">TRUE</code> if the extension occurs in the list, <code class="literal">FALSE</code> otherwize.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-get-bitmasks"></a><h3>cogl_get_bitmasks ()</h3>
<pre class="programlisting">void                cogl_get_bitmasks                   (gint *red,
                                                         gint *green,
                                                         gint *blue,
                                                         gint *alpha);</pre>
<p>
Gets the number of bitplanes used for each of the color components
in the color buffer. Pass <code class="literal">NULL</code> for any of the arguments if the
value is not required.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>red</code></em> :</span></p></td>
<td> Return location for the number of red bits or <code class="literal">NULL</code>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>green</code></em> :</span></p></td>
<td> Return location for the number of green bits or <code class="literal">NULL</code>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>blue</code></em> :</span></p></td>
<td> Return location for the number of blue bits or <code class="literal">NULL</code>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>alpha</code></em> :</span></p></td>
<td> Return location for the number of alpha bits or <code class="literal">NULL</code>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-paint-init"></a><h3>cogl_paint_init ()</h3>
<pre class="programlisting">void                cogl_paint_init                     (const <a
href="../clutter/clutter-Colors.html#ClutterColor"
>ClutterColor</a> *color);</pre>
<p>
Clears the color buffer to <em class="parameter"><code>color</code></em>. The depth buffer and stencil
buffers are also cleared and fogging and lighting are disabled.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>color</code></em> :</span></p></td>
<td> Background color to clear to
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-util-next-p2"></a><h3>cogl_util_next_p2 ()</h3>
<pre class="programlisting">int                 cogl_util_next_p2                   (int a);</pre>
<p>
Calculates the next power greater than <em class="parameter"><code>a</code></em>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>a</code></em> :</span></p></td>
<td> Value to get the next power
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The next power after <em class="parameter"><code>a</code></em>.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.10</div>
</body>
</html>