~noskcaj/ubuntu/trusty/cogl/1.16.2

« back to all changes in this revision

Viewing changes to doc/reference/cogl/html/cogl-Buffers.html

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha, Jeremy Bicha, Rico Tzschichholz
  • Date: 2013-02-26 16:43:25 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20130226164325-t4z9rylpa20v0p6q
Tags: 1.13.4-0ubuntu1
[ Jeremy Bicha ]
* New upstream release
  - soname bump
* debian/control.in:
  - Bump minimum glib to 2.32
  - Drop obsolete breaks/replaces
  - Bump libclutter-1.0-dev breaks for soname transition
* debian/libcogl-dev.install:
  - Add some missing files

[ Rico Tzschichholz ]
* debian/control.in:
  - Build-depend on libxrandr-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
<head>
4
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
5
<title>Buffers</title>
6
 
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
 
6
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
7
7
<link rel="home" href="index.html" title="Cogl Reference Manual">
8
8
<link rel="up" href="ch02.html" title="Cogl experimental API">
9
9
<link rel="prev" href="ch02.html" title="Cogl experimental API">
10
10
<link rel="next" href="cogl-Vectors.html" title="Vectors">
11
 
<meta name="generator" content="GTK-Doc V1.17.1 (XML mode)">
 
11
<meta name="generator" content="GTK-Doc V1.18.1 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
13
</head>
14
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
57
57
                                                         <em class="parameter"><code>const <span class="type">void</span> *data</code></em>,
58
58
                                                         <em class="parameter"><code><span class="type">size_t</span> size</code></em>);
59
59
 
60
 
#define             <a class="link" href="cogl-Buffers.html#cogl-pixel-buffer-new" title="cogl_pixel_buffer_new">cogl_pixel_buffer_new</a>
61
 
#define             <a class="link" href="cogl-Buffers.html#cogl-is-pixel-buffer" title="cogl_is_pixel_buffer">cogl_is_pixel_buffer</a>
 
60
<span class="returnvalue">CoglPixelBuffer</span> *   <a class="link" href="cogl-Buffers.html#cogl-pixel-buffer-new" title="cogl_pixel_buffer_new ()">cogl_pixel_buffer_new</a>               (<em class="parameter"><code><span class="type">CoglContext</span> *context</code></em>,
 
61
                                                         <em class="parameter"><code><span class="type">size_t</span> size</code></em>,
 
62
                                                         <em class="parameter"><code>const <span class="type">void</span> *data</code></em>);
 
63
<span class="returnvalue">CoglBool</span>            <a class="link" href="cogl-Buffers.html#cogl-is-pixel-buffer" title="cogl_is_pixel_buffer ()">cogl_is_pixel_buffer</a>                (<em class="parameter"><code><span class="type">void</span> *object</code></em>);
62
64
</pre>
63
65
</div>
64
66
<div class="refsect1">
65
67
<a name="cogl-Buffers.description"></a><h2>Description</h2>
66
68
<p>
67
69
The CoglBuffer API provides a common interface to manipulate
68
 
buffers that have been allocated either via <a class="link" href="cogl-Buffers.html#cogl-pixel-buffer-new" title="cogl_pixel_buffer_new"><code class="function">cogl_pixel_buffer_new()</code></a>
 
70
buffers that have been allocated either via <a class="link" href="cogl-Buffers.html#cogl-pixel-buffer-new" title="cogl_pixel_buffer_new ()"><code class="function">cogl_pixel_buffer_new()</code></a>
69
71
or <code class="function">cogl_attribute_buffer_new()</code>. The API allows you to upload data
70
72
to these buffers and define usage hints that help Cogl manage your
71
73
buffer optimally.
91
93
<p>
92
94
Checks whether <em class="parameter"><code>buffer</code></em> is a buffer object.
93
95
</p>
94
 
<div class="variablelist"><table border="0">
 
96
<div class="variablelist"><table border="0" class="variablelist">
 
97
<colgroup>
95
98
<col align="left" valign="top">
 
99
<col>
 
100
</colgroup>
96
101
<tbody>
97
102
<tr>
98
103
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
101
106
<tr>
102
107
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
103
108
<td>
104
 
<code class="literal">TRUE</code> if the handle is a CoglBuffer, and <code class="literal">FALSE</code> otherwise</td>
 
109
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the handle is a CoglBuffer, and <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</td>
105
110
</tr>
106
111
</tbody>
107
112
</table></div>
115
120
<p>
116
121
Retrieves the size of buffer
117
122
</p>
118
 
<div class="variablelist"><table border="0">
 
123
<div class="variablelist"><table border="0" class="variablelist">
 
124
<colgroup>
119
125
<col align="left" valign="top">
 
126
<col>
 
127
</colgroup>
120
128
<tbody>
121
129
<tr>
122
130
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
134
142
<hr>
135
143
<div class="refsect2">
136
144
<a name="CoglBufferUpdateHint"></a><h3>enum CoglBufferUpdateHint</h3>
137
 
<pre class="programlisting">typedef enum { /*&lt; prefix=COGL_BUFFER_UPDATE_HINT &gt;*/
 
145
<pre class="programlisting">typedef enum {
 
146
 /*&lt; prefix=COGL_BUFFER_UPDATE_HINT &gt;*/
138
147
  COGL_BUFFER_UPDATE_HINT_STATIC,
139
148
  COGL_BUFFER_UPDATE_HINT_DYNAMIC,
140
149
  COGL_BUFFER_UPDATE_HINT_STREAM
144
153
The update hint on a buffer allows the user to give some detail on how often
145
154
the buffer data is going to be updated.
146
155
</p>
147
 
<div class="variablelist"><table border="0">
 
156
<div class="variablelist"><table border="0" class="variablelist">
 
157
<colgroup>
148
158
<col align="left" valign="top">
 
159
<col>
 
160
</colgroup>
149
161
<tbody>
150
162
<tr>
151
163
<td><p><a name="COGL-BUFFER-UPDATE-HINT-STATIC:CAPS"></a><span class="term"><code class="literal">COGL_BUFFER_UPDATE_HINT_STATIC</code></span></p></td>
177
189
Sets the update hint on a buffer. See <a class="link" href="cogl-Buffers.html#CoglBufferUpdateHint" title="enum CoglBufferUpdateHint"><span class="type">CoglBufferUpdateHint</span></a> for a description
178
190
of the available hints.
179
191
</p>
180
 
<div class="variablelist"><table border="0">
 
192
<div class="variablelist"><table border="0" class="variablelist">
 
193
<colgroup>
181
194
<col align="left" valign="top">
 
195
<col>
 
196
</colgroup>
182
197
<tbody>
183
198
<tr>
184
199
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
200
215
<p>
201
216
Retrieves the update hints set using <a class="link" href="cogl-Buffers.html#cogl-buffer-set-update-hint" title="cogl_buffer_set_update_hint ()"><code class="function">cogl_buffer_set_update_hint()</code></a>
202
217
</p>
203
 
<div class="variablelist"><table border="0">
 
218
<div class="variablelist"><table border="0" class="variablelist">
 
219
<colgroup>
204
220
<col align="left" valign="top">
 
221
<col>
 
222
</colgroup>
205
223
<tbody>
206
224
<tr>
207
225
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
219
237
<hr>
220
238
<div class="refsect2">
221
239
<a name="CoglBufferAccess"></a><h3>enum CoglBufferAccess</h3>
222
 
<pre class="programlisting">typedef enum { /*&lt; prefix=COGL_BUFFER_ACCESS &gt;*/
 
240
<pre class="programlisting">typedef enum {
 
241
 /*&lt; prefix=COGL_BUFFER_ACCESS &gt;*/
223
242
 COGL_BUFFER_ACCESS_READ       = 1 &lt;&lt; 0,
224
243
 COGL_BUFFER_ACCESS_WRITE      = 1 &lt;&lt; 1,
225
244
 COGL_BUFFER_ACCESS_READ_WRITE = COGL_BUFFER_ACCESS_READ | COGL_BUFFER_ACCESS_WRITE
228
247
<p>
229
248
The access hints for <a class="link" href="cogl-Buffers.html#cogl-buffer-set-update-hint" title="cogl_buffer_set_update_hint ()"><code class="function">cogl_buffer_set_update_hint()</code></a>
230
249
</p>
231
 
<div class="variablelist"><table border="0">
 
250
<div class="variablelist"><table border="0" class="variablelist">
 
251
<colgroup>
232
252
<col align="left" valign="top">
 
253
<col>
 
254
</colgroup>
233
255
<tbody>
234
256
<tr>
235
257
<td><p><a name="COGL-BUFFER-ACCESS-READ:CAPS"></a><span class="term"><code class="literal">COGL_BUFFER_ACCESS_READ</code></span></p></td>
259
281
                                                         <em class="parameter"><code><a class="link" href="cogl-Buffers.html#CoglBufferAccess" title="enum CoglBufferAccess"><span class="type">CoglBufferAccess</span></a> access</code></em>,
260
282
                                                         <em class="parameter"><code><span class="type">CoglBufferMapHint</span> hints</code></em>);</pre>
261
283
<p>
262
 
Maps the buffer into the application address space for direct access.
 
284
Maps the buffer into the application address space for direct
 
285
access. This is equivalent to calling <code class="function">cogl_buffer_map_range()</code> with
 
286
zero as the offset and the size of the entire buffer as the size.
263
287
</p>
264
288
<p>
265
289
It is strongly recommended that you pass
274
298
conflicting with the <em class="parameter"><code>access</code></em> mask you pass. It is also an error to
275
299
release your last reference while the buffer is mapped.
276
300
</p>
277
 
<div class="variablelist"><table border="0">
 
301
<div class="variablelist"><table border="0" class="variablelist">
 
302
<colgroup>
278
303
<col align="left" valign="top">
 
304
<col>
 
305
</colgroup>
279
306
<tbody>
280
307
<tr>
281
308
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
292
319
</tr>
293
320
<tr>
294
321
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
295
 
<td>A pointer to the mapped memory or <code class="literal">NULL</code> is the call fails</td>
 
322
<td>A pointer to the mapped memory or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is the call fails</td>
296
323
</tr>
297
324
</tbody>
298
325
</table></div>
306
333
<p>
307
334
Unmaps a buffer previously mapped by <a class="link" href="cogl-Buffers.html#cogl-buffer-map" title="cogl_buffer_map ()"><code class="function">cogl_buffer_map()</code></a>.
308
335
</p>
309
 
<div class="variablelist"><table border="0">
 
336
<div class="variablelist"><table border="0" class="variablelist">
 
337
<colgroup>
310
338
<col align="left" valign="top">
 
339
<col>
 
340
</colgroup>
311
341
<tbody><tr>
312
342
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
313
343
<td>a buffer object</td>
328
358
data is controlled by <em class="parameter"><code>offset</code></em> and <em class="parameter"><code>offset</code></em> + <em class="parameter"><code>data</code></em> should be less than the
329
359
buffer size.
330
360
</p>
331
 
<div class="variablelist"><table border="0">
 
361
<div class="variablelist"><table border="0" class="variablelist">
 
362
<colgroup>
332
363
<col align="left" valign="top">
 
364
<col>
 
365
</colgroup>
333
366
<tbody>
334
367
<tr>
335
368
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
350
383
<tr>
351
384
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
352
385
<td>
353
 
<code class="literal">TRUE</code> is the operation succeeded, <code class="literal">FALSE</code> otherwise</td>
 
386
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> is the operation succeeded, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</td>
354
387
</tr>
355
388
</tbody>
356
389
</table></div>
359
392
</div>
360
393
<hr>
361
394
<div class="refsect2">
362
 
<a name="cogl-pixel-buffer-new"></a><h3>cogl_pixel_buffer_new</h3>
363
 
<pre class="programlisting">#define cogl_pixel_buffer_new cogl_pixel_buffer_new_EXP
364
 
</pre>
 
395
<a name="cogl-pixel-buffer-new"></a><h3>cogl_pixel_buffer_new ()</h3>
 
396
<pre class="programlisting"><span class="returnvalue">CoglPixelBuffer</span> *   cogl_pixel_buffer_new               (<em class="parameter"><code><span class="type">CoglContext</span> *context</code></em>,
 
397
                                                         <em class="parameter"><code><span class="type">size_t</span> size</code></em>,
 
398
                                                         <em class="parameter"><code>const <span class="type">void</span> *data</code></em>);</pre>
365
399
<p>
366
400
Declares a new <span class="type">CoglPixelBuffer</span> of <em class="parameter"><code>size</code></em> bytes to contain arrays of
367
401
pixels. Once declared, data can be set using <a class="link" href="cogl-Buffers.html#cogl-buffer-set-data" title="cogl_buffer_set_data ()"><code class="function">cogl_buffer_set_data()</code></a>
369
403
<a class="link" href="cogl-Buffers.html#cogl-buffer-map" title="cogl_buffer_map ()"><code class="function">cogl_buffer_map()</code></a>.
370
404
</p>
371
405
<p>
372
 
If <em class="parameter"><code>data</code></em> isn't <code class="literal">NULL</code> then <em class="parameter"><code>size</code></em> bytes will be read from <em class="parameter"><code>data</code></em> and
 
406
If <em class="parameter"><code>data</code></em> isn't <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> then <em class="parameter"><code>size</code></em> bytes will be read from <em class="parameter"><code>data</code></em> and
373
407
immediately copied into the new buffer.
374
408
</p>
375
 
<div class="variablelist"><table border="0">
 
409
<div class="variablelist"><table border="0" class="variablelist">
 
410
<colgroup>
376
411
<col align="left" valign="top">
 
412
<col>
 
413
</colgroup>
377
414
<tbody>
378
415
<tr>
379
416
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
395
432
</div>
396
433
<hr>
397
434
<div class="refsect2">
398
 
<a name="cogl-is-pixel-buffer"></a><h3>cogl_is_pixel_buffer</h3>
399
 
<pre class="programlisting">#define cogl_is_pixel_buffer cogl_is_pixel_buffer_EXP
400
 
</pre>
 
435
<a name="cogl-is-pixel-buffer"></a><h3>cogl_is_pixel_buffer ()</h3>
 
436
<pre class="programlisting"><span class="returnvalue">CoglBool</span>            cogl_is_pixel_buffer                (<em class="parameter"><code><span class="type">void</span> *object</code></em>);</pre>
401
437
<p>
402
438
Checks whether <em class="parameter"><code>object</code></em> is a pixel buffer.
403
439
</p>
404
 
<div class="variablelist"><table border="0">
 
440
<div class="variablelist"><table border="0" class="variablelist">
 
441
<colgroup>
405
442
<col align="left" valign="top">
 
443
<col>
 
444
</colgroup>
406
445
<tbody>
407
446
<tr>
408
447
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
411
450
<tr>
412
451
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
413
452
<td>
414
 
<code class="literal">TRUE</code> if the <em class="parameter"><code>object</code></em> is a pixel buffer, and <code class="literal">FALSE</code>
 
453
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the <em class="parameter"><code>object</code></em> is a pixel buffer, and <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>
415
454
otherwise</td>
416
455
</tr>
417
456
</tbody>
423
462
</div>
424
463
<div class="footer">
425
464
<hr>
426
 
          Generated by GTK-Doc V1.17.1</div>
 
465
          Generated by GTK-Doc V1.18.1</div>
427
466
</body>
428
467
</html>
 
 
b'\\ No newline at end of file'