2 <!-- This file was automatically generated from C sources - DO NOT EDIT!
3 To affect the contents of this file, edit the original C definitions,
4 and/or use gtk-doc annotations. -->
5 <repository version="1.1"
6 xmlns="http://www.gtk.org/introspection/core/1.0"
7 xmlns:c="http://www.gtk.org/introspection/c/1.0"
8 xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
9 <include name="GL" version="1.0"/>
10 <include name="GLib" version="2.0"/>
11 <include name="GObject" version="2.0"/>
12 <package name="gobject-2.0"/>
13 <c:include name="cogl/cogl.h"/>
14 <namespace name="Cogl" version="1.0" shared-library="libclutter-glx-1.0.so.0" c:prefix="Cogl">
15 <alias name="Angle" target="int32" c:type="CoglAngle"/>
16 <alias name="Fixed" target="int32" c:type="CoglFixed"/>
17 <alias name="Handle" target="any" c:type="CoglHandle"/>
18 <constant name="AFIRST_BIT" value="64">
21 <constant name="A_BIT" value="16">
24 <enumeration name="AttributeType"
26 glib:type-name="CoglAttributeType"
27 glib:get-type="cogl_attribute_type_get_type"
28 c:type="CoglAttributeType">
29 <doc xml:whitespace="preserve">Data types for the components of cogl_vertex_buffer_add()</doc>
32 c:identifier="COGL_ATTRIBUTE_TYPE_BYTE"
34 <member name="unsigned_byte"
36 c:identifier="COGL_ATTRIBUTE_TYPE_UNSIGNED_BYTE"
37 glib:nick="unsigned-byte"/>
40 c:identifier="COGL_ATTRIBUTE_TYPE_SHORT"
42 <member name="unsigned_short"
44 c:identifier="COGL_ATTRIBUTE_TYPE_UNSIGNED_SHORT"
45 glib:nick="unsigned-short"/>
48 c:identifier="COGL_ATTRIBUTE_TYPE_FLOAT"
51 <constant name="BGR_BIT" value="32">
54 <record name="Bitmap" c:type="CoglBitmap">
55 <constructor name="new_from_file"
56 c:identifier="cogl_bitmap_new_from_file"
59 <doc xml:whitespace="preserve">Loads an image file from disk. This function can be safely called from
61 %NULL if loading the image failed.</doc>
62 <return-value transfer-ownership="full">
63 <doc xml:whitespace="preserve">a #CoglBitmap to the new loaded image data, or</doc>
64 <type name="Bitmap" c:type="CoglBitmap*"/>
67 <parameter name="filename" transfer-ownership="none">
68 <doc xml:whitespace="preserve">the file to load.</doc>
69 <type name="utf8" c:type="char*"/>
74 <enumeration name="BitmapError"
76 glib:type-name="CoglBitmapError"
77 glib:get-type="cogl_bitmap_error_get_type"
78 c:type="CoglBitmapError"
79 glib:error-quark="cogl_bitmap_error_quark">
80 <doc xml:whitespace="preserve">Error codes that can be thrown when performing bitmap
81 operations. Note that gdk_pixbuf_new_from_file() can also throw
82 errors directly from the underlying image loading library. For
83 example, if GdkPixbuf is used then errors #GdkPixbufError<!-- -->s
84 will be used directly.</doc>
87 c:identifier="COGL_BITMAP_ERROR_FAILED"
89 <member name="unknown_type"
91 c:identifier="COGL_BITMAP_ERROR_UNKNOWN_TYPE"
92 glib:nick="unknown-type"/>
93 <member name="corrupt_image"
95 c:identifier="COGL_BITMAP_ERROR_CORRUPT_IMAGE"
96 glib:nick="corrupt-image"/>
98 <enumeration name="BlendStringError"
100 glib:type-name="CoglBlendStringError"
101 glib:get-type="cogl_blend_string_error_get_type"
102 c:type="CoglBlendStringError"
103 glib:error-quark="cogl_blend_string_error_quark">
104 <doc xml:whitespace="preserve">Error enumeration for the blend strings parser</doc>
105 <member name="parse_error"
107 c:identifier="COGL_BLEND_STRING_ERROR_PARSE_ERROR"
108 glib:nick="parse-error"/>
109 <member name="argument_parse_error"
111 c:identifier="COGL_BLEND_STRING_ERROR_ARGUMENT_PARSE_ERROR"
112 glib:nick="argument-parse-error"/>
113 <member name="invalid_error"
115 c:identifier="COGL_BLEND_STRING_ERROR_INVALID_ERROR"
116 glib:nick="invalid-error"/>
117 <member name="gpu_unsupported_error"
119 c:identifier="COGL_BLEND_STRING_ERROR_GPU_UNSUPPORTED_ERROR"
120 glib:nick="gpu-unsupported-error"/>
122 <record name="Buffer" c:type="CoglBuffer">
123 <method name="get_size_EXP" c:identifier="cogl_buffer_get_size_EXP">
124 <return-value transfer-ownership="none">
125 <type name="uint" c:type="unsigned int"/>
128 <method name="set_update_hint_EXP"
129 c:identifier="cogl_buffer_set_update_hint_EXP">
130 <return-value transfer-ownership="none">
131 <type name="none" c:type="void"/>
134 <parameter name="hint" transfer-ownership="none">
135 <type name="BufferUpdateHint" c:type="CoglBufferUpdateHint"/>
139 <method name="get_update_hint_EXP"
140 c:identifier="cogl_buffer_get_update_hint_EXP">
141 <return-value transfer-ownership="full">
142 <type name="BufferUpdateHint" c:type="CoglBufferUpdateHint"/>
145 <method name="map_EXP" c:identifier="cogl_buffer_map_EXP">
146 <return-value transfer-ownership="full">
147 <array c:type="guint8*">
152 <parameter name="access" transfer-ownership="none">
153 <type name="BufferAccess" c:type="CoglBufferAccess"/>
155 <parameter name="hints" transfer-ownership="none">
156 <type name="BufferMapHint" c:type="CoglBufferMapHint"/>
160 <method name="unmap_EXP" c:identifier="cogl_buffer_unmap_EXP">
161 <return-value transfer-ownership="none">
162 <type name="none" c:type="void"/>
165 <method name="set_data_EXP" c:identifier="cogl_buffer_set_data_EXP">
166 <return-value transfer-ownership="none">
167 <type name="boolean" c:type="gboolean"/>
170 <parameter name="offset" transfer-ownership="none">
171 <type name="gsize" c:type="gsize"/>
173 <parameter name="data" transfer-ownership="none">
174 <array c:type="guint8*">
178 <parameter name="size" transfer-ownership="none">
179 <type name="gsize" c:type="gsize"/>
184 <bitfield name="BufferAccess"
186 glib:type-name="CoglBufferAccess"
187 glib:get-type="cogl_buffer_access_get_type"
188 c:type="CoglBufferAccess">
189 <doc xml:whitespace="preserve">The access hints for cogl_buffer_set_update_hint()</doc>
192 c:identifier="COGL_BUFFER_ACCESS_READ"
196 c:identifier="COGL_BUFFER_ACCESS_WRITE"
198 <member name="read_write"
200 c:identifier="COGL_BUFFER_ACCESS_READ_WRITE"
201 glib:nick="read-write"/>
204 c:identifier="COGL_BUFFER_ACCESS_WRITE"
207 <bitfield name="BufferBit"
209 glib:type-name="CoglBufferBit"
210 glib:get-type="cogl_buffer_bit_get_type"
211 c:type="CoglBufferBit">
212 <doc xml:whitespace="preserve">Types of auxiliary buffers</doc>
215 c:identifier="COGL_BUFFER_BIT_COLOR"
219 c:identifier="COGL_BUFFER_BIT_DEPTH"
221 <member name="stencil"
223 c:identifier="COGL_BUFFER_BIT_STENCIL"
224 glib:nick="stencil"/>
226 <bitfield name="BufferMapHint"
228 glib:type-name="CoglBufferMapHint"
229 glib:get-type="cogl_buffer_map_hint_get_type"
230 c:type="CoglBufferMapHint">
231 <doc xml:whitespace="preserve">all the buffer's contents.
232 Hints to Cogl about how you are planning to modify the data once it
234 <member name="discard"
236 c:identifier="COGL_BUFFER_MAP_HINT_DISCARD"
237 glib:nick="discard"/>
239 <bitfield name="BufferTarget"
241 glib:type-name="CoglBufferTarget"
242 glib:get-type="cogl_buffer_target_get_type"
243 c:type="CoglBufferTarget">
244 <doc xml:whitespace="preserve">Target flags for FBOs.</doc>
245 <member name="window_buffer"
247 c:identifier="COGL_WINDOW_BUFFER"
248 glib:nick="window-buffer"/>
249 <member name="offscreen_buffer"
251 c:identifier="COGL_OFFSCREEN_BUFFER"
252 glib:nick="offscreen-buffer"/>
254 <enumeration name="BufferUpdateHint"
256 glib:type-name="CoglBufferUpdateHint"
257 glib:get-type="cogl_buffer_update_hint_get_type"
258 c:type="CoglBufferUpdateHint">
259 <doc xml:whitespace="preserve">The update hint on a buffer allows the user to give some detail on how often
260 the buffer data is going to be updated.</doc>
261 <member name="static"
263 c:identifier="COGL_BUFFER_UPDATE_HINT_STATIC"
265 <member name="dynamic"
267 c:identifier="COGL_BUFFER_UPDATE_HINT_DYNAMIC"
268 glib:nick="dynamic"/>
269 <member name="stream"
271 c:identifier="COGL_BUFFER_UPDATE_HINT_STREAM"
274 <record name="Color" c:type="CoglColor" version="1.0">
275 <doc xml:whitespace="preserve">A structure for holding a color definition. The contents of
276 the CoglColor structure are private and should never by accessed
278 <field name="red" writable="1">
279 <type name="uint8" c:type="guint8"/>
281 <field name="green" writable="1">
282 <type name="uint8" c:type="guint8"/>
284 <field name="blue" writable="1">
285 <type name="uint8" c:type="guint8"/>
287 <field name="alpha" writable="1">
288 <type name="uint8" c:type="guint8"/>
290 <field name="padding0" writable="1">
291 <type name="uint32" c:type="guint32"/>
293 <field name="padding1" writable="1">
294 <type name="uint32" c:type="guint32"/>
296 <field name="padding2" writable="1">
297 <type name="uint32" c:type="guint32"/>
299 <constructor name="new" c:identifier="cogl_color_new" version="1.0">
300 <doc xml:whitespace="preserve">Creates a new (empty) color
301 to free the allocated resources</doc>
302 <return-value transfer-ownership="full">
303 <doc xml:whitespace="preserve">a newly-allocated #CoglColor. Use cogl_color_free()</doc>
304 <type name="Color" c:type="CoglColor*"/>
307 <method name="copy" c:identifier="cogl_color_copy" version="1.0">
308 <doc xml:whitespace="preserve">Creates a copy of @color
309 to free the allocate resources</doc>
310 <return-value transfer-ownership="full">
311 <doc xml:whitespace="preserve">a newly-allocated #CoglColor. Use cogl_color_free()</doc>
312 <type name="Color" c:type="CoglColor*"/>
315 <method name="free" c:identifier="cogl_color_free" version="1.0">
316 <doc xml:whitespace="preserve">Frees the resources allocated by cogl_color_new() and cogl_color_copy()</doc>
317 <return-value transfer-ownership="none">
318 <type name="none" c:type="void"/>
321 <method name="init_from_4ub"
322 c:identifier="cogl_color_init_from_4ub"
324 <doc xml:whitespace="preserve">Sets the values of the passed channels into a #CoglColor.</doc>
325 <return-value transfer-ownership="none">
326 <type name="none" c:type="void"/>
329 <parameter name="red" transfer-ownership="none">
330 <doc xml:whitespace="preserve">value of the red channel, between 0 and 255</doc>
331 <type name="uint8" c:type="guint8"/>
333 <parameter name="green" transfer-ownership="none">
334 <doc xml:whitespace="preserve">value of the green channel, between 0 and 255</doc>
335 <type name="uint8" c:type="guint8"/>
337 <parameter name="blue" transfer-ownership="none">
338 <doc xml:whitespace="preserve">value of the blue channel, between 0 and 255</doc>
339 <type name="uint8" c:type="guint8"/>
341 <parameter name="alpha" transfer-ownership="none">
342 <doc xml:whitespace="preserve">value of the alpha channel, between 0 and 255</doc>
343 <type name="uint8" c:type="guint8"/>
347 <method name="set_from_4ub"
348 c:identifier="cogl_color_set_from_4ub"
350 deprecated="Use cogl_color_init_from_4ub instead."
351 deprecated-version="1.4">
352 <doc xml:whitespace="preserve">Sets the values of the passed channels into a #CoglColor.</doc>
353 <return-value transfer-ownership="none">
354 <type name="none" c:type="void"/>
357 <parameter name="red" transfer-ownership="none">
358 <doc xml:whitespace="preserve">value of the red channel, between 0 and 255</doc>
359 <type name="uint8" c:type="guint8"/>
361 <parameter name="green" transfer-ownership="none">
362 <doc xml:whitespace="preserve">value of the green channel, between 0 and 255</doc>
363 <type name="uint8" c:type="guint8"/>
365 <parameter name="blue" transfer-ownership="none">
366 <doc xml:whitespace="preserve">value of the blue channel, between 0 and 255</doc>
367 <type name="uint8" c:type="guint8"/>
369 <parameter name="alpha" transfer-ownership="none">
370 <doc xml:whitespace="preserve">value of the alpha channel, between 0 and 255</doc>
371 <type name="uint8" c:type="guint8"/>
375 <method name="init_from_4f"
376 c:identifier="cogl_color_init_from_4f"
378 <doc xml:whitespace="preserve">Sets the values of the passed channels into a #CoglColor</doc>
379 <return-value transfer-ownership="none">
380 <type name="none" c:type="void"/>
383 <parameter name="red" transfer-ownership="none">
384 <doc xml:whitespace="preserve">value of the red channel, between 0 and %1.0</doc>
385 <type name="float" c:type="float"/>
387 <parameter name="green" transfer-ownership="none">
388 <doc xml:whitespace="preserve">value of the green channel, between 0 and %1.0</doc>
389 <type name="float" c:type="float"/>
391 <parameter name="blue" transfer-ownership="none">
392 <doc xml:whitespace="preserve">value of the blue channel, between 0 and %1.0</doc>
393 <type name="float" c:type="float"/>
395 <parameter name="alpha" transfer-ownership="none">
396 <doc xml:whitespace="preserve">value of the alpha channel, between 0 and %1.0</doc>
397 <type name="float" c:type="float"/>
401 <method name="set_from_4f"
402 c:identifier="cogl_color_set_from_4f"
404 deprecated="Use cogl_color_init_from_4f instead."
405 deprecated-version="1.4">
406 <doc xml:whitespace="preserve">Sets the values of the passed channels into a #CoglColor</doc>
407 <return-value transfer-ownership="none">
408 <type name="none" c:type="void"/>
411 <parameter name="red" transfer-ownership="none">
412 <doc xml:whitespace="preserve">value of the red channel, between 0 and %1.0</doc>
413 <type name="float" c:type="float"/>
415 <parameter name="green" transfer-ownership="none">
416 <doc xml:whitespace="preserve">value of the green channel, between 0 and %1.0</doc>
417 <type name="float" c:type="float"/>
419 <parameter name="blue" transfer-ownership="none">
420 <doc xml:whitespace="preserve">value of the blue channel, between 0 and %1.0</doc>
421 <type name="float" c:type="float"/>
423 <parameter name="alpha" transfer-ownership="none">
424 <doc xml:whitespace="preserve">value of the alpha channel, between 0 and %1.0</doc>
425 <type name="float" c:type="float"/>
429 <method name="init_from_4fv"
430 c:identifier="cogl_color_init_from_4fv"
432 <doc xml:whitespace="preserve">Sets the values of the passed channels into a #CoglColor</doc>
433 <return-value transfer-ownership="none">
434 <type name="none" c:type="void"/>
437 <parameter name="color_array"
440 transfer-ownership="full">
441 <doc xml:whitespace="preserve">a pointer to an array of 4 float color components</doc>
442 <type name="float" c:type="float*"/>
446 <method name="get_red_byte"
447 c:identifier="cogl_color_get_red_byte"
449 <doc xml:whitespace="preserve">Retrieves the red channel of @color as a byte value
450 between 0 and 255</doc>
451 <return-value transfer-ownership="none">
452 <doc xml:whitespace="preserve">the red channel of the passed color</doc>
453 <type name="uint8" c:type="unsigned char"/>
456 <method name="get_green_byte"
457 c:identifier="cogl_color_get_green_byte"
459 <doc xml:whitespace="preserve">Retrieves the green channel of @color as a byte value
460 between 0 and 255</doc>
461 <return-value transfer-ownership="none">
462 <doc xml:whitespace="preserve">the green channel of the passed color</doc>
463 <type name="uint8" c:type="unsigned char"/>
466 <method name="get_blue_byte"
467 c:identifier="cogl_color_get_blue_byte"
469 <doc xml:whitespace="preserve">Retrieves the blue channel of @color as a byte value
470 between 0 and 255</doc>
471 <return-value transfer-ownership="none">
472 <doc xml:whitespace="preserve">the blue channel of the passed color</doc>
473 <type name="uint8" c:type="unsigned char"/>
476 <method name="get_alpha_byte"
477 c:identifier="cogl_color_get_alpha_byte"
479 <doc xml:whitespace="preserve">Retrieves the alpha channel of @color as a byte value
480 between 0 and 255</doc>
481 <return-value transfer-ownership="none">
482 <doc xml:whitespace="preserve">the alpha channel of the passed color</doc>
483 <type name="uint8" c:type="unsigned char"/>
486 <method name="get_red_float"
487 c:identifier="cogl_color_get_red_float"
489 <doc xml:whitespace="preserve">Retrieves the red channel of @color as a floating point
490 value between 0.0 and 1.0</doc>
491 <return-value transfer-ownership="none">
492 <doc xml:whitespace="preserve">the red channel of the passed color</doc>
493 <type name="float" c:type="float"/>
496 <method name="get_green_float"
497 c:identifier="cogl_color_get_green_float"
499 <doc xml:whitespace="preserve">Retrieves the green channel of @color as a floating point
500 value between 0.0 and 1.0</doc>
501 <return-value transfer-ownership="none">
502 <doc xml:whitespace="preserve">the green channel of the passed color</doc>
503 <type name="float" c:type="float"/>
506 <method name="get_blue_float"
507 c:identifier="cogl_color_get_blue_float"
509 <doc xml:whitespace="preserve">Retrieves the blue channel of @color as a floating point
510 value between 0.0 and 1.0</doc>
511 <return-value transfer-ownership="none">
512 <doc xml:whitespace="preserve">the blue channel of the passed color</doc>
513 <type name="float" c:type="float"/>
516 <method name="get_alpha_float"
517 c:identifier="cogl_color_get_alpha_float"
519 <doc xml:whitespace="preserve">Retrieves the alpha channel of @color as a floating point
520 value between 0.0 and 1.0</doc>
521 <return-value transfer-ownership="none">
522 <doc xml:whitespace="preserve">the alpha channel of the passed color</doc>
523 <type name="float" c:type="float"/>
526 <method name="get_red" c:identifier="cogl_color_get_red" version="1.0">
527 <doc xml:whitespace="preserve">Retrieves the red channel of @color as a fixed point
528 value between 0 and %1.0.</doc>
529 <return-value transfer-ownership="none">
530 <doc xml:whitespace="preserve">the red channel of the passed color</doc>
531 <type name="float" c:type="float"/>
534 <method name="get_green"
535 c:identifier="cogl_color_get_green"
537 <doc xml:whitespace="preserve">Retrieves the green channel of @color as a fixed point
538 value between 0 and %1.0.</doc>
539 <return-value transfer-ownership="none">
540 <doc xml:whitespace="preserve">the green channel of the passed color</doc>
541 <type name="float" c:type="float"/>
544 <method name="get_blue" c:identifier="cogl_color_get_blue" version="1.0">
545 <doc xml:whitespace="preserve">Retrieves the blue channel of @color as a fixed point
546 value between 0 and %1.0.</doc>
547 <return-value transfer-ownership="none">
548 <doc xml:whitespace="preserve">the blue channel of the passed color</doc>
549 <type name="float" c:type="float"/>
552 <method name="get_alpha"
553 c:identifier="cogl_color_get_alpha"
555 <doc xml:whitespace="preserve">Retrieves the alpha channel of @color as a fixed point
556 value between 0 and %1.0.</doc>
557 <return-value transfer-ownership="none">
558 <doc xml:whitespace="preserve">the alpha channel of the passed color</doc>
559 <type name="float" c:type="float"/>
562 <method name="set_red_byte"
563 c:identifier="cogl_color_set_red_byte"
565 <doc xml:whitespace="preserve">Sets the red channel of @color to @red.</doc>
566 <return-value transfer-ownership="none">
567 <type name="none" c:type="void"/>
570 <parameter name="red" transfer-ownership="none">
571 <doc xml:whitespace="preserve">a byte value between 0 and 255</doc>
572 <type name="uint8" c:type="unsigned char"/>
576 <method name="set_green_byte"
577 c:identifier="cogl_color_set_green_byte"
579 <doc xml:whitespace="preserve">Sets the green channel of @color to @green.</doc>
580 <return-value transfer-ownership="none">
581 <type name="none" c:type="void"/>
584 <parameter name="green" transfer-ownership="none">
585 <doc xml:whitespace="preserve">a byte value between 0 and 255</doc>
586 <type name="uint8" c:type="unsigned char"/>
590 <method name="set_blue_byte"
591 c:identifier="cogl_color_set_blue_byte"
593 <doc xml:whitespace="preserve">Sets the blue channel of @color to @blue.</doc>
594 <return-value transfer-ownership="none">
595 <type name="none" c:type="void"/>
598 <parameter name="blue" transfer-ownership="none">
599 <doc xml:whitespace="preserve">a byte value between 0 and 255</doc>
600 <type name="uint8" c:type="unsigned char"/>
604 <method name="set_alpha_byte"
605 c:identifier="cogl_color_set_alpha_byte"
607 <doc xml:whitespace="preserve">Sets the alpha channel of @color to @alpha.</doc>
608 <return-value transfer-ownership="none">
609 <type name="none" c:type="void"/>
612 <parameter name="alpha" transfer-ownership="none">
613 <doc xml:whitespace="preserve">a byte value between 0 and 255</doc>
614 <type name="uint8" c:type="unsigned char"/>
618 <method name="set_red_float"
619 c:identifier="cogl_color_set_red_float"
621 <doc xml:whitespace="preserve">Sets the red channel of @color to @red.</doc>
622 <return-value transfer-ownership="none">
623 <type name="none" c:type="void"/>
626 <parameter name="red" transfer-ownership="none">
627 <doc xml:whitespace="preserve">a float value between 0.0f and 1.0f</doc>
628 <type name="float" c:type="float"/>
632 <method name="set_green_float"
633 c:identifier="cogl_color_set_green_float"
635 <doc xml:whitespace="preserve">Sets the green channel of @color to @green.</doc>
636 <return-value transfer-ownership="none">
637 <type name="none" c:type="void"/>
640 <parameter name="green" transfer-ownership="none">
641 <doc xml:whitespace="preserve">a float value between 0.0f and 1.0f</doc>
642 <type name="float" c:type="float"/>
646 <method name="set_blue_float"
647 c:identifier="cogl_color_set_blue_float"
649 <doc xml:whitespace="preserve">Sets the blue channel of @color to @blue.</doc>
650 <return-value transfer-ownership="none">
651 <type name="none" c:type="void"/>
654 <parameter name="blue" transfer-ownership="none">
655 <doc xml:whitespace="preserve">a float value between 0.0f and 1.0f</doc>
656 <type name="float" c:type="float"/>
660 <method name="set_alpha_float"
661 c:identifier="cogl_color_set_alpha_float"
663 <doc xml:whitespace="preserve">Sets the alpha channel of @color to @alpha.</doc>
664 <return-value transfer-ownership="none">
665 <type name="none" c:type="void"/>
668 <parameter name="alpha" transfer-ownership="none">
669 <doc xml:whitespace="preserve">a float value between 0.0f and 1.0f</doc>
670 <type name="float" c:type="float"/>
674 <method name="set_red" c:identifier="cogl_color_set_red" version="1.4">
675 <doc xml:whitespace="preserve">Sets the red channel of @color to @red.</doc>
676 <return-value transfer-ownership="none">
677 <type name="none" c:type="void"/>
680 <parameter name="red" transfer-ownership="none">
681 <doc xml:whitespace="preserve">a float value between 0.0f and 1.0f</doc>
682 <type name="float" c:type="float"/>
686 <method name="set_green"
687 c:identifier="cogl_color_set_green"
689 <doc xml:whitespace="preserve">Sets the green channel of @color to @green.</doc>
690 <return-value transfer-ownership="none">
691 <type name="none" c:type="void"/>
694 <parameter name="green" transfer-ownership="none">
695 <doc xml:whitespace="preserve">a float value between 0.0f and 1.0f</doc>
696 <type name="float" c:type="float"/>
700 <method name="set_blue" c:identifier="cogl_color_set_blue" version="1.4">
701 <doc xml:whitespace="preserve">Sets the blue channel of @color to @blue.</doc>
702 <return-value transfer-ownership="none">
703 <type name="none" c:type="void"/>
706 <parameter name="blue" transfer-ownership="none">
707 <doc xml:whitespace="preserve">a float value between 0.0f and 1.0f</doc>
708 <type name="float" c:type="float"/>
712 <method name="set_alpha"
713 c:identifier="cogl_color_set_alpha"
715 <doc xml:whitespace="preserve">Sets the alpha channel of @color to @alpha.</doc>
716 <return-value transfer-ownership="none">
717 <type name="none" c:type="void"/>
720 <parameter name="alpha" transfer-ownership="none">
721 <doc xml:whitespace="preserve">a float value between 0.0f and 1.0f</doc>
722 <type name="float" c:type="float"/>
726 <method name="premultiply"
727 c:identifier="cogl_color_premultiply"
729 <doc xml:whitespace="preserve">Converts a non-premultiplied color to a pre-multiplied color. For
730 example, semi-transparent red is (1.0, 0, 0, 0.5) when non-premultiplied
731 and (0.5, 0, 0, 0.5) when premultiplied.</doc>
732 <return-value transfer-ownership="none">
733 <type name="none" c:type="void"/>
736 <method name="unpremultiply"
737 c:identifier="cogl_color_unpremultiply"
739 <doc xml:whitespace="preserve">Converts a pre-multiplied color to a non-premultiplied color. For
740 example, semi-transparent red is (0.5, 0, 0, 0.5) when premultiplied
741 and (1.0, 0, 0, 0.5) when non-premultiplied.</doc>
742 <return-value transfer-ownership="none">
743 <type name="none" c:type="void"/>
747 <enumeration name="DepthTestFunction"
748 glib:type-name="CoglDepthTestFunction"
749 glib:get-type="cogl_depth_test_function_get_type"
750 c:type="CoglDepthTestFunction">
751 <doc xml:whitespace="preserve">When using depth testing one of these functions is used to compare
752 the depth of an incoming fragment against the depth value currently
753 stored in the depth buffer. The function is changed using
754 cogl_material_set_depth_test_function().
755 The test is only done when depth testing is explicitly enabled. (See
756 cogl_material_set_depth_test_enabled())</doc>
759 c:identifier="COGL_DEPTH_TEST_FUNCTION_NEVER"
763 c:identifier="COGL_DEPTH_TEST_FUNCTION_LESS"
767 c:identifier="COGL_DEPTH_TEST_FUNCTION_EQUAL"
769 <member name="lequal"
771 c:identifier="COGL_DEPTH_TEST_FUNCTION_LEQUAL"
773 <member name="greater"
775 c:identifier="COGL_DEPTH_TEST_FUNCTION_GREATER"
776 glib:nick="greater"/>
777 <member name="notequal"
779 c:identifier="COGL_DEPTH_TEST_FUNCTION_NOTEQUAL"
780 glib:nick="notequal"/>
781 <member name="gequal"
783 c:identifier="COGL_DEPTH_TEST_FUNCTION_GEQUAL"
785 <member name="always"
787 c:identifier="COGL_DEPTH_TEST_FUNCTION_ALWAYS"
790 <enumeration name="DriverError"
791 glib:type-name="CoglDriverError"
792 glib:get-type="cogl_driver_error_get_type"
793 c:type="CoglDriverError">
794 <member name="unknown_version"
796 c:identifier="COGL_DRIVER_ERROR_UNKNOWN_VERSION"
797 glib:nick="unknown-version"/>
798 <member name="invalid_version"
800 c:identifier="COGL_DRIVER_ERROR_INVALID_VERSION"
801 glib:nick="invalid-version"/>
803 <enumeration name="Error"
805 glib:type-name="CoglError"
806 glib:get-type="cogl_error_get_type"
808 <doc xml:whitespace="preserve">Error enumeration for Cogl
809 The @COGL_ERROR_UNSUPPORTED error can be thrown for a variety of
810 reasons. For example:
812 <listitem><para>You've tried to use a feature that is not
813 advertised by cogl_get_features(). This could happen if you create
814 a non-sliced texture with a non-power-of-two size when
815 %COGL_FEATURE_TEXTURE_NPOT is not advertised.</para></listitem>
816 <listitem><para>The GPU can not handle the configuration you have
817 requested. An example might be if you try to use too many texture
818 layers in a single #CoglMaterial</para></listitem>
819 <listitem><para>The driver does not support some
820 configuration.</para></listiem>
821 </itemizedlist>
822 Currently this is only used by Cogl API marked as experimental so
823 this enum should also be considered experimental.</doc>
824 <member name="unsupported"
826 c:identifier="COGL_ERROR_UNSUPPORTED"
827 glib:nick="unsupported"/>
829 <constant name="FIXED_0_5" value="32768">
832 <constant name="FIXED_1" value="1">
835 <constant name="FIXED_2_PI" value="411775">
838 <constant name="FIXED_BITS" value="32">
841 <constant name="FIXED_EPSILON" value="1">
844 <constant name="FIXED_MAX" value="2147483647">
847 <constant name="FIXED_MIN" value="2147483647">
850 <constant name="FIXED_PI" value="205887">
853 <constant name="FIXED_PI_2" value="102944">
856 <constant name="FIXED_PI_4" value="51472">
859 <constant name="FIXED_Q" value="-16">
862 <bitfield name="FeatureFlags"
864 glib:type-name="CoglFeatureFlags"
865 glib:get-type="cogl_feature_flags_get_type"
866 c:type="CoglFeatureFlags">
867 <doc xml:whitespace="preserve">Flags for the supported features.</doc>
868 <member name="texture_rectangle"
870 c:identifier="COGL_FEATURE_TEXTURE_RECTANGLE"
871 glib:nick="texture-rectangle"/>
872 <member name="texture_npot"
874 c:identifier="COGL_FEATURE_TEXTURE_NPOT"
875 glib:nick="texture-npot"/>
876 <member name="texture_yuv"
878 c:identifier="COGL_FEATURE_TEXTURE_YUV"
879 glib:nick="texture-yuv"/>
880 <member name="texture_read_pixels"
882 c:identifier="COGL_FEATURE_TEXTURE_READ_PIXELS"
883 glib:nick="texture-read-pixels"/>
884 <member name="shaders_glsl"
886 c:identifier="COGL_FEATURE_SHADERS_GLSL"
887 glib:nick="shaders-glsl"/>
888 <member name="offscreen"
890 c:identifier="COGL_FEATURE_OFFSCREEN"
891 glib:nick="offscreen"/>
892 <member name="offscreen_multisample"
894 c:identifier="COGL_FEATURE_OFFSCREEN_MULTISAMPLE"
895 glib:nick="offscreen-multisample"/>
896 <member name="offscreen_blit"
898 c:identifier="COGL_FEATURE_OFFSCREEN_BLIT"
899 glib:nick="offscreen-blit"/>
900 <member name="four_clip_planes"
902 c:identifier="COGL_FEATURE_FOUR_CLIP_PLANES"
903 glib:nick="four-clip-planes"/>
904 <member name="stencil_buffer"
906 c:identifier="COGL_FEATURE_STENCIL_BUFFER"
907 glib:nick="stencil-buffer"/>
910 c:identifier="COGL_FEATURE_VBOS"
914 c:identifier="COGL_FEATURE_PBOS"
916 <member name="unsigned_int_indices"
918 c:identifier="COGL_FEATURE_UNSIGNED_INT_INDICES"
919 glib:nick="unsigned-int-indices"/>
920 <member name="depth_range"
922 c:identifier="COGL_FEATURE_DEPTH_RANGE"
923 glib:nick="depth-range"/>
924 <member name="texture_npot_basic"
926 c:identifier="COGL_FEATURE_TEXTURE_NPOT_BASIC"
927 glib:nick="texture-npot-basic"/>
928 <member name="texture_npot_mipmap"
930 c:identifier="COGL_FEATURE_TEXTURE_NPOT_MIPMAP"
931 glib:nick="texture-npot-mipmap"/>
932 <member name="texture_npot_repeat"
934 c:identifier="COGL_FEATURE_TEXTURE_NPOT_REPEAT"
935 glib:nick="texture-npot-repeat"/>
936 <member name="point_sprite"
938 c:identifier="COGL_FEATURE_POINT_SPRITE"
939 glib:nick="point-sprite"/>
940 <member name="texture_3d"
942 c:identifier="COGL_FEATURE_TEXTURE_3D"
943 glib:nick="texture-3d"/>
944 <member name="shaders_arbfp"
946 c:identifier="COGL_FEATURE_SHADERS_ARBFP"
947 glib:nick="shaders-arbfp"/>
949 <enumeration name="FogMode"
951 glib:type-name="CoglFogMode"
952 glib:get-type="cogl_fog_mode_get_type"
953 c:type="CoglFogMode">
954 <doc xml:whitespace="preserve">The fog mode determines the equation used to calculate the fogging blend
955 factor while fogging is enabled. The simplest %COGL_FOG_MODE_LINEAR mode
958 f = end - eye_distance / end - start
960 Where eye_distance is the distance of the current fragment in eye
961 coordinates from the origin.</doc>
962 <member name="linear"
964 c:identifier="COGL_FOG_MODE_LINEAR"
966 <member name="exponential"
968 c:identifier="COGL_FOG_MODE_EXPONENTIAL"
969 glib:nick="exponential"/>
970 <member name="exponential_squared"
972 c:identifier="COGL_FOG_MODE_EXPONENTIAL_SQUARED"
973 glib:nick="exponential-squared"/>
975 <record name="Framebuffer" c:type="CoglFramebuffer">
977 <callback name="FuncPtr" c:type="CoglFuncPtr">
978 <doc xml:whitespace="preserve">The type used by cogl for function pointers, note that this type
979 is used as a generic catch-all cast for function pointers and the
980 actual arguments and return type may be different.</doc>
981 <return-value transfer-ownership="none">
982 <type name="none" c:type="void"/>
985 <glib:boxed c:type="CoglHandle"
987 glib:type-name="CoglHandle"
988 glib:get-type="cogl_handle_get_type">
989 <method name="ref" c:identifier="cogl_handle_ref">
990 <doc xml:whitespace="preserve">Increases the reference count of @handle by 1</doc>
991 <return-value transfer-ownership="full">
992 <doc xml:whitespace="preserve">the handle, with its reference count increased</doc>
993 <type name="Handle" c:type="CoglHandle"/>
996 <method name="unref" c:identifier="cogl_handle_unref">
997 <doc xml:whitespace="preserve">Drecreases the reference count of @handle by 1; if the reference
998 count reaches 0, the resources allocated by @handle will be freed</doc>
999 <return-value transfer-ownership="none">
1000 <type name="none" c:type="void"/>
1004 <enumeration name="IndicesType"
1005 glib:type-name="CoglIndicesType"
1006 glib:get-type="cogl_indices_type_get_type"
1007 c:type="CoglIndicesType">
1008 <doc xml:whitespace="preserve">You should aim to use the smallest data type that gives you enough
1009 range, since it reduces the size of your index array and can help
1010 reduce the demand on memory bandwidth.
1011 Note that %COGL_INDICES_TYPE_UNSIGNED_INT is only supported if the
1012 %COGL_FEATURE_UNSIGNED_INT_INDICES feature is available. This
1013 should always be available on OpenGL but on OpenGL ES it will only
1014 be available if the GL_OES_element_index_uint extension is
1018 c:identifier="COGL_INDICES_TYPE_UNSIGNED_BYTE"
1020 <member name="short"
1022 c:identifier="COGL_INDICES_TYPE_UNSIGNED_SHORT"
1026 c:identifier="COGL_INDICES_TYPE_UNSIGNED_INT"
1029 <record name="Material" c:type="CoglMaterial">
1030 <constructor name="new" c:identifier="cogl_material_new">
1031 <doc xml:whitespace="preserve">Allocates and initializes a blank white material</doc>
1032 <return-value transfer-ownership="full">
1033 <doc xml:whitespace="preserve">a pointer to a new #CoglMaterial</doc>
1034 <type name="Material" c:type="CoglMaterial*"/>
1037 <method name="copy" c:identifier="cogl_material_copy" version="1.2">
1038 <doc xml:whitespace="preserve">Creates a new material with the configuration copied from the
1040 We would strongly advise developers to always aim to use
1041 cogl_material_copy() instead of cogl_material_new() whenever there will
1042 be any similarity between two materials. Copying a material helps Cogl
1043 keep track of a materials ancestry which we may use to help minimize GPU
1044 state changes.</doc>
1045 <return-value transfer-ownership="full">
1046 <doc xml:whitespace="preserve">a pointer to the newly allocated #CoglMaterial</doc>
1047 <type name="Material" c:type="CoglMaterial*"/>
1050 <method name="set_color"
1051 c:identifier="cogl_material_set_color"
1053 <doc xml:whitespace="preserve">Sets the basic color of the material, used when no lighting is enabled.
1054 Note that if you don't add any layers to the material then the color
1055 will be blended unmodified with the destination; the default blend
1056 semi-transparent red. See cogl_color_premultiply().
1057 The default value is (1.0, 1.0, 1.0, 1.0)</doc>
1058 <return-value transfer-ownership="none">
1059 <type name="none" c:type="void"/>
1062 <parameter name="color" transfer-ownership="none">
1063 <doc xml:whitespace="preserve">The components of the color</doc>
1064 <type name="Color" c:type="CoglColor*"/>
1068 <method name="set_color4ub"
1069 c:identifier="cogl_material_set_color4ub"
1071 <doc xml:whitespace="preserve">Sets the basic color of the material, used when no lighting is enabled.
1072 The default value is (0xff, 0xff, 0xff, 0xff)</doc>
1073 <return-value transfer-ownership="none">
1074 <type name="none" c:type="void"/>
1077 <parameter name="red" transfer-ownership="none">
1078 <doc xml:whitespace="preserve">The red component</doc>
1079 <type name="uint8" c:type="guint8"/>
1081 <parameter name="green" transfer-ownership="none">
1082 <doc xml:whitespace="preserve">The green component</doc>
1083 <type name="uint8" c:type="guint8"/>
1085 <parameter name="blue" transfer-ownership="none">
1086 <doc xml:whitespace="preserve">The blue component</doc>
1087 <type name="uint8" c:type="guint8"/>
1089 <parameter name="alpha" transfer-ownership="none">
1090 <doc xml:whitespace="preserve">The alpha component</doc>
1091 <type name="uint8" c:type="guint8"/>
1095 <method name="set_color4f"
1096 c:identifier="cogl_material_set_color4f"
1098 <doc xml:whitespace="preserve">Sets the basic color of the material, used when no lighting is enabled.
1099 The default value is (1.0, 1.0, 1.0, 1.0)</doc>
1100 <return-value transfer-ownership="none">
1101 <type name="none" c:type="void"/>
1104 <parameter name="red" transfer-ownership="none">
1105 <doc xml:whitespace="preserve">The red component</doc>
1106 <type name="float" c:type="float"/>
1108 <parameter name="green" transfer-ownership="none">
1109 <doc xml:whitespace="preserve">The green component</doc>
1110 <type name="float" c:type="float"/>
1112 <parameter name="blue" transfer-ownership="none">
1113 <doc xml:whitespace="preserve">The blue component</doc>
1114 <type name="float" c:type="float"/>
1116 <parameter name="alpha" transfer-ownership="none">
1117 <doc xml:whitespace="preserve">The alpha component</doc>
1118 <type name="float" c:type="float"/>
1122 <method name="get_color"
1123 c:identifier="cogl_material_get_color"
1125 <doc xml:whitespace="preserve">Retrieves the current material color.</doc>
1126 <return-value transfer-ownership="none">
1127 <type name="none" c:type="void"/>
1130 <parameter name="color"
1132 caller-allocates="1"
1133 transfer-ownership="none">
1134 <doc xml:whitespace="preserve">The location to store the color</doc>
1135 <type name="Color" c:type="CoglColor*"/>
1139 <method name="set_ambient"
1140 c:identifier="cogl_material_set_ambient"
1142 <doc xml:whitespace="preserve">Sets the material's ambient color, in the standard OpenGL lighting
1143 model. The ambient color affects the overall color of the object.
1144 Since the diffuse color will be intense when the light hits the surface
1145 directly, the ambient will be most apparent where the light hits at a
1147 The default value is (0.2, 0.2, 0.2, 1.0)</doc>
1148 <return-value transfer-ownership="none">
1149 <type name="none" c:type="void"/>
1152 <parameter name="ambient" transfer-ownership="none">
1153 <doc xml:whitespace="preserve">The components of the desired ambient color</doc>
1154 <type name="Color" c:type="CoglColor*"/>
1158 <method name="get_ambient"
1159 c:identifier="cogl_material_get_ambient"
1161 <doc xml:whitespace="preserve">Retrieves the current ambient color for @material</doc>
1162 <return-value transfer-ownership="none">
1163 <type name="none" c:type="void"/>
1166 <parameter name="ambient" transfer-ownership="none">
1167 <doc xml:whitespace="preserve">The location to store the ambient color</doc>
1168 <type name="Color" c:type="CoglColor*"/>
1172 <method name="set_diffuse"
1173 c:identifier="cogl_material_set_diffuse"
1175 <doc xml:whitespace="preserve">Sets the material's diffuse color, in the standard OpenGL lighting
1176 model. The diffuse color is most intense where the light hits the
1177 surface directly - perpendicular to the surface.
1178 The default value is (0.8, 0.8, 0.8, 1.0)</doc>
1179 <return-value transfer-ownership="none">
1180 <type name="none" c:type="void"/>
1183 <parameter name="diffuse" transfer-ownership="none">
1184 <doc xml:whitespace="preserve">The components of the desired diffuse color</doc>
1185 <type name="Color" c:type="CoglColor*"/>
1189 <method name="get_diffuse"
1190 c:identifier="cogl_material_get_diffuse"
1192 <doc xml:whitespace="preserve">Retrieves the current diffuse color for @material</doc>
1193 <return-value transfer-ownership="none">
1194 <type name="none" c:type="void"/>
1197 <parameter name="diffuse" transfer-ownership="none">
1198 <doc xml:whitespace="preserve">The location to store the diffuse color</doc>
1199 <type name="Color" c:type="CoglColor*"/>
1203 <method name="set_ambient_and_diffuse"
1204 c:identifier="cogl_material_set_ambient_and_diffuse"
1206 <doc xml:whitespace="preserve">Conveniently sets the diffuse and ambient color of @material at the same
1207 time. See cogl_material_set_ambient() and cogl_material_set_diffuse().
1208 The default ambient color is (0.2, 0.2, 0.2, 1.0)
1209 The default diffuse color is (0.8, 0.8, 0.8, 1.0)</doc>
1210 <return-value transfer-ownership="none">
1211 <type name="none" c:type="void"/>
1214 <parameter name="color" transfer-ownership="none">
1215 <doc xml:whitespace="preserve">The components of the desired ambient and diffuse colors</doc>
1216 <type name="Color" c:type="CoglColor*"/>
1220 <method name="set_specular"
1221 c:identifier="cogl_material_set_specular"
1223 <doc xml:whitespace="preserve">Sets the material's specular color, in the standard OpenGL lighting
1224 model. The intensity of the specular color depends on the viewport
1225 position, and is brightest along the lines of reflection.
1226 The default value is (0.0, 0.0, 0.0, 1.0)</doc>
1227 <return-value transfer-ownership="none">
1228 <type name="none" c:type="void"/>
1231 <parameter name="specular" transfer-ownership="none">
1232 <doc xml:whitespace="preserve">The components of the desired specular color</doc>
1233 <type name="Color" c:type="CoglColor*"/>
1237 <method name="get_specular"
1238 c:identifier="cogl_material_get_specular"
1240 <doc xml:whitespace="preserve">Retrieves the materials current specular color.</doc>
1241 <return-value transfer-ownership="none">
1242 <type name="none" c:type="void"/>
1245 <parameter name="specular" transfer-ownership="none">
1246 <doc xml:whitespace="preserve">The location to store the specular color</doc>
1247 <type name="Color" c:type="CoglColor*"/>
1251 <method name="set_shininess"
1252 c:identifier="cogl_material_set_shininess"
1254 <doc xml:whitespace="preserve">Sets the shininess of the material, in the standard OpenGL lighting
1255 model, which determines the size of the specular highlights. A
1256 higher @shininess will produce smaller highlights which makes the
1257 object appear more shiny.
1258 The default value is 0.0</doc>
1259 <return-value transfer-ownership="none">
1260 <type name="none" c:type="void"/>
1263 <parameter name="shininess" transfer-ownership="none">
1264 <doc xml:whitespace="preserve">The desired shininess; must be >= 0.0</doc>
1265 <type name="float" c:type="float"/>
1269 <method name="get_shininess"
1270 c:identifier="cogl_material_get_shininess"
1272 <doc xml:whitespace="preserve">Retrieves the materials current emission color.</doc>
1273 <return-value transfer-ownership="none">
1274 <doc xml:whitespace="preserve">The materials current shininess value</doc>
1275 <type name="float" c:type="float"/>
1278 <method name="set_emission"
1279 c:identifier="cogl_material_set_emission"
1281 <doc xml:whitespace="preserve">Sets the material's emissive color, in the standard OpenGL lighting
1282 model. It will look like the surface is a light source emitting this
1284 The default value is (0.0, 0.0, 0.0, 1.0)</doc>
1285 <return-value transfer-ownership="none">
1286 <type name="none" c:type="void"/>
1289 <parameter name="emission" transfer-ownership="none">
1290 <doc xml:whitespace="preserve">The components of the desired emissive color</doc>
1291 <type name="Color" c:type="CoglColor*"/>
1295 <method name="get_emission"
1296 c:identifier="cogl_material_get_emission"
1298 <doc xml:whitespace="preserve">Retrieves the materials current emission color.</doc>
1299 <return-value transfer-ownership="none">
1300 <type name="none" c:type="void"/>
1303 <parameter name="emission" transfer-ownership="none">
1304 <doc xml:whitespace="preserve">The location to store the emission color</doc>
1305 <type name="Color" c:type="CoglColor*"/>
1309 <method name="set_alpha_test_function"
1310 c:identifier="cogl_material_set_alpha_test_function"
1312 <doc xml:whitespace="preserve">Before a primitive is blended with the framebuffer, it goes through an
1313 alpha test stage which lets you discard fragments based on the current
1314 alpha value. This function lets you change the function used to evaluate
1315 the alpha channel, and thus determine which fragments are discarded
1316 and which continue on to the blending stage.
1317 The default is %COGL_MATERIAL_ALPHA_FUNC_ALWAYS</doc>
1318 <return-value transfer-ownership="none">
1319 <type name="none" c:type="void"/>
1322 <parameter name="alpha_func" transfer-ownership="none">
1323 <doc xml:whitespace="preserve">A @CoglMaterialAlphaFunc constant</doc>
1324 <type name="MaterialAlphaFunc" c:type="CoglMaterialAlphaFunc"/>
1326 <parameter name="alpha_reference" transfer-ownership="none">
1327 <doc xml:whitespace="preserve">A reference point that the chosen alpha function uses to compare incoming fragments to.</doc>
1328 <type name="float" c:type="float"/>
1332 <method name="set_blend"
1333 c:identifier="cogl_material_set_blend"
1336 <doc xml:whitespace="preserve">If not already familiar; please refer <link linkend="cogl-Blend-Strings">here</link>
1337 for an overview of what blend strings are, and their syntax.
1338 Blending occurs after the alpha test function, and combines fragments with
1340 Currently the only blend function Cogl exposes is ADD(). So any valid
1341 blend statements will be of the form:
1343 &lt;channel-mask&gt;=ADD(SRC_COLOR*(&lt;factor&gt;), DST_COLOR*(&lt;factor&gt;))
1345 <warning>The brackets around blend factors are currently not
1346 optional!</warning>
1347 This is the list of source-names usable as blend factors:
1348 <itemizedlist>
1349 <listitem><para>SRC_COLOR: The color of the in comming fragment</para></listitem>
1350 <listitem><para>DST_COLOR: The color of the framebuffer</para></listitem>
1351 <listitem><para>CONSTANT: The constant set via cogl_material_set_blend_constant()</para></listitem>
1352 </itemizedlist>
1353 The source names can be used according to the
1354 <link linkend="cogl-Blend-String-syntax">color-source and factor syntax</link>,
1355 so for example "(1-SRC_COLOR[A])" would be a valid factor, as would
1357 These can also be used as factors:
1358 <itemizedlist>
1359 <listitem>0: (0, 0, 0, 0)</listitem>
1360 <listitem>1: (1, 1, 1, 1)</listitem>
1361 <listitem>SRC_ALPHA_SATURATE_FACTOR: (f,f,f,1) where f = MIN(SRC_COLOR[A],1-DST_COLOR[A])</listitem>
1362 </itemizedlist>
1363 <note>Remember; all color components are normalized to the range [0, 1]
1364 before computing the result of blending.</note>
1365 <example id="cogl-Blend-Strings-blend-unpremul">
1366 <title>Blend Strings/1</title>
1367 <para>Blend a non-premultiplied source over a destination with
1368 premultiplied alpha:</para>
1369 <programlisting>
1370 "RGB = ADD(SRC_COLOR*(SRC_COLOR[A]), DST_COLOR*(1-SRC_COLOR[A]))"
1371 "A = ADD(SRC_COLOR, DST_COLOR*(1-SRC_COLOR[A]))"
1372 </programlisting>
1374 <example id="cogl-Blend-Strings-blend-premul">
1375 <title>Blend Strings/2</title>
1376 <para>Blend a premultiplied source over a destination with
1377 premultiplied alpha</para>
1378 <programlisting>
1379 "RGBA = ADD(SRC_COLOR, DST_COLOR*(1-SRC_COLOR[A]))"
1380 </programlisting>
1382 The default blend string is:
1384 RGBA = ADD (SRC_COLOR, DST_COLOR*(1-SRC_COLOR[A]))
1386 That gives normal alpha-blending when the calculated color for the material
1387 is in premultiplied form.
1388 described blending is supported by the underlying driver/hardware. If
1389 there was an error, %FALSE is returned and @error is set accordingly (if
1391 <return-value transfer-ownership="none">
1392 <doc xml:whitespace="preserve">%TRUE if the blend string was successfully parsed, and the</doc>
1393 <type name="boolean" c:type="gboolean"/>
1396 <parameter name="blend_string" transfer-ownership="none">
1397 <doc xml:whitespace="preserve">A <link linkend="cogl-Blend-Strings">Cogl blend string</link> describing the desired blend function.</doc>
1398 <type name="utf8" c:type="char*"/>
1402 <method name="set_blend_constant"
1403 c:identifier="cogl_material_set_blend_constant"
1405 <doc xml:whitespace="preserve">When blending is setup to reference a CONSTANT blend factor then
1406 blending will depend on the constant set with this function.</doc>
1407 <return-value transfer-ownership="none">
1408 <type name="none" c:type="void"/>
1411 <parameter name="constant_color" transfer-ownership="none">
1412 <doc xml:whitespace="preserve">The constant color you want</doc>
1413 <type name="Color" c:type="CoglColor*"/>
1417 <method name="get_user_program"
1418 c:identifier="cogl_material_get_user_program"
1420 <doc xml:whitespace="preserve">Queries what user program has been associated with the given</doc>
1421 <return-value transfer-ownership="full">
1422 <doc xml:whitespace="preserve">The current user program or %COGL_INVALID_HANDLE.</doc>
1423 <type name="Handle" c:type="CoglHandle"/>
1426 <method name="set_user_program"
1427 c:identifier="cogl_material_set_user_program"
1429 <doc xml:whitespace="preserve">Associates a linked CoglProgram with the given material so that the
1430 program can take full control of vertex and/or fragment processing.
1431 This is an example of how it can be used to associate an ARBfp
1432 program with a #CoglMaterial:
1436 CoglMaterial *material;
1437 shader = cogl_create_shader (COGL_SHADER_TYPE_FRAGMENT);
1438 cogl_shader_source (shader,
1440 "MOV result.color,fragment.color;\n"
1442 cogl_shader_compile (shader);
1443 program = cogl_create_program ();
1444 cogl_program_attach_shader (program, shader);
1445 cogl_program_link (program);
1446 material = cogl_material_new ();
1447 cogl_material_set_user_program (material, program);
1448 cogl_set_source_color4ub (0xff, 0x00, 0x00, 0xff);
1449 cogl_rectangle (0, 0, 100, 100);
1451 It is possibly worth keeping in mind that this API is not part of
1452 the long term design for how we want to expose shaders to Cogl
1453 developers (We are planning on deprecating the cogl_program and
1454 cogl_shader APIs in favour of a "snippet" framework) but in the
1455 meantime we hope this will handle most practical GLSL and ARBfp
1457 Also remember you need to check for either the
1458 %COGL_FEATURE_SHADERS_GLSL or %COGL_FEATURE_SHADERS_ARBFP before
1459 using the cogl_program or cogl_shader API.</doc>
1460 <return-value transfer-ownership="none">
1461 <type name="none" c:type="void"/>
1464 <parameter name="program" transfer-ownership="none">
1465 <doc xml:whitespace="preserve">A #CoglHandle to a linked CoglProgram</doc>
1466 <type name="Handle" c:type="CoglHandle"/>
1470 <method name="set_layer"
1471 c:identifier="cogl_material_set_layer"
1473 <doc xml:whitespace="preserve">In addition to the standard OpenGL lighting model a Cogl material may have
1474 one or more layers comprised of textures that can be blended together in
1475 order, with a number of different texture combine modes. This function
1476 defines a new texture layer.
1477 The index values of multiple layers do not have to be consecutive; it is
1478 only their relative order that is important.
1479 <note>In the future, we may define other types of material layers, such
1480 as purely GLSL based layers.</note></doc>
1481 <return-value transfer-ownership="none">
1482 <type name="none" c:type="void"/>
1485 <parameter name="layer_index" transfer-ownership="none">
1486 <doc xml:whitespace="preserve">the index of the layer</doc>
1487 <type name="int" c:type="int"/>
1489 <parameter name="texture" transfer-ownership="none">
1490 <doc xml:whitespace="preserve">a #CoglHandle for the layer object</doc>
1491 <type name="Handle" c:type="CoglHandle"/>
1495 <method name="remove_layer" c:identifier="cogl_material_remove_layer">
1496 <doc xml:whitespace="preserve">This function removes a layer from your material</doc>
1497 <return-value transfer-ownership="none">
1498 <type name="none" c:type="void"/>
1501 <parameter name="layer_index" transfer-ownership="none">
1502 <doc xml:whitespace="preserve">Specifies the layer you want to remove</doc>
1503 <type name="int" c:type="int"/>
1507 <method name="set_layer_combine"
1508 c:identifier="cogl_material_set_layer_combine"
1511 <doc xml:whitespace="preserve">If not already familiar; you can refer
1512 <link linkend="cogl-Blend-Strings">here</link> for an overview of what blend
1513 strings are and there syntax.
1514 These are all the functions available for texture combining:
1515 <itemizedlist>
1516 <listitem>REPLACE(arg0) = arg0</listitem>
1517 <listitem>MODULATE(arg0, arg1) = arg0 x arg1</listitem>
1518 <listitem>ADD(arg0, arg1) = arg0 + arg1</listitem>
1519 <listitem>ADD_SIGNED(arg0, arg1) = arg0 + arg1 - 0.5</listitem>
1520 <listitem>INTERPOLATE(arg0, arg1, arg2) = arg0 x arg2 + arg1 x (1 - arg2)</listitem>
1521 <listitem>SUBTRACT(arg0, arg1) = arg0 - arg1</listitem>
1523 <programlisting>
1524 DOT3_RGB(arg0, arg1) = 4 x ((arg0[R] - 0.5)) * (arg1[R] - 0.5) +
1525 (arg0[G] - 0.5)) * (arg1[G] - 0.5) +
1526 (arg0[B] - 0.5)) * (arg1[B] - 0.5))
1527 </programlisting>
1530 <programlisting>
1531 DOT3_RGBA(arg0, arg1) = 4 x ((arg0[R] - 0.5)) * (arg1[R] - 0.5) +
1532 (arg0[G] - 0.5)) * (arg1[G] - 0.5) +
1533 (arg0[B] - 0.5)) * (arg1[B] - 0.5))
1534 </programlisting>
1536 </itemizedlist>
1538 <link linkend="cogl-Blend-String-syntax">color-source syntax</link> for
1539 describing the arguments. The valid source names for texture combining
1541 <variablelist>
1542 <varlistentry>
1543 <term>TEXTURE</term>
1544 <listitem>Use the color from the current texture layer</listitem>
1545 </varlistentry>
1546 <varlistentry>
1547 <term>TEXTURE_0, TEXTURE_1, etc</term>
1548 <listitem>Use the color from the specified texture layer</listitem>
1549 </varlistentry>
1550 <varlistentry>
1551 <term>CONSTANT</term>
1552 <listitem>Use the color from the constant given with
1553 cogl_material_set_layer_constant()</listitem>
1554 </varlistentry>
1555 <varlistentry>
1556 <term>PRIMARY</term>
1557 <listitem>Use the color of the material as set with
1558 cogl_material_set_color()</listitem>
1559 </varlistentry>
1560 <varlistentry>
1561 <term>PREVIOUS</term>
1562 <listitem>Either use the texture color from the previous layer, or
1563 if this is layer 0, use the color of the material as set with
1564 cogl_material_set_color()</listitem>
1565 </varlistentry>
1566 </variablelist>
1567 <refsect2 id="cogl-Layer-Combine-Examples">
1568 <title>Layer Combine Examples</title>
1569 <para>This is effectively what the default blending is:</para>
1570 <informalexample><programlisting>
1571 RGBA = MODULATE (PREVIOUS, TEXTURE)
1572 </programlisting></informalexample>
1573 <para>This could be used to cross-fade between two images, using
1574 the alpha component of a constant as the interpolator. The constant
1575 color is given by calling cogl_material_set_layer_constant.</para>
1576 <informalexample><programlisting>
1577 RGBA = INTERPOLATE (PREVIOUS, TEXTURE, CONSTANT[A])
1578 </programlisting></informalexample>
1580 <note>You can't give a multiplication factor for arguments as you can
1581 with blending.</note>
1582 described texture combining is supported by the underlying driver and
1583 or hardware. On failure, %FALSE is returned and @error is set</doc>
1584 <return-value transfer-ownership="none">
1585 <doc xml:whitespace="preserve">%TRUE if the blend string was successfully parsed, and the</doc>
1586 <type name="boolean" c:type="gboolean"/>
1589 <parameter name="layer_index" transfer-ownership="none">
1590 <doc xml:whitespace="preserve">Specifies the layer you want define a combine function for</doc>
1591 <type name="int" c:type="int"/>
1593 <parameter name="blend_string" transfer-ownership="none">
1594 <doc xml:whitespace="preserve">A <link linkend="cogl-Blend-Strings">Cogl blend string</link> describing the desired texture combine function.</doc>
1595 <type name="utf8" c:type="char*"/>
1599 <method name="set_layer_combine_constant"
1600 c:identifier="cogl_material_set_layer_combine_constant"
1602 <doc xml:whitespace="preserve">When you are using the 'CONSTANT' color source in a layer combine
1603 description then you can use this function to define its value.</doc>
1604 <return-value transfer-ownership="none">
1605 <type name="none" c:type="void"/>
1608 <parameter name="layer_index" transfer-ownership="none">
1609 <doc xml:whitespace="preserve">Specifies the layer you want to specify a constant used for texture combining</doc>
1610 <type name="int" c:type="int"/>
1612 <parameter name="constant" transfer-ownership="none">
1613 <doc xml:whitespace="preserve">The constant color you want</doc>
1614 <type name="Color" c:type="CoglColor*"/>
1618 <method name="set_layer_matrix"
1619 c:identifier="cogl_material_set_layer_matrix">
1620 <doc xml:whitespace="preserve">This function lets you set a matrix that can be used to e.g. translate
1621 and rotate a single layer of a material used to fill your geometry.</doc>
1622 <return-value transfer-ownership="none">
1623 <type name="none" c:type="void"/>
1626 <parameter name="layer_index" transfer-ownership="none">
1627 <doc xml:whitespace="preserve">the index for the layer inside @material</doc>
1628 <type name="int" c:type="int"/>
1630 <parameter name="matrix" transfer-ownership="none">
1631 <doc xml:whitespace="preserve">the transformation matrix for the layer</doc>
1632 <type name="Matrix" c:type="CoglMatrix*"/>
1636 <method name="get_layers" c:identifier="cogl_material_get_layers">
1637 <doc xml:whitespace="preserve">This function lets you access a material's internal list of layers
1639 <note>You should avoid using this API if possible since it was only
1640 made public by mistake and will be deprecated when we have
1641 suitable alternative.</note>
1642 <note>It's important to understand that the list returned may not
1643 remain valid if you modify the material or any of the layers in any
1644 way and so you would have to re-get the list in that
1645 situation.</note>
1646 list of #CoglMaterialLayer<!-- -->'s that can be passed to the
1647 cogl_material_layer_* functions. The list is owned by Cogl and it
1648 should not be modified or freed</doc>
1649 <return-value transfer-ownership="none">
1650 <doc xml:whitespace="preserve">A</doc>
1651 <type name="GLib.List" c:type="GList*">
1652 <type name="MaterialLayer"/>
1656 <method name="get_n_layers"
1657 c:identifier="cogl_material_get_n_layers"
1659 <doc xml:whitespace="preserve">Retrieves the number of layers defined for the given @material</doc>
1660 <return-value transfer-ownership="none">
1661 <doc xml:whitespace="preserve">the number of layers</doc>
1662 <type name="int" c:type="int"/>
1665 <method name="set_layer_filters"
1666 c:identifier="cogl_material_set_layer_filters">
1667 <doc xml:whitespace="preserve">Changes the decimation and interpolation filters used when a texture is
1668 drawn at other scales than 100%.</doc>
1669 <return-value transfer-ownership="none">
1670 <type name="none" c:type="void"/>
1673 <parameter name="layer_index" transfer-ownership="none">
1674 <doc xml:whitespace="preserve">the layer number to change.</doc>
1675 <type name="int" c:type="int"/>
1677 <parameter name="min_filter" transfer-ownership="none">
1678 <doc xml:whitespace="preserve">the filter used when scaling a texture down.</doc>
1679 <type name="MaterialFilter" c:type="CoglMaterialFilter"/>
1681 <parameter name="mag_filter" transfer-ownership="none">
1682 <doc xml:whitespace="preserve">the filter used when magnifying a texture.</doc>
1683 <type name="MaterialFilter" c:type="CoglMaterialFilter"/>
1687 <method name="set_layer_point_sprite_coords_enabled"
1688 c:identifier="cogl_material_set_layer_point_sprite_coords_enabled"
1691 <doc xml:whitespace="preserve">When rendering points, if @enable is %TRUE then the texture
1692 coordinates for this layer will be replaced with coordinates that
1693 vary from 0.0 to 1.0 across the primitive. The top left of the
1694 point will have the coordinates 0.0,0.0 and the bottom right will
1695 have 1.0,1.0. If @enable is %FALSE then the coordinates will be
1696 fixed for the entire point.
1697 This function will only work if %COGL_FEATURE_POINT_SPRITE is
1698 available. If the feature is not available then the function will
1699 return %FALSE and set @error.</doc>
1700 <return-value transfer-ownership="none">
1701 <doc xml:whitespace="preserve">%TRUE if the function succeeds, %FALSE otherwise.</doc>
1702 <type name="boolean" c:type="gboolean"/>
1705 <parameter name="layer_index" transfer-ownership="none">
1706 <doc xml:whitespace="preserve">the layer number to change.</doc>
1707 <type name="int" c:type="int"/>
1709 <parameter name="enable" transfer-ownership="none">
1710 <doc xml:whitespace="preserve">whether to enable point sprite coord generation.</doc>
1711 <type name="boolean" c:type="gboolean"/>
1715 <method name="get_layer_point_sprite_coords_enabled"
1716 c:identifier="cogl_material_get_layer_point_sprite_coords_enabled"
1718 <doc xml:whitespace="preserve">Gets whether point sprite coordinate generation is enabled for this
1720 point sprite coordinates.</doc>
1721 <return-value transfer-ownership="none">
1722 <doc xml:whitespace="preserve">whether the texture coordinates will be replaced with</doc>
1723 <type name="boolean" c:type="gboolean"/>
1726 <parameter name="layer_index" transfer-ownership="none">
1727 <doc xml:whitespace="preserve">the layer number to check.</doc>
1728 <type name="int" c:type="int"/>
1732 <method name="set_layer_wrap_mode_s"
1733 c:identifier="cogl_material_set_layer_wrap_mode_s"
1735 <doc xml:whitespace="preserve">Sets the wrap mode for the 's' coordinate of texture lookups on this layer.</doc>
1736 <return-value transfer-ownership="none">
1737 <type name="none" c:type="void"/>
1740 <parameter name="layer_index" transfer-ownership="none">
1741 <doc xml:whitespace="preserve">the layer number to change.</doc>
1742 <type name="int" c:type="int"/>
1744 <parameter name="mode" transfer-ownership="none">
1745 <doc xml:whitespace="preserve">the new wrap mode</doc>
1746 <type name="MaterialWrapMode" c:type="CoglMaterialWrapMode"/>
1750 <method name="set_layer_wrap_mode_t"
1751 c:identifier="cogl_material_set_layer_wrap_mode_t"
1753 <doc xml:whitespace="preserve">Sets the wrap mode for the 't' coordinate of texture lookups on this layer.</doc>
1754 <return-value transfer-ownership="none">
1755 <type name="none" c:type="void"/>
1758 <parameter name="layer_index" transfer-ownership="none">
1759 <doc xml:whitespace="preserve">the layer number to change.</doc>
1760 <type name="int" c:type="int"/>
1762 <parameter name="mode" transfer-ownership="none">
1763 <doc xml:whitespace="preserve">the new wrap mode</doc>
1764 <type name="MaterialWrapMode" c:type="CoglMaterialWrapMode"/>
1768 <method name="set_layer_wrap_mode_p"
1769 c:identifier="cogl_material_set_layer_wrap_mode_p"
1771 <doc xml:whitespace="preserve">Sets the wrap mode for the 'p' coordinate of texture lookups on
1772 this layer. 'p' is the third coordinate.</doc>
1773 <return-value transfer-ownership="none">
1774 <type name="none" c:type="void"/>
1777 <parameter name="layer_index" transfer-ownership="none">
1778 <doc xml:whitespace="preserve">the layer number to change.</doc>
1779 <type name="int" c:type="int"/>
1781 <parameter name="mode" transfer-ownership="none">
1782 <doc xml:whitespace="preserve">the new wrap mode</doc>
1783 <type name="MaterialWrapMode" c:type="CoglMaterialWrapMode"/>
1787 <method name="set_layer_wrap_mode"
1788 c:identifier="cogl_material_set_layer_wrap_mode"
1790 <doc xml:whitespace="preserve">Sets the wrap mode for all three coordinates of texture lookups on
1791 this layer. This is equivalent to calling
1792 cogl_material_set_layer_wrap_mode_s(),
1793 cogl_material_set_layer_wrap_mode_t() and
1794 cogl_material_set_layer_wrap_mode_p() separately.</doc>
1795 <return-value transfer-ownership="none">
1796 <type name="none" c:type="void"/>
1799 <parameter name="layer_index" transfer-ownership="none">
1800 <doc xml:whitespace="preserve">the layer number to change.</doc>
1801 <type name="int" c:type="int"/>
1803 <parameter name="mode" transfer-ownership="none">
1804 <doc xml:whitespace="preserve">the new wrap mode</doc>
1805 <type name="MaterialWrapMode" c:type="CoglMaterialWrapMode"/>
1809 <method name="set_depth_test_enabled"
1810 c:identifier="cogl_material_set_depth_test_enabled"
1812 <doc xml:whitespace="preserve">Enables or disables depth testing according to the value of
1813 If depth testing is enable then the #CoglDepthTestFunction set
1814 using cogl_material_set_depth_test_function() us used to evaluate
1815 the depth value of incoming fragments against the corresponding
1816 value stored in the current depth buffer, and if the test passes
1817 then the fragments depth value is used to update the depth buffer.
1818 (unless you have disabled depth writing via
1819 cogl_material_set_depth_writing_enabled ())
1820 By default depth testing is disabled.</doc>
1821 <return-value transfer-ownership="none">
1822 <type name="none" c:type="void"/>
1825 <parameter name="enable" transfer-ownership="none">
1826 <doc xml:whitespace="preserve">The enable state you want</doc>
1827 <type name="boolean" c:type="gboolean"/>
1831 <method name="get_depth_test_enabled"
1832 c:identifier="cogl_material_get_depth_test_enabled"
1834 <doc xml:whitespace="preserve">Gets the current depth test enabled state as previously set by
1835 cogl_material_set_depth_test_enabled().</doc>
1836 <return-value transfer-ownership="none">
1837 <doc xml:whitespace="preserve">The material's current depth test enabled state.</doc>
1838 <type name="boolean" c:type="gboolean"/>
1841 <method name="set_depth_writing_enabled"
1842 c:identifier="cogl_material_set_depth_writing_enabled"
1844 <doc xml:whitespace="preserve">Enables or disables depth buffer writing according to the value of
1845 between a fragment's depth value and the corresponding depth buffer
1846 value passes then the fragment's depth is written to the depth
1847 buffer unless writing is disabled here.
1848 By default depth writing is enabled</doc>
1849 <return-value transfer-ownership="none">
1850 <type name="none" c:type="void"/>
1853 <parameter name="enable" transfer-ownership="none">
1854 <doc xml:whitespace="preserve">The enable state you want</doc>
1855 <type name="boolean" c:type="gboolean"/>
1859 <method name="get_depth_writing_enabled"
1860 c:identifier="cogl_material_get_depth_writing_enabled"
1862 <doc xml:whitespace="preserve">Gets the depth writing enable state as set by the corresponding
1863 cogl_material_set_depth_writing_enabled.</doc>
1864 <return-value transfer-ownership="none">
1865 <doc xml:whitespace="preserve">The current depth writing enable state</doc>
1866 <type name="boolean" c:type="gboolean"/>
1869 <method name="set_depth_test_function"
1870 c:identifier="cogl_material_set_depth_test_function"
1872 <doc xml:whitespace="preserve">Sets the #CoglDepthTestFunction used to compare the depth value of
1873 an incoming fragment against the corresponding value in the current
1875 <return-value transfer-ownership="none">
1876 <type name="none" c:type="void"/>
1879 <parameter name="function" transfer-ownership="none">
1880 <doc xml:whitespace="preserve">The #CoglDepthTestFunction to set</doc>
1881 <type name="DepthTestFunction" c:type="CoglDepthTestFunction"/>
1885 <method name="get_depth_test_function"
1886 c:identifier="cogl_material_get_depth_test_function"
1888 <doc xml:whitespace="preserve">Gets the current depth test enable state as previously set via
1889 cogl_material_set_depth_test_enabled().</doc>
1890 <return-value transfer-ownership="full">
1891 <doc xml:whitespace="preserve">The current depth test enable state.</doc>
1892 <type name="DepthTestFunction" c:type="CoglDepthTestFunction"/>
1895 <method name="set_depth_range"
1896 c:identifier="cogl_material_set_depth_range"
1899 <doc xml:whitespace="preserve">Sets the range to map depth values in normalized device coordinates
1900 to before writing out to a depth buffer.
1901 After your geometry has be transformed, clipped and had perspective
1902 division applied placing it in normalized device
1903 coordinates all depth values between the near and far z clipping
1904 planes are in the range -1 to 1. Before writing any depth value to
1905 the depth buffer though the value is mapped into the range [0, 1].
1906 With this function you can change the range which depth values are
1907 mapped too although the range must still lye within the range [0,
1909 If your driver does not support this feature (for example you are
1910 using GLES 1 drivers) then this will return %FALSE and set an error
1911 if @error isn't NULL. You can check ahead of time for the
1912 %COGL_FEATURE_DEPTH_RANGE feature with cogl_features_available() to
1913 know if this function will succeed.
1914 By default normalized device coordinate depth values are mapped to
1915 the full range of depth buffer values, [0, 1].</doc>
1916 <return-value transfer-ownership="none">
1917 <doc xml:whitespace="preserve">%TRUE if driver support is available else %FALSE.</doc>
1918 <type name="boolean" c:type="gboolean"/>
1921 <parameter name="near_val" transfer-ownership="none">
1922 <doc xml:whitespace="preserve">The near component of the desired depth range which will be clamped to the range [0, 1]</doc>
1923 <type name="float" c:type="float"/>
1925 <parameter name="far_val" transfer-ownership="none">
1926 <doc xml:whitespace="preserve">The far component of the desired depth range which will be clamped to the range [0, 1]</doc>
1927 <type name="float" c:type="float"/>
1931 <method name="get_depth_range"
1932 c:identifier="cogl_material_get_depth_range">
1933 <return-value transfer-ownership="none">
1934 <type name="none" c:type="void"/>
1937 <parameter name="near_val"
1939 caller-allocates="0"
1940 transfer-ownership="full">
1941 <type name="float" c:type="float*"/>
1943 <parameter name="far_val"
1945 caller-allocates="0"
1946 transfer-ownership="full">
1947 <type name="float" c:type="float*"/>
1952 <enumeration name="MaterialAlphaFunc"
1953 glib:type-name="CoglMaterialAlphaFunc"
1954 glib:get-type="cogl_material_alpha_func_get_type"
1955 c:type="CoglMaterialAlphaFunc">
1956 <doc xml:whitespace="preserve">Alpha testing happens before blending primitives with the framebuffer and
1957 gives an opportunity to discard fragments based on a comparison with the
1958 incoming alpha value and a reference alpha value. The #CoglMaterialAlphaFunc
1959 determines how the comparison is done.</doc>
1960 <member name="never"
1962 c:identifier="COGL_MATERIAL_ALPHA_FUNC_NEVER"
1966 c:identifier="COGL_MATERIAL_ALPHA_FUNC_LESS"
1968 <member name="equal"
1970 c:identifier="COGL_MATERIAL_ALPHA_FUNC_EQUAL"
1972 <member name="lequal"
1974 c:identifier="COGL_MATERIAL_ALPHA_FUNC_LEQUAL"
1975 glib:nick="lequal"/>
1976 <member name="greater"
1978 c:identifier="COGL_MATERIAL_ALPHA_FUNC_GREATER"
1979 glib:nick="greater"/>
1980 <member name="notequal"
1982 c:identifier="COGL_MATERIAL_ALPHA_FUNC_NOTEQUAL"
1983 glib:nick="notequal"/>
1984 <member name="gequal"
1986 c:identifier="COGL_MATERIAL_ALPHA_FUNC_GEQUAL"
1987 glib:nick="gequal"/>
1988 <member name="always"
1990 c:identifier="COGL_MATERIAL_ALPHA_FUNC_ALWAYS"
1991 glib:nick="always"/>
1993 <enumeration name="MaterialFilter"
1994 glib:type-name="CoglMaterialFilter"
1995 glib:get-type="cogl_material_filter_get_type"
1996 c:type="CoglMaterialFilter">
1997 <doc xml:whitespace="preserve">Texture filtering is used whenever the current pixel maps either to more
1998 than one texture element (texel) or less than one. These filter enums
1999 correspond to different strategies used to come up with a pixel color, by
2000 possibly referring to multiple neighbouring texels and taking a weighted
2001 average or simply using the nearest texel.</doc>
2002 <member name="nearest"
2004 c:identifier="COGL_MATERIAL_FILTER_NEAREST"
2005 glib:nick="nearest"/>
2006 <member name="linear"
2008 c:identifier="COGL_MATERIAL_FILTER_LINEAR"
2009 glib:nick="linear"/>
2010 <member name="nearest_mipmap_nearest"
2012 c:identifier="COGL_MATERIAL_FILTER_NEAREST_MIPMAP_NEAREST"
2013 glib:nick="nearest-mipmap-nearest"/>
2014 <member name="linear_mipmap_nearest"
2016 c:identifier="COGL_MATERIAL_FILTER_LINEAR_MIPMAP_NEAREST"
2017 glib:nick="linear-mipmap-nearest"/>
2018 <member name="nearest_mipmap_linear"
2020 c:identifier="COGL_MATERIAL_FILTER_NEAREST_MIPMAP_LINEAR"
2021 glib:nick="nearest-mipmap-linear"/>
2022 <member name="linear_mipmap_linear"
2024 c:identifier="COGL_MATERIAL_FILTER_LINEAR_MIPMAP_LINEAR"
2025 glib:nick="linear-mipmap-linear"/>
2027 <record name="MaterialLayer" c:type="CoglMaterialLayer">
2028 <method name="get_texture"
2029 c:identifier="cogl_material_layer_get_texture">
2030 <doc xml:whitespace="preserve">Extracts a texture handle for a specific layer.
2031 <note>In the future Cogl may support purely GLSL based layers; for those
2032 layers this function which will likely return %COGL_INVALID_HANDLE if you
2033 try to get the texture handle from them. Considering this scenario, you
2034 should call cogl_material_layer_get_type() first in order check it is of
2035 type %COGL_MATERIAL_LAYER_TYPE_TEXTURE before calling this function.</note></doc>
2036 <return-value transfer-ownership="full">
2037 <doc xml:whitespace="preserve">a #CoglHandle for the texture inside the layer</doc>
2038 <type name="Handle" c:type="CoglHandle"/>
2041 <method name="get_min_filter"
2042 c:identifier="cogl_material_layer_get_min_filter">
2043 <doc xml:whitespace="preserve">Queries the currently set downscaling filter for a material layer</doc>
2044 <return-value transfer-ownership="full">
2045 <doc xml:whitespace="preserve">the current downscaling filter</doc>
2046 <type name="MaterialFilter" c:type="CoglMaterialFilter"/>
2049 <method name="get_mag_filter"
2050 c:identifier="cogl_material_layer_get_mag_filter">
2051 <doc xml:whitespace="preserve">Queries the currently set downscaling filter for a material later</doc>
2052 <return-value transfer-ownership="full">
2053 <doc xml:whitespace="preserve">the current downscaling filter</doc>
2054 <type name="MaterialFilter" c:type="CoglMaterialFilter"/>
2057 <method name="get_wrap_mode_s"
2058 c:identifier="cogl_material_layer_get_wrap_mode_s"
2060 <doc xml:whitespace="preserve">Gets the wrap mode for the 's' coordinate of texture lookups on this layer.</doc>
2061 <return-value transfer-ownership="full">
2062 <doc xml:whitespace="preserve">the wrap mode value for the s coordinate.</doc>
2063 <type name="MaterialWrapMode" c:type="CoglMaterialWrapMode"/>
2066 <method name="get_wrap_mode_t"
2067 c:identifier="cogl_material_layer_get_wrap_mode_t"
2069 <doc xml:whitespace="preserve">Gets the wrap mode for the 't' coordinate of texture lookups on this layer.</doc>
2070 <return-value transfer-ownership="full">
2071 <doc xml:whitespace="preserve">the wrap mode value for the t coordinate.</doc>
2072 <type name="MaterialWrapMode" c:type="CoglMaterialWrapMode"/>
2075 <method name="get_wrap_mode_p"
2076 c:identifier="cogl_material_layer_get_wrap_mode_p"
2078 <doc xml:whitespace="preserve">Gets the wrap mode for the 'p' coordinate of texture lookups on
2079 this layer. 'p' is the third coordinate.</doc>
2080 <return-value transfer-ownership="full">
2081 <doc xml:whitespace="preserve">the wrap mode value for the p coordinate.</doc>
2082 <type name="MaterialWrapMode" c:type="CoglMaterialWrapMode"/>
2086 <enumeration name="MaterialLayerType"
2088 glib:type-name="CoglMaterialLayerType"
2089 glib:get-type="cogl_material_layer_type_get_type"
2090 c:type="CoglMaterialLayerType">
2091 <doc xml:whitespace="preserve">Available types of layers for a #CoglMaterial. This enumeration
2092 might be expanded in later versions.</doc>
2093 <member name="texture"
2095 c:identifier="COGL_MATERIAL_LAYER_TYPE_TEXTURE"
2096 glib:nick="texture"/>
2098 <enumeration name="MaterialWrapMode"
2100 glib:type-name="CoglMaterialWrapMode"
2101 glib:get-type="cogl_material_wrap_mode_get_type"
2102 c:type="CoglMaterialWrapMode">
2103 <doc xml:whitespace="preserve">The wrap mode specifies what happens when texture coordinates
2104 outside the range 0→1 are used. Note that if the filter mode is
2105 anything but %COGL_MATERIAL_FILTER_NEAREST then texels outside the
2106 range 0→1 might be used even when the coordinate is exactly 0 or 1
2107 because OpenGL will try to sample neighbouring pixels. For example
2108 if you are trying to render the full texture then you may get
2109 artifacts around the edges when the pixels from the other side are
2110 merged in if the wrap mode is set to repeat.</doc>
2111 <member name="repeat"
2113 c:identifier="COGL_MATERIAL_WRAP_MODE_REPEAT"
2114 glib:nick="repeat"/>
2115 <member name="clamp_to_edge"
2117 c:identifier="COGL_MATERIAL_WRAP_MODE_CLAMP_TO_EDGE"
2118 glib:nick="clamp-to-edge"/>
2119 <member name="automatic"
2121 c:identifier="COGL_MATERIAL_WRAP_MODE_AUTOMATIC"
2122 glib:nick="automatic"/>
2124 <record name="Matrix" c:type="CoglMatrix">
2125 <doc xml:whitespace="preserve">A CoglMatrix holds a 4x4 transform matrix. This is a single precision,
2126 column-major matrix which means it is compatible with what OpenGL expects.
2127 A CoglMatrix can represent transforms such as, rotations, scaling,
2128 translation, sheering, and linear projections. You can combine these
2129 transforms by multiplying multiple matrices in the order you want them
2131 The transformation of a vertex (x, y, z, w) by a CoglMatrix is given by:
2133 x_new = xx * x + xy * y + xz * z + xw * w
2134 y_new = yx * x + yy * y + yz * z + yw * w
2135 z_new = zx * x + zy * y + zz * z + zw * w
2136 w_new = wx * x + wy * y + wz * z + ww * w
2138 Where w is normally 1
2139 <note>You must consider the members of the CoglMatrix structure read only,
2140 and all matrix modifications must be done via the cogl_matrix API. This
2141 allows Cogl to annotate the matrices internally. Violation of this will give
2142 undefined results. If you need to initialize a matrix with a constant other
2143 than the identity matrix you can use cogl_matrix_init_from_array().</note></doc>
2144 <field name="xx" writable="1">
2145 <type name="float" c:type="float"/>
2147 <field name="yx" writable="1">
2148 <type name="float" c:type="float"/>
2150 <field name="zx" writable="1">
2151 <type name="float" c:type="float"/>
2153 <field name="wx" writable="1">
2154 <type name="float" c:type="float"/>
2156 <field name="xy" writable="1">
2157 <type name="float" c:type="float"/>
2159 <field name="yy" writable="1">
2160 <type name="float" c:type="float"/>
2162 <field name="zy" writable="1">
2163 <type name="float" c:type="float"/>
2165 <field name="wy" writable="1">
2166 <type name="float" c:type="float"/>
2168 <field name="xz" writable="1">
2169 <type name="float" c:type="float"/>
2171 <field name="yz" writable="1">
2172 <type name="float" c:type="float"/>
2174 <field name="zz" writable="1">
2175 <type name="float" c:type="float"/>
2177 <field name="wz" writable="1">
2178 <type name="float" c:type="float"/>
2180 <field name="xw" writable="1">
2181 <type name="float" c:type="float"/>
2183 <field name="yw" writable="1">
2184 <type name="float" c:type="float"/>
2186 <field name="zw" writable="1">
2187 <type name="float" c:type="float"/>
2189 <field name="ww" writable="1">
2190 <type name="float" c:type="float"/>
2192 <field name="inv" writable="1">
2193 <array zero-terminated="0" c:type="float" fixed-size="16">
2194 <type name="float"/>
2197 <field name="type" writable="1">
2198 <type name="uint" c:type="unsigned"/>
2200 <field name="flags" writable="1">
2201 <type name="uint" c:type="unsigned"/>
2203 <field name="_padding3" writable="1">
2204 <type name="uint" c:type="unsigned"/>
2206 <method name="init_identity" c:identifier="cogl_matrix_init_identity">
2207 <doc xml:whitespace="preserve">Resets matrix to the identity matrix:
2209 .xx=1; .xy=0; .xz=0; .xw=0;
2210 .yx=0; .yy=1; .yz=0; .yw=0;
2211 .zx=0; .zy=0; .zz=1; .zw=0;
2212 .wx=0; .wy=0; .wz=0; .ww=1;
2214 <return-value transfer-ownership="none">
2215 <type name="none" c:type="void"/>
2218 <method name="multiply" c:identifier="cogl_matrix_multiply">
2219 <doc xml:whitespace="preserve">Multiplies the two supplied matrices together and stores
2220 the resulting matrix inside @result</doc>
2221 <return-value transfer-ownership="none">
2222 <type name="none" c:type="void"/>
2225 <parameter name="a" transfer-ownership="none">
2226 <doc xml:whitespace="preserve">A 4x4 transformation matrix</doc>
2227 <type name="Matrix" c:type="CoglMatrix*"/>
2229 <parameter name="b" transfer-ownership="none">
2230 <doc xml:whitespace="preserve">A 4x4 transformation matrix</doc>
2231 <type name="Matrix" c:type="CoglMatrix*"/>
2235 <method name="rotate" c:identifier="cogl_matrix_rotate">
2236 <doc xml:whitespace="preserve">Multiplies @matrix with a rotation matrix that applies a rotation
2237 of @angle degrees around the specified 3D vector.</doc>
2238 <return-value transfer-ownership="none">
2239 <type name="none" c:type="void"/>
2242 <parameter name="angle" transfer-ownership="none">
2243 <doc xml:whitespace="preserve">The angle you want to rotate in degrees</doc>
2244 <type name="float" c:type="float"/>
2246 <parameter name="x" transfer-ownership="none">
2247 <doc xml:whitespace="preserve">X component of your rotation vector</doc>
2248 <type name="float" c:type="float"/>
2250 <parameter name="y" transfer-ownership="none">
2251 <doc xml:whitespace="preserve">Y component of your rotation vector</doc>
2252 <type name="float" c:type="float"/>
2254 <parameter name="z" transfer-ownership="none">
2255 <doc xml:whitespace="preserve">Z component of your rotation vector</doc>
2256 <type name="float" c:type="float"/>
2260 <method name="translate" c:identifier="cogl_matrix_translate">
2261 <doc xml:whitespace="preserve">Multiplies @matrix with a transform matrix that translates along
2262 the X, Y and Z axis.</doc>
2263 <return-value transfer-ownership="none">
2264 <type name="none" c:type="void"/>
2267 <parameter name="x" transfer-ownership="none">
2268 <doc xml:whitespace="preserve">The X translation you want to apply</doc>
2269 <type name="float" c:type="float"/>
2271 <parameter name="y" transfer-ownership="none">
2272 <doc xml:whitespace="preserve">The Y translation you want to apply</doc>
2273 <type name="float" c:type="float"/>
2275 <parameter name="z" transfer-ownership="none">
2276 <doc xml:whitespace="preserve">The Z translation you want to apply</doc>
2277 <type name="float" c:type="float"/>
2281 <method name="scale" c:identifier="cogl_matrix_scale">
2282 <doc xml:whitespace="preserve">Multiplies @matrix with a transform matrix that scales along the X,
2284 <return-value transfer-ownership="none">
2285 <type name="none" c:type="void"/>
2288 <parameter name="sx" transfer-ownership="none">
2289 <doc xml:whitespace="preserve">The X scale factor</doc>
2290 <type name="float" c:type="float"/>
2292 <parameter name="sy" transfer-ownership="none">
2293 <doc xml:whitespace="preserve">The Y scale factor</doc>
2294 <type name="float" c:type="float"/>
2296 <parameter name="sz" transfer-ownership="none">
2297 <doc xml:whitespace="preserve">The Z scale factor</doc>
2298 <type name="float" c:type="float"/>
2302 <method name="frustum" c:identifier="cogl_matrix_frustum">
2303 <doc xml:whitespace="preserve">Multiplies @matrix by the given frustum perspective matrix.</doc>
2304 <return-value transfer-ownership="none">
2305 <type name="none" c:type="void"/>
2308 <parameter name="left" transfer-ownership="none">
2309 <doc xml:whitespace="preserve">coord of left vertical clipping plane</doc>
2310 <type name="float" c:type="float"/>
2312 <parameter name="right" transfer-ownership="none">
2313 <doc xml:whitespace="preserve">coord of right vertical clipping plane</doc>
2314 <type name="float" c:type="float"/>
2316 <parameter name="bottom" transfer-ownership="none">
2317 <doc xml:whitespace="preserve">coord of bottom horizontal clipping plane</doc>
2318 <type name="float" c:type="float"/>
2320 <parameter name="top" transfer-ownership="none">
2321 <doc xml:whitespace="preserve">coord of top horizontal clipping plane</doc>
2322 <type name="float" c:type="float"/>
2324 <parameter name="z_near" transfer-ownership="none">
2325 <doc xml:whitespace="preserve">positive distance to near depth clipping plane</doc>
2326 <type name="float" c:type="float"/>
2328 <parameter name="z_far" transfer-ownership="none">
2329 <doc xml:whitespace="preserve">positive distance to far depth clipping plane</doc>
2330 <type name="float" c:type="float"/>
2334 <method name="perspective" c:identifier="cogl_matrix_perspective">
2335 <doc xml:whitespace="preserve">Multiplies @matrix by the described perspective matrix
2336 <note>You should be careful not to have to great a @z_far / @z_near ratio
2337 since that will reduce the effectiveness of depth testing since there wont
2338 be enough precision to identify the depth of objects near to each
2339 other.</note></doc>
2340 <return-value transfer-ownership="none">
2341 <type name="none" c:type="void"/>
2344 <parameter name="fov_y" transfer-ownership="none">
2345 <doc xml:whitespace="preserve">A field of view angle for the Y axis</doc>
2346 <type name="float" c:type="float"/>
2348 <parameter name="aspect" transfer-ownership="none">
2349 <doc xml:whitespace="preserve">The ratio of width to height determining the field of view angle for the x axis.</doc>
2350 <type name="float" c:type="float"/>
2352 <parameter name="z_near" transfer-ownership="none">
2353 <doc xml:whitespace="preserve">The distance to the near clip plane. Never pass 0 and always pass a positive number.</doc>
2354 <type name="float" c:type="float"/>
2356 <parameter name="z_far" transfer-ownership="none">
2357 <doc xml:whitespace="preserve">The distance to the far clip plane. (Should always be positive)</doc>
2358 <type name="float" c:type="float"/>
2362 <method name="ortho" c:identifier="cogl_matrix_ortho">
2363 <doc xml:whitespace="preserve">Multiplies @matrix by a parallel projection matrix.</doc>
2364 <return-value transfer-ownership="none">
2365 <type name="none" c:type="void"/>
2368 <parameter name="left" transfer-ownership="none">
2369 <doc xml:whitespace="preserve">The coordinate for the left clipping plane</doc>
2370 <type name="float" c:type="float"/>
2372 <parameter name="right" transfer-ownership="none">
2373 <doc xml:whitespace="preserve">The coordinate for the right clipping plane</doc>
2374 <type name="float" c:type="float"/>
2376 <parameter name="bottom" transfer-ownership="none">
2377 <doc xml:whitespace="preserve">The coordinate for the bottom clipping plane</doc>
2378 <type name="float" c:type="float"/>
2380 <parameter name="top" transfer-ownership="none">
2381 <doc xml:whitespace="preserve">The coordinate for the top clipping plane</doc>
2382 <type name="float" c:type="float"/>
2384 <parameter name="z_near" transfer-ownership="none">
2385 <doc xml:whitespace="preserve">The coordinate for the near clipping plane (may be negative if the plane is behind the viewer)</doc>
2386 <type name="float" c:type="float"/>
2388 <parameter name="z_far" transfer-ownership="none">
2389 <doc xml:whitespace="preserve">The coordinate for the far clipping plane (may be negative if the plane is behind the viewer)</doc>
2390 <type name="float" c:type="float"/>
2394 <method name="init_from_array"
2395 c:identifier="cogl_matrix_init_from_array">
2396 <doc xml:whitespace="preserve">Initializes @matrix with the contents of @array</doc>
2397 <return-value transfer-ownership="none">
2398 <type name="none" c:type="void"/>
2401 <parameter name="array"
2403 caller-allocates="0"
2404 transfer-ownership="none">
2405 <doc xml:whitespace="preserve">A linear array of 16 floats (column-major order)</doc>
2406 <type name="float" c:type="float*"/>
2410 <method name="get_array" c:identifier="cogl_matrix_get_array">
2411 <doc xml:whitespace="preserve">Casts @matrix to a float array which can be directly passed to OpenGL.</doc>
2412 <return-value transfer-ownership="none">
2413 <doc xml:whitespace="preserve">a pointer to the float array</doc>
2414 <type name="float" c:type="float*"/>
2417 <method name="get_inverse"
2418 c:identifier="cogl_matrix_get_inverse"
2420 <doc xml:whitespace="preserve">Gets the inverse transform of a given matrix and uses it to initialize
2422 <note>Although the first parameter is annotated as const to indicate
2423 that the transform it represents isn't modified this function may
2424 technically save a copy of the inverse transform within the given
2425 #CoglMatrix so that subsequent requests for the inverse transform may
2426 avoid costly inversion calculations.</note>
2427 for degenerate transformations that can't be inverted (in this case the</doc>
2428 <return-value transfer-ownership="none">
2429 <doc xml:whitespace="preserve">%TRUE if the inverse was successfully calculated or %FALSE</doc>
2430 <type name="boolean" c:type="gboolean"/>
2433 <parameter name="inverse"
2435 caller-allocates="1"
2436 transfer-ownership="none">
2437 <doc xml:whitespace="preserve">The destination for a 4x4 inverse transformation matrix</doc>
2438 <type name="Matrix" c:type="CoglMatrix*"/>
2442 <method name="transform_point"
2443 c:identifier="cogl_matrix_transform_point">
2444 <doc xml:whitespace="preserve">Transforms a point whos position is given and returned as four float
2446 <return-value transfer-ownership="none">
2447 <type name="none" c:type="void"/>
2452 caller-allocates="0"
2453 transfer-ownership="full">
2454 <doc xml:whitespace="preserve">The X component of your points position</doc>
2455 <type name="float" c:type="float*"/>
2459 caller-allocates="0"
2460 transfer-ownership="full">
2461 <doc xml:whitespace="preserve">The Y component of your points position</doc>
2462 <type name="float" c:type="float*"/>
2466 caller-allocates="0"
2467 transfer-ownership="full">
2468 <doc xml:whitespace="preserve">The Z component of your points position</doc>
2469 <type name="float" c:type="float*"/>
2473 caller-allocates="0"
2474 transfer-ownership="full">
2475 <doc xml:whitespace="preserve">The W component of your points position</doc>
2476 <type name="float" c:type="float*"/>
2481 <record name="Object" c:type="CoglObject">
2482 <method name="set_user_data"
2483 c:identifier="cogl_object_set_user_data"
2485 <doc xml:whitespace="preserve">Associates some private @user_data with a given #CoglObject. To
2486 later remove the association call cogl_object_set_user_data() with
2487 the same @key but NULL for the @user_data.</doc>
2488 <return-value transfer-ownership="none">
2489 <type name="none" c:type="void"/>
2492 <parameter name="key" transfer-ownership="none">
2493 <doc xml:whitespace="preserve">The address of a #CoglUserDataKey which provides a unique value with which to index the private data.</doc>
2494 <type name="UserDataKey" c:type="CoglUserDataKey*"/>
2496 <parameter name="user_data" transfer-ownership="none">
2497 <doc xml:whitespace="preserve">The data to associate with the given object, or NULL to remove a previous association.</doc>
2498 <type name="any" c:type="void*"/>
2500 <parameter name="destroy" transfer-ownership="none" scope="call">
2501 <doc xml:whitespace="preserve">A #CoglUserDataDestroyCallback to call if the object is destroyed or if the association is removed by later setting NULL data for the same key.</doc>
2502 <type name="UserDataDestroyCallback"
2503 c:type="CoglUserDataDestroyCallback"/>
2507 <method name="get_user_data"
2508 c:identifier="cogl_object_get_user_data"
2510 <doc xml:whitespace="preserve">Finds the user data previously associated with @object using
2511 the given @key. If no user data has been associated with @object
2512 for the given @key this function returns NULL.
2513 the given @key; or NULL if no associated data is found.</doc>
2514 <return-value transfer-ownership="none">
2515 <doc xml:whitespace="preserve">The user data previously associated with @object using</doc>
2516 <type name="any" c:type="void*"/>
2519 <parameter name="key" transfer-ownership="none">
2520 <doc xml:whitespace="preserve">The address of a #CoglUserDataKey which provides a unique value with which to index the private data.</doc>
2521 <type name="UserDataKey" c:type="CoglUserDataKey*"/>
2526 <constant name="PIXEL_FORMAT_24" value="2">
2529 <constant name="PIXEL_FORMAT_32" value="3">
2532 <constant name="PREMULT_BIT" value="128">
2535 <record name="Path" c:type="CoglPath">
2536 <method name="copy" c:identifier="cogl_path_copy">
2537 <doc xml:whitespace="preserve">Returns a new copy of the path in @path. The new path has a
2538 reference count of 1 so you should unref it with
2539 cogl_object_unref() if you no longer need it.
2540 Internally the path will share the data until one of the paths is
2541 modified so copying paths should be relatively cheap.</doc>
2542 <return-value transfer-ownership="full">
2543 <doc xml:whitespace="preserve">a copy of the path in @path.</doc>
2544 <type name="Path" c:type="CoglPath*"/>
2548 <enumeration name="PathFillRule"
2550 glib:type-name="CoglPathFillRule"
2551 glib:get-type="cogl_path_fill_rule_get_type"
2552 c:type="CoglPathFillRule">
2553 <doc xml:whitespace="preserve">#CoglPathFillRule is used to determine how a path is filled. There
2554 are two options - 'non-zero' and 'even-odd'. To work out whether any
2555 point will be filled imagine drawing an infinetely long line in any
2556 direction from that point. The number of times and the direction
2557 that the edges of the path crosses this line determines whether the
2558 line is filled as described below. Any open sub paths are treated
2559 as if there was an extra line joining the first point and the last
2561 The default fill rule is %COGL_PATH_FILL_RULE_EVEN_ODD. The fill
2562 rule is attached to the current path so preserving a path with
2563 cogl_get_path() also preserves the fill rule. Calling
2564 cogl_path_new() resets the current fill rule to the default.
2565 <figure id="fill-rule-non-zero">
2566 <title>Example of filling various paths using the non-zero rule</title>
2567 <graphic fileref="fill-rule-non-zero.png" format="PNG"/>
2569 <figure id="fill-rule-even-odd">
2570 <title>Example of filling various paths using the even-odd rule</title>
2571 <graphic fileref="fill-rule-even-odd.png" format="PNG"/>
2572 </figure></doc>
2573 <member name="non_zero"
2575 c:identifier="COGL_PATH_FILL_RULE_NON_ZERO"
2576 glib:nick="non-zero"/>
2577 <member name="even_odd"
2579 c:identifier="COGL_PATH_FILL_RULE_EVEN_ODD"
2580 glib:nick="even-odd"/>
2582 <record name="PixelArray" c:type="CoglPixelArray">
2583 <constructor name="new_with_size_EXP"
2584 c:identifier="cogl_pixel_array_new_with_size_EXP">
2585 <return-value transfer-ownership="full">
2586 <type name="PixelArray" c:type="CoglPixelArray*"/>
2589 <parameter name="width" transfer-ownership="none">
2590 <type name="uint" c:type="unsigned int"/>
2592 <parameter name="height" transfer-ownership="none">
2593 <type name="uint" c:type="unsigned int"/>
2595 <parameter name="format" transfer-ownership="none">
2596 <type name="PixelFormat" c:type="CoglPixelFormat"/>
2598 <parameter name="stride"
2600 caller-allocates="0"
2601 transfer-ownership="full">
2602 <type name="uint" c:type="unsigned int*"/>
2607 <enumeration name="PixelFormat"
2609 glib:type-name="CoglPixelFormat"
2610 glib:get-type="cogl_pixel_format_get_type"
2611 c:type="CoglPixelFormat">
2612 <doc xml:whitespace="preserve">Pixel formats used by COGL. For the formats with a byte per
2613 component, the order of the components specify the order in
2614 increasing memory addresses. So for example
2615 %COGL_PIXEL_FORMAT_RGB_888 would have the red component in the
2616 lowest address, green in the next address and blue after that
2617 regardless of the endinanness of the system.
2618 For the 16-bit formats the component order specifies the order
2619 within a 16-bit number from most significant bit to least
2620 significant. So for %COGL_PIXEL_FORMAT_RGB_565, the red component
2621 would be in bits 11-15, the green component would be in 6-11 and
2622 the blue component would be in 1-5. Therefore the order in memory
2623 depends on the endianness of the system.
2624 When uploading a texture %COGL_PIXEL_FORMAT_ANY can be used as the
2625 internal format. Cogl will try to pick the best format to use
2626 internally and convert the texture data if necessary.</doc>
2629 c:identifier="COGL_PIXEL_FORMAT_ANY"
2633 c:identifier="COGL_PIXEL_FORMAT_A_8"
2635 <member name="rgb_565"
2637 c:identifier="COGL_PIXEL_FORMAT_RGB_565"
2638 glib:nick="rgb-565"/>
2639 <member name="rgba_4444"
2641 c:identifier="COGL_PIXEL_FORMAT_RGBA_4444"
2642 glib:nick="rgba-4444"/>
2643 <member name="rgba_5551"
2645 c:identifier="COGL_PIXEL_FORMAT_RGBA_5551"
2646 glib:nick="rgba-5551"/>
2649 c:identifier="COGL_PIXEL_FORMAT_YUV"
2653 c:identifier="COGL_PIXEL_FORMAT_G_8"
2655 <member name="rgb_888"
2657 c:identifier="COGL_PIXEL_FORMAT_RGB_888"
2658 glib:nick="rgb-888"/>
2659 <member name="bgr_888"
2661 c:identifier="COGL_PIXEL_FORMAT_BGR_888"
2662 glib:nick="bgr-888"/>
2663 <member name="rgba_8888"
2665 c:identifier="COGL_PIXEL_FORMAT_RGBA_8888"
2666 glib:nick="rgba-8888"/>
2667 <member name="bgra_8888"
2669 c:identifier="COGL_PIXEL_FORMAT_BGRA_8888"
2670 glib:nick="bgra-8888"/>
2671 <member name="argb_8888"
2673 c:identifier="COGL_PIXEL_FORMAT_ARGB_8888"
2674 glib:nick="argb-8888"/>
2675 <member name="abgr_8888"
2677 c:identifier="COGL_PIXEL_FORMAT_ABGR_8888"
2678 glib:nick="abgr-8888"/>
2679 <member name="rgba_8888_pre"
2681 c:identifier="COGL_PIXEL_FORMAT_RGBA_8888_PRE"
2682 glib:nick="rgba-8888-pre"/>
2683 <member name="bgra_8888_pre"
2685 c:identifier="COGL_PIXEL_FORMAT_BGRA_8888_PRE"
2686 glib:nick="bgra-8888-pre"/>
2687 <member name="argb_8888_pre"
2689 c:identifier="COGL_PIXEL_FORMAT_ARGB_8888_PRE"
2690 glib:nick="argb-8888-pre"/>
2691 <member name="abgr_8888_pre"
2693 c:identifier="COGL_PIXEL_FORMAT_ABGR_8888_PRE"
2694 glib:nick="abgr-8888-pre"/>
2695 <member name="rgba_4444_pre"
2697 c:identifier="COGL_PIXEL_FORMAT_RGBA_4444_PRE"
2698 glib:nick="rgba-4444-pre"/>
2699 <member name="rgba_5551_pre"
2701 c:identifier="COGL_PIXEL_FORMAT_RGBA_5551_PRE"
2702 glib:nick="rgba-5551-pre"/>
2704 <constant name="RADIANS_TO_DEGREES" value="3754936">
2707 <bitfield name="ReadPixelsFlags"
2709 glib:type-name="CoglReadPixelsFlags"
2710 glib:get-type="cogl_read_pixels_flags_get_type"
2711 c:type="CoglReadPixelsFlags">
2712 <doc xml:whitespace="preserve">Flags for cogl_read_pixels()</doc>
2713 <member name="color_buffer"
2715 c:identifier="COGL_READ_PIXELS_COLOR_BUFFER"
2716 glib:nick="color-buffer"/>
2718 <constant name="SQRTI_ARG_10_PERCENT" value="5590">
2721 <constant name="SQRTI_ARG_5_PERCENT" value="210">
2724 <constant name="SQRTI_ARG_MAX" value="4194303">
2727 <enumeration name="ShaderType"
2729 glib:type-name="CoglShaderType"
2730 glib:get-type="cogl_shader_type_get_type"
2731 c:type="CoglShaderType">
2732 <doc xml:whitespace="preserve">Types of shaders</doc>
2733 <member name="vertex"
2735 c:identifier="COGL_SHADER_TYPE_VERTEX"
2736 glib:nick="vertex"/>
2737 <member name="fragment"
2739 c:identifier="COGL_SHADER_TYPE_FRAGMENT"
2740 glib:nick="fragment"/>
2742 <constant name="TEXTURE_MAX_WASTE" value="127">
2745 <bitfield name="TextureFlags"
2747 glib:type-name="CoglTextureFlags"
2748 glib:get-type="cogl_texture_flags_get_type"
2749 c:type="CoglTextureFlags">
2750 <doc xml:whitespace="preserve">Flags to pass to the cogl_texture_new_* family of functions.</doc>
2753 c:identifier="COGL_TEXTURE_NONE"
2755 <member name="no_auto_mipmap"
2757 c:identifier="COGL_TEXTURE_NO_AUTO_MIPMAP"
2758 glib:nick="no-auto-mipmap"/>
2759 <member name="no_slicing"
2761 c:identifier="COGL_TEXTURE_NO_SLICING"
2762 glib:nick="no-slicing"/>
2763 <member name="no_atlas"
2765 c:identifier="COGL_TEXTURE_NO_ATLAS"
2766 glib:nick="no-atlas"/>
2768 <enumeration name="TexturePixmapX11ReportLevel"
2769 glib:type-name="CoglTexturePixmapX11ReportLevel"
2770 glib:get-type="cogl_texture_pixmap_x11_report_level_get_type"
2771 c:type="CoglTexturePixmapX11ReportLevel">
2772 <member name="raw_rectangles"
2774 c:identifier="COGL_TEXTURE_PIXMAP_X11_DAMAGE_RAW_RECTANGLES"
2775 glib:nick="raw-rectangles"/>
2776 <member name="delta_rectangles"
2778 c:identifier="COGL_TEXTURE_PIXMAP_X11_DAMAGE_DELTA_RECTANGLES"
2779 glib:nick="delta-rectangles"/>
2780 <member name="bounding_box"
2782 c:identifier="COGL_TEXTURE_PIXMAP_X11_DAMAGE_BOUNDING_BOX"
2783 glib:nick="bounding-box"/>
2784 <member name="non_empty"
2786 c:identifier="COGL_TEXTURE_PIXMAP_X11_DAMAGE_NON_EMPTY"
2787 glib:nick="non-empty"/>
2789 <record name="TextureVertex" c:type="CoglTextureVertex">
2790 <doc xml:whitespace="preserve">Used to specify vertex information when calling cogl_polygon()</doc>
2791 <field name="x" writable="1">
2792 <type name="float" c:type="float"/>
2794 <field name="y" writable="1">
2795 <type name="float" c:type="float"/>
2797 <field name="z" writable="1">
2798 <type name="float" c:type="float"/>
2800 <field name="tx" writable="1">
2801 <type name="float" c:type="float"/>
2803 <field name="ty" writable="1">
2804 <type name="float" c:type="float"/>
2806 <field name="color" writable="1">
2807 <type name="Color" c:type="CoglColor"/>
2810 <constant name="UNORDERED_MASK" value="15">
2813 <constant name="UNPREMULT_MASK" value="127">
2816 <callback name="UserDataDestroyCallback"
2817 c:type="CoglUserDataDestroyCallback"
2819 <doc xml:whitespace="preserve">When associating private data with a #CoglObject a callback can be
2820 given which will be called either if the object is destroyed or if
2821 cogl_object_set_user_data() is called with NULL user_data for the
2823 <return-value transfer-ownership="none">
2824 <type name="none" c:type="void"/>
2827 <parameter name="user_data" transfer-ownership="none" closure="0">
2828 <doc xml:whitespace="preserve">The data whos association with a #CoglObject has been destoyed.</doc>
2829 <type name="any" c:type="void*"/>
2833 <record name="UserDataKey" c:type="CoglUserDataKey" version="1.4">
2834 <doc xml:whitespace="preserve">A #CoglUserDataKey is used to declare a key for attaching data to a
2835 #CoglObject using cogl_object_set_user_data. The typedef only exists as a
2836 formality to make code self documenting since only the unique address of a
2837 #CoglUserDataKey is used.
2838 Typically you would declare a static #CoglUserDataKey and set private data
2839 on an object something like this:
2841 static CoglUserDataKey path_private_key;
2843 destroy_path_private_cb (void *data)
2848 my_path_set_data (CoglPath *path, void *data)
2850 cogl_object_set_user_data (COGL_OBJECT (path),
2853 destroy_path_private_cb);
2856 <field name="unused" writable="1">
2857 <type name="int" c:type="int"/>
2860 <record name="Vector3" c:type="CoglVector3">
2861 <field name="x" writable="1">
2862 <type name="float" c:type="float"/>
2864 <field name="y" writable="1">
2865 <type name="float" c:type="float"/>
2867 <field name="z" writable="1">
2868 <type name="float" c:type="float"/>
2870 <method name="init_EXP" c:identifier="cogl_vector3_init_EXP">
2871 <return-value transfer-ownership="none">
2872 <type name="none" c:type="void"/>
2875 <parameter name="x" transfer-ownership="none">
2876 <type name="float" c:type="float"/>
2878 <parameter name="y" transfer-ownership="none">
2879 <type name="float" c:type="float"/>
2881 <parameter name="z" transfer-ownership="none">
2882 <type name="float" c:type="float"/>
2886 <method name="init_zero_EXP" c:identifier="cogl_vector3_init_zero_EXP">
2887 <return-value transfer-ownership="none">
2888 <type name="none" c:type="void"/>
2891 <method name="equal_with_epsilon_EXP"
2892 c:identifier="cogl_vector3_equal_with_epsilon_EXP">
2893 <return-value transfer-ownership="none">
2894 <type name="boolean" c:type="gboolean"/>
2897 <parameter name="vector1" transfer-ownership="none">
2898 <type name="Vector3" c:type="CoglVector3*"/>
2900 <parameter name="epsilon" transfer-ownership="none">
2901 <type name="float" c:type="float"/>
2905 <method name="copy_EXP" c:identifier="cogl_vector3_copy_EXP">
2906 <return-value transfer-ownership="full">
2907 <type name="Vector3" c:type="CoglVector3*"/>
2910 <method name="free_EXP" c:identifier="cogl_vector3_free_EXP">
2911 <return-value transfer-ownership="none">
2912 <type name="none" c:type="void"/>
2915 <method name="invert_EXP" c:identifier="cogl_vector3_invert_EXP">
2916 <return-value transfer-ownership="none">
2917 <type name="none" c:type="void"/>
2920 <method name="add_EXP" c:identifier="cogl_vector3_add_EXP">
2921 <return-value transfer-ownership="none">
2922 <type name="none" c:type="void"/>
2925 <parameter name="a" transfer-ownership="none">
2926 <type name="Vector3" c:type="CoglVector3*"/>
2928 <parameter name="b" transfer-ownership="none">
2929 <type name="Vector3" c:type="CoglVector3*"/>
2933 <method name="subtract_EXP" c:identifier="cogl_vector3_subtract_EXP">
2934 <return-value transfer-ownership="none">
2935 <type name="none" c:type="void"/>
2938 <parameter name="a" transfer-ownership="none">
2939 <type name="Vector3" c:type="CoglVector3*"/>
2941 <parameter name="b" transfer-ownership="none">
2942 <type name="Vector3" c:type="CoglVector3*"/>
2946 <method name="multiply_scalar_EXP"
2947 c:identifier="cogl_vector3_multiply_scalar_EXP">
2948 <return-value transfer-ownership="none">
2949 <type name="none" c:type="void"/>
2952 <parameter name="scalar" transfer-ownership="none">
2953 <type name="float" c:type="float"/>
2957 <method name="divide_scalar_EXP"
2958 c:identifier="cogl_vector3_divide_scalar_EXP">
2959 <return-value transfer-ownership="none">
2960 <type name="none" c:type="void"/>
2963 <parameter name="scalar" transfer-ownership="none">
2964 <type name="float" c:type="float"/>
2968 <method name="normalize_EXP" c:identifier="cogl_vector3_normalize_EXP">
2969 <return-value transfer-ownership="none">
2970 <type name="none" c:type="void"/>
2973 <method name="magnitude_EXP" c:identifier="cogl_vector3_magnitude_EXP">
2974 <return-value transfer-ownership="none">
2975 <type name="float" c:type="float"/>
2978 <method name="cross_product_EXP"
2979 c:identifier="cogl_vector3_cross_product_EXP">
2980 <return-value transfer-ownership="none">
2981 <type name="none" c:type="void"/>
2984 <parameter name="u" transfer-ownership="none">
2985 <type name="Vector3" c:type="CoglVector3*"/>
2987 <parameter name="v" transfer-ownership="none">
2988 <type name="Vector3" c:type="CoglVector3*"/>
2992 <method name="dot_product_EXP"
2993 c:identifier="cogl_vector3_dot_product_EXP">
2994 <return-value transfer-ownership="none">
2995 <type name="float" c:type="float"/>
2998 <parameter name="b" transfer-ownership="none">
2999 <type name="Vector3" c:type="CoglVector3*"/>
3003 <method name="distance_EXP" c:identifier="cogl_vector3_distance_EXP">
3004 <return-value transfer-ownership="none">
3005 <type name="float" c:type="float"/>
3008 <parameter name="b" transfer-ownership="none">
3009 <type name="Vector3" c:type="CoglVector3*"/>
3014 <enumeration name="VerticesMode"
3016 glib:type-name="CoglVerticesMode"
3017 glib:get-type="cogl_vertices_mode_get_type"
3018 c:type="CoglVerticesMode">
3019 <doc xml:whitespace="preserve">How vertices passed to cogl_vertex_buffer_draw() and
3020 cogl_vertex_buffer_draw_elements() should be interpreted</doc>
3021 <member name="points"
3023 c:identifier="COGL_VERTICES_MODE_POINTS"
3024 glib:nick="points"/>
3025 <member name="line_strip"
3027 c:identifier="COGL_VERTICES_MODE_LINE_STRIP"
3028 glib:nick="line-strip"/>
3029 <member name="line_loop"
3031 c:identifier="COGL_VERTICES_MODE_LINE_LOOP"
3032 glib:nick="line-loop"/>
3033 <member name="lines"
3035 c:identifier="COGL_VERTICES_MODE_LINES"
3037 <member name="triangle_strip"
3039 c:identifier="COGL_VERTICES_MODE_TRIANGLE_STRIP"
3040 glib:nick="triangle-strip"/>
3041 <member name="triangle_fan"
3043 c:identifier="COGL_VERTICES_MODE_TRIANGLE_FAN"
3044 glib:nick="triangle-fan"/>
3045 <member name="triangles"
3047 c:identifier="COGL_VERTICES_MODE_TRIANGLES"
3048 glib:nick="triangles"/>
3050 <function name="angle_cos" c:identifier="cogl_angle_cos" version="1.0">
3051 <doc xml:whitespace="preserve">Computes the cosine of @angle</doc>
3052 <return-value transfer-ownership="full">
3053 <doc xml:whitespace="preserve">the cosine of the passed angle</doc>
3054 <type name="Fixed" c:type="CoglFixed"/>
3057 <parameter name="angle" transfer-ownership="none">
3058 <doc xml:whitespace="preserve">an angle expressed using #CoglAngle</doc>
3059 <type name="Angle" c:type="CoglAngle"/>
3063 <function name="angle_sin" c:identifier="cogl_angle_sin" version="1.0">
3064 <doc xml:whitespace="preserve">Computes the sine of @angle</doc>
3065 <return-value transfer-ownership="full">
3066 <doc xml:whitespace="preserve">the sine of the passed angle</doc>
3067 <type name="Fixed" c:type="CoglFixed"/>
3070 <parameter name="angle" transfer-ownership="none">
3071 <doc xml:whitespace="preserve">an angle expressed using #CoglAngle</doc>
3072 <type name="Angle" c:type="CoglAngle"/>
3076 <function name="angle_tan" c:identifier="cogl_angle_tan" version="1.0">
3077 <doc xml:whitespace="preserve">Computes the tangent of @angle</doc>
3078 <return-value transfer-ownership="full">
3079 <doc xml:whitespace="preserve">the tangent of the passed angle</doc>
3080 <type name="Fixed" c:type="CoglFixed"/>
3083 <parameter name="angle" transfer-ownership="none">
3084 <doc xml:whitespace="preserve">an angle expressed using #CoglAngle</doc>
3085 <type name="Angle" c:type="CoglAngle"/>
3089 <function name="begin_gl" c:identifier="cogl_begin_gl" version="1.0">
3090 <doc xml:whitespace="preserve">We do not advise nor reliably support the interleaving of raw GL drawing and
3091 Cogl drawing functions, but if you insist, cogl_begin_gl() and cogl_end_gl()
3092 provide a simple mechanism that may at least give you a fighting chance of
3094 through the modification of GL state; that will never be reliably supported,
3095 but if you are trying to do something like:
3098 - setup some OpenGL state.
3099 - draw using OpenGL (e.g. glDrawArrays() )
3100 - reset modified OpenGL state.
3101 - continue using Cogl to draw
3104 You should surround blocks of drawing using raw GL with cogl_begin_gl()
3109 - setup some OpenGL state.
3110 - draw using OpenGL (e.g. glDrawArrays() )
3111 - reset modified OpenGL state.
3113 - continue using Cogl to draw
3116 Don't ever try and do:
3119 - setup some OpenGL state.
3121 - reset modified OpenGL state.
3124 When the internals of Cogl evolves, this is very liable to break.
3125 This function will flush all batched primitives, and subsequently flush
3126 all internal Cogl state to OpenGL as if it were going to draw something
3128 The result is that the OpenGL modelview matrix will be setup; the state
3129 corresponding to the current source material will be set up and other world
3130 state such as backface culling, depth and fogging enabledness will be sent
3132 <note>No special material state is flushed, so if you want Cogl to setup a
3133 simplified material state it is your responsibility to set a simple source
3134 material before calling cogl_begin_gl(). E.g. by calling
3135 cogl_set_source_color4ub().</note>
3136 <note>It is your responsibility to restore any OpenGL state that you modify
3137 to how it was after calling cogl_begin_gl() if you don't do this then the
3138 result of further Cogl calls is undefined.</note>
3139 <note>You can not nest begin/end blocks.</note>
3140 Again we would like to stress, we do not advise the use of this API and if
3141 possible we would prefer to improve Cogl than have developers require raw
3143 <return-value transfer-ownership="none">
3144 <type name="none" c:type="void"/>
3147 <function name="bitmap_get_size_from_file"
3148 c:identifier="cogl_bitmap_get_size_from_file"
3150 <doc xml:whitespace="preserve">Parses an image file enough to extract the width and height
3151 of the bitmap.</doc>
3152 <return-value transfer-ownership="none">
3153 <doc xml:whitespace="preserve">%TRUE if the image was successfully parsed</doc>
3154 <type name="boolean" c:type="gboolean"/>
3157 <parameter name="filename" transfer-ownership="none">
3158 <doc xml:whitespace="preserve">the file to check</doc>
3159 <type name="utf8" c:type="char*"/>
3161 <parameter name="width"
3163 caller-allocates="0"
3164 transfer-ownership="full">
3165 <doc xml:whitespace="preserve">return location for the bitmap width, or %NULL</doc>
3166 <type name="int" c:type="int*"/>
3168 <parameter name="height"
3170 caller-allocates="0"
3171 transfer-ownership="full">
3172 <doc xml:whitespace="preserve">return location for the bitmap height, or %NULL</doc>
3173 <type name="int" c:type="int*"/>
3177 <function name="check_extension"
3178 c:identifier="cogl_check_extension"
3179 deprecated="OpenGL is an implementation detail for Cogl and so it's"
3180 deprecated-version="1.2">
3181 <doc xml:whitespace="preserve">Check whether @name occurs in list of extensions in @ext.
3182 not appropriate to expose OpenGL extensions through the Cogl API. This
3183 function can be replaced by the following equivalent code:
3186 <return-value transfer-ownership="none">
3187 <doc xml:whitespace="preserve">%TRUE if the extension occurs in the list, %FALSE otherwise.</doc>
3188 <type name="boolean" c:type="gboolean"/>
3191 <parameter name="name" transfer-ownership="none">
3192 <doc xml:whitespace="preserve">extension to check for</doc>
3193 <type name="utf8" c:type="char*"/>
3195 <parameter name="ext" transfer-ownership="none">
3196 <doc xml:whitespace="preserve">list of extensions</doc>
3197 <type name="utf8" c:type="char*"/>
3201 <function name="clear" c:identifier="cogl_clear">
3202 <doc xml:whitespace="preserve">Clears all the auxiliary buffers identified in the @buffers mask, and if
3203 that includes the color buffer then the specified @color is used.</doc>
3204 <return-value transfer-ownership="none">
3205 <type name="none" c:type="void"/>
3208 <parameter name="color" transfer-ownership="none">
3209 <doc xml:whitespace="preserve">Background color to clear to</doc>
3210 <type name="Color" c:type="CoglColor*"/>
3212 <parameter name="buffers" transfer-ownership="none">
3213 <doc xml:whitespace="preserve">A mask of #CoglBufferBit<!-- -->'s identifying which auxiliary buffers to clear</doc>
3214 <type name="ulong" c:type="unsigned long"/>
3218 <function name="clip_ensure"
3219 c:identifier="cogl_clip_ensure"
3221 deprecated="Calling this function has no effect"
3222 deprecated-version="1.2">
3223 <doc xml:whitespace="preserve">Ensures that the current clipping region has been set in GL. This
3224 will automatically be called before any Cogl primitives but it
3225 maybe be neccessary to call if you are using raw GL calls with
3227 <return-value transfer-ownership="none">
3228 <type name="none" c:type="void"/>
3231 <function name="clip_pop" c:identifier="cogl_clip_pop">
3232 <doc xml:whitespace="preserve">Reverts the clipping region to the state before the last call to
3233 cogl_clip_push().</doc>
3234 <return-value transfer-ownership="none">
3235 <type name="none" c:type="void"/>
3238 <function name="clip_push"
3239 c:identifier="cogl_clip_push"
3240 deprecated="The x, y, width, height arguments are inconsistent"
3241 deprecated-version="1.2">
3242 <doc xml:whitespace="preserve">Specifies a rectangular clipping area for all subsequent drawing
3243 operations. Any drawing commands that extend outside the rectangle
3244 will be clipped so that only the portion inside the rectangle will
3245 be displayed. The rectangle dimensions are transformed by the
3246 current model-view matrix.
3247 The rectangle is intersected with the current clip region. To undo
3248 the effect of this function, call cogl_clip_pop().
3249 with other API that specify rectangles in model space, and when used
3250 with a coordinate space that puts the origin at the center and y+
3251 extending up, it's awkward to use. Please use cogl_clip_push_rectangle()
3253 <return-value transfer-ownership="none">
3254 <type name="none" c:type="void"/>
3257 <parameter name="x_offset" transfer-ownership="none">
3258 <doc xml:whitespace="preserve">left edge of the clip rectangle</doc>
3259 <type name="float" c:type="float"/>
3261 <parameter name="y_offset" transfer-ownership="none">
3262 <doc xml:whitespace="preserve">top edge of the clip rectangle</doc>
3263 <type name="float" c:type="float"/>
3265 <parameter name="width" transfer-ownership="none">
3266 <doc xml:whitespace="preserve">width of the clip rectangle</doc>
3267 <type name="float" c:type="float"/>
3269 <parameter name="height" transfer-ownership="none">
3270 <doc xml:whitespace="preserve">height of the clip rectangle</doc>
3271 <type name="float" c:type="float"/>
3275 <function name="clip_push_from_path"
3276 c:identifier="cogl_clip_push_from_path"
3278 <doc xml:whitespace="preserve">Sets a new clipping area using the current path. The current path
3279 is then cleared. The clipping area is intersected with the previous
3280 clipping area. To restore the previous clipping area, call
3281 cogl_clip_pop().</doc>
3282 <return-value transfer-ownership="none">
3283 <type name="none" c:type="void"/>
3286 <function name="clip_push_from_path_preserve"
3287 c:identifier="cogl_clip_push_from_path_preserve"
3289 <doc xml:whitespace="preserve">Sets a new clipping area using the current path. The current path
3290 is then cleared. The clipping area is intersected with the previous
3291 clipping area. To restore the previous clipping area, call
3292 cogl_clip_pop().</doc>
3293 <return-value transfer-ownership="none">
3294 <type name="none" c:type="void"/>
3297 <function name="clip_push_rectangle"
3298 c:identifier="cogl_clip_push_rectangle"
3300 <doc xml:whitespace="preserve">Specifies a rectangular clipping area for all subsequent drawing
3301 operations. Any drawing commands that extend outside the rectangle
3302 will be clipped so that only the portion inside the rectangle will
3303 be displayed. The rectangle dimensions are transformed by the
3304 current model-view matrix.
3305 The rectangle is intersected with the current clip region. To undo
3306 the effect of this function, call cogl_clip_pop().</doc>
3307 <return-value transfer-ownership="none">
3308 <type name="none" c:type="void"/>
3311 <parameter name="x0" transfer-ownership="none">
3312 <doc xml:whitespace="preserve">x coordinate for top left corner of the clip rectangle</doc>
3313 <type name="float" c:type="float"/>
3315 <parameter name="y0" transfer-ownership="none">
3316 <doc xml:whitespace="preserve">y coordinate for top left corner of the clip rectangle</doc>
3317 <type name="float" c:type="float"/>
3319 <parameter name="x1" transfer-ownership="none">
3320 <doc xml:whitespace="preserve">x coordinate for bottom right corner of the clip rectangle</doc>
3321 <type name="float" c:type="float"/>
3323 <parameter name="y1" transfer-ownership="none">
3324 <doc xml:whitespace="preserve">y coordinate for bottom right corner of the clip rectangle</doc>
3325 <type name="float" c:type="float"/>
3329 <function name="clip_push_window_rect"
3330 c:identifier="cogl_clip_push_window_rect"
3331 deprecated="Use cogl_clip_push_window_rectangle() instead"
3332 deprecated-version="1.2">
3333 <doc xml:whitespace="preserve">Specifies a rectangular clipping area for all subsequent drawing
3334 operations. Any drawing commands that extend outside the rectangle
3335 will be clipped so that only the portion inside the rectangle will
3336 be displayed. The rectangle dimensions are not transformed by the
3337 current model-view matrix.
3338 The rectangle is intersected with the current clip region. To undo
3339 the effect of this function, call cogl_clip_pop().</doc>
3340 <return-value transfer-ownership="none">
3341 <type name="none" c:type="void"/>
3344 <parameter name="x_offset" transfer-ownership="none">
3345 <doc xml:whitespace="preserve">left edge of the clip rectangle in window coordinates</doc>
3346 <type name="float" c:type="float"/>
3348 <parameter name="y_offset" transfer-ownership="none">
3349 <doc xml:whitespace="preserve">top edge of the clip rectangle in window coordinates</doc>
3350 <type name="float" c:type="float"/>
3352 <parameter name="width" transfer-ownership="none">
3353 <doc xml:whitespace="preserve">width of the clip rectangle</doc>
3354 <type name="float" c:type="float"/>
3356 <parameter name="height" transfer-ownership="none">
3357 <doc xml:whitespace="preserve">height of the clip rectangle</doc>
3358 <type name="float" c:type="float"/>
3362 <function name="clip_push_window_rectangle"
3363 c:identifier="cogl_clip_push_window_rectangle"
3365 <doc xml:whitespace="preserve">Specifies a rectangular clipping area for all subsequent drawing
3366 operations. Any drawing commands that extend outside the rectangle
3367 will be clipped so that only the portion inside the rectangle will
3368 be displayed. The rectangle dimensions are not transformed by the
3369 current model-view matrix.
3370 The rectangle is intersected with the current clip region. To undo
3371 the effect of this function, call cogl_clip_pop().</doc>
3372 <return-value transfer-ownership="none">
3373 <type name="none" c:type="void"/>
3376 <parameter name="x_offset" transfer-ownership="none">
3377 <doc xml:whitespace="preserve">left edge of the clip rectangle in window coordinates</doc>
3378 <type name="int" c:type="int"/>
3380 <parameter name="y_offset" transfer-ownership="none">
3381 <doc xml:whitespace="preserve">top edge of the clip rectangle in window coordinates</doc>
3382 <type name="int" c:type="int"/>
3384 <parameter name="width" transfer-ownership="none">
3385 <doc xml:whitespace="preserve">width of the clip rectangle</doc>
3386 <type name="int" c:type="int"/>
3388 <parameter name="height" transfer-ownership="none">
3389 <doc xml:whitespace="preserve">height of the clip rectangle</doc>
3390 <type name="int" c:type="int"/>
3394 <function name="clip_stack_restore"
3395 c:identifier="cogl_clip_stack_restore"
3397 deprecated="This was originally added to allow us to restore"
3398 deprecated-version="1.2">
3399 <doc xml:whitespace="preserve">Restore the state of the clipping stack that was previously saved
3400 by cogl_clip_stack_save().
3401 the clip stack when switching back from an offscreen framebuffer,
3402 but it's not necessary anymore given that framebuffers now own
3403 separate clip stacks which will be automatically switched between
3404 when a new buffer is set. Calling this function has no effect</doc>
3405 <return-value transfer-ownership="none">
3406 <type name="none" c:type="void"/>
3409 <function name="clip_stack_save"
3410 c:identifier="cogl_clip_stack_save"
3412 deprecated="This was originally added to allow us to save the"
3413 deprecated-version="1.2">
3414 <doc xml:whitespace="preserve">Save the entire state of the clipping stack and then clear all
3415 clipping. The previous state can be returned to with
3416 cogl_clip_stack_restore(). Each call to cogl_clip_push() after this
3417 must be matched by a call to cogl_clip_pop() before calling
3418 cogl_clip_stack_restore().
3419 clip stack when switching to an offscreen framebuffer, but it's
3420 not necessary anymore given that framebuffers now own separate
3421 clip stacks which will be automatically switched between when a
3422 new buffer is set. Calling this function has no effect</doc>
3423 <return-value transfer-ownership="none">
3424 <type name="none" c:type="void"/>
3427 <function name="color_equal" c:identifier="cogl_color_equal" version="1.0">
3428 <doc xml:whitespace="preserve">Compares two #CoglColor<!-- -->s and checks if they are the same.
3429 This function can be passed to g_hash_table_new() as the @key_equal_func
3430 parameter, when using #CoglColor<!-- -->s as keys in a #GHashTable.</doc>
3431 <return-value transfer-ownership="none">
3432 <doc xml:whitespace="preserve">%TRUE if the two colors are the same.</doc>
3433 <type name="boolean" c:type="gboolean"/>
3436 <parameter name="v1" transfer-ownership="none">
3437 <doc xml:whitespace="preserve">a #CoglColor</doc>
3438 <type name="any" c:type="gconstpointer"/>
3440 <parameter name="v2" transfer-ownership="none">
3441 <doc xml:whitespace="preserve">a #CoglColor</doc>
3442 <type name="any" c:type="gconstpointer"/>
3446 <function name="create_program" c:identifier="cogl_create_program">
3447 <doc xml:whitespace="preserve">Create a new cogl program object that can be used to replace parts of the GL
3448 rendering pipeline with custom code.</doc>
3449 <return-value transfer-ownership="full">
3450 <doc xml:whitespace="preserve">a new cogl program.</doc>
3451 <type name="Handle" c:type="CoglHandle"/>
3454 <function name="create_shader" c:identifier="cogl_create_shader">
3455 <doc xml:whitespace="preserve">Create a new shader handle, use #cogl_shader_source to set the source code
3456 to be used on it.</doc>
3457 <return-value transfer-ownership="full">
3458 <doc xml:whitespace="preserve">a new shader handle.</doc>
3459 <type name="Handle" c:type="CoglHandle"/>
3462 <parameter name="shader_type" transfer-ownership="none">
3463 <doc xml:whitespace="preserve">COGL_SHADER_TYPE_VERTEX or COGL_SHADER_TYPE_FRAGMENT.</doc>
3464 <type name="ShaderType" c:type="CoglShaderType"/>
3468 <function name="disable_fog" c:identifier="cogl_disable_fog">
3469 <doc xml:whitespace="preserve">This function disables fogging, so primitives drawn afterwards will not be
3470 blended with any previously set fog color.</doc>
3471 <return-value transfer-ownership="none">
3472 <type name="none" c:type="void"/>
3475 <function name="double_to_fixed" c:identifier="cogl_double_to_fixed">
3476 <return-value transfer-ownership="full">
3477 <type name="Fixed" c:type="CoglFixed"/>
3480 <parameter name="value" transfer-ownership="none">
3481 <type name="double" c:type="double"/>
3485 <function name="double_to_int" c:identifier="cogl_double_to_int">
3486 <return-value transfer-ownership="none">
3487 <type name="int" c:type="int"/>
3490 <parameter name="value" transfer-ownership="none">
3491 <type name="double" c:type="double"/>
3495 <function name="double_to_uint" c:identifier="cogl_double_to_uint">
3496 <return-value transfer-ownership="none">
3497 <type name="uint" c:type="unsigned int"/>
3500 <parameter name="value" transfer-ownership="none">
3501 <type name="double" c:type="double"/>
3505 <function name="end_gl" c:identifier="cogl_end_gl" version="1.0">
3506 <doc xml:whitespace="preserve">This is the counterpart to cogl_begin_gl() used to delimit blocks of drawing
3507 code using raw OpenGL. Please refer to cogl_begin_gl() for full details.</doc>
3508 <return-value transfer-ownership="none">
3509 <type name="none" c:type="void"/>
3512 <function name="features_available" c:identifier="cogl_features_available">
3513 <doc xml:whitespace="preserve">Checks whether the given COGL features are available. Multiple
3514 features can be checked for by or-ing them together with the '|'
3515 operator. %TRUE is only returned if all of the requested features
3516 are available.</doc>
3517 <return-value transfer-ownership="none">
3518 <doc xml:whitespace="preserve">%TRUE if the features are available, %FALSE otherwise.</doc>
3519 <type name="boolean" c:type="gboolean"/>
3522 <parameter name="features" transfer-ownership="none">
3523 <doc xml:whitespace="preserve">A bitmask of features to check for</doc>
3524 <type name="FeatureFlags" c:type="CoglFeatureFlags"/>
3528 <function name="fixed_atan" c:identifier="cogl_fixed_atan" version="1.0">
3529 <doc xml:whitespace="preserve">Computes the arc tangent of @a.</doc>
3530 <return-value transfer-ownership="full">
3531 <doc xml:whitespace="preserve">the arc tangent of the passed value, in fixed point notation</doc>
3532 <type name="Fixed" c:type="CoglFixed"/>
3535 <parameter name="a" transfer-ownership="none">
3536 <doc xml:whitespace="preserve">a #CoglFixed number</doc>
3537 <type name="Fixed" c:type="CoglFixed"/>
3541 <function name="fixed_atan2" c:identifier="cogl_fixed_atan2" version="1.0">
3542 <doc xml:whitespace="preserve">Computes the arc tangent of @a / @b but uses the sign of both
3543 arguments to return the angle in right quadrant.
3545 <return-value transfer-ownership="full">
3546 <doc xml:whitespace="preserve">the arc tangent of the passed fraction, in fixed point</doc>
3547 <type name="Fixed" c:type="CoglFixed"/>
3550 <parameter name="a" transfer-ownership="none">
3551 <doc xml:whitespace="preserve">the numerator as a #CoglFixed number</doc>
3552 <type name="Fixed" c:type="CoglFixed"/>
3554 <parameter name="b" transfer-ownership="none">
3555 <doc xml:whitespace="preserve">the denominator as a #CoglFixed number</doc>
3556 <type name="Fixed" c:type="CoglFixed"/>
3560 <function name="fixed_cos" c:identifier="cogl_fixed_cos" version="1.0">
3561 <doc xml:whitespace="preserve">Computes the cosine of @angle.</doc>
3562 <return-value transfer-ownership="full">
3563 <doc xml:whitespace="preserve">the cosine of the passed angle, in fixed point notation</doc>
3564 <type name="Fixed" c:type="CoglFixed"/>
3567 <parameter name="angle" transfer-ownership="none">
3568 <doc xml:whitespace="preserve">a #CoglFixed number</doc>
3569 <type name="Fixed" c:type="CoglFixed"/>
3573 <function name="fixed_div" c:identifier="cogl_fixed_div">
3574 <return-value transfer-ownership="full">
3575 <type name="Fixed" c:type="CoglFixed"/>
3578 <parameter name="a" transfer-ownership="none">
3579 <type name="Fixed" c:type="CoglFixed"/>
3581 <parameter name="b" transfer-ownership="none">
3582 <type name="Fixed" c:type="CoglFixed"/>
3586 <function name="fixed_log2" c:identifier="cogl_fixed_log2" version="1.0">
3587 <doc xml:whitespace="preserve">Calculates base 2 logarithm.
3588 This function is some 2.5 times faster on x86, and over 12 times faster on
3589 fpu-less arm, than using libc log().</doc>
3590 <return-value transfer-ownership="full">
3591 <doc xml:whitespace="preserve">base 2 logarithm.</doc>
3592 <type name="Fixed" c:type="CoglFixed"/>
3595 <parameter name="x" transfer-ownership="none">
3596 <doc xml:whitespace="preserve">value to calculate base 2 logarithm from</doc>
3597 <type name="uint" c:type="unsigned int"/>
3601 <function name="fixed_mul" c:identifier="cogl_fixed_mul">
3602 <return-value transfer-ownership="full">
3603 <type name="Fixed" c:type="CoglFixed"/>
3606 <parameter name="a" transfer-ownership="none">
3607 <type name="Fixed" c:type="CoglFixed"/>
3609 <parameter name="b" transfer-ownership="none">
3610 <type name="Fixed" c:type="CoglFixed"/>
3614 <function name="fixed_mul_div" c:identifier="cogl_fixed_mul_div">
3615 <return-value transfer-ownership="full">
3616 <type name="Fixed" c:type="CoglFixed"/>
3619 <parameter name="a" transfer-ownership="none">
3620 <type name="Fixed" c:type="CoglFixed"/>
3622 <parameter name="b" transfer-ownership="none">
3623 <type name="Fixed" c:type="CoglFixed"/>
3625 <parameter name="c" transfer-ownership="none">
3626 <type name="Fixed" c:type="CoglFixed"/>
3630 <function name="fixed_pow" c:identifier="cogl_fixed_pow" version="1.0">
3631 <doc xml:whitespace="preserve">Calculates @x to the @y power.</doc>
3632 <return-value transfer-ownership="none">
3633 <doc xml:whitespace="preserve">the power of @x to the @y</doc>
3634 <type name="uint" c:type="unsigned int"/>
3637 <parameter name="x" transfer-ownership="none">
3638 <doc xml:whitespace="preserve">base</doc>
3639 <type name="uint" c:type="unsigned int"/>
3641 <parameter name="y" transfer-ownership="none">
3642 <doc xml:whitespace="preserve">#CoglFixed exponent</doc>
3643 <type name="Fixed" c:type="CoglFixed"/>
3647 <function name="fixed_pow2" c:identifier="cogl_fixed_pow2" version="1.0">
3648 <doc xml:whitespace="preserve">Calculates 2 to the @x power.
3649 This function is around 11 times faster on x86, and around 22 times faster
3650 on fpu-less arm than libc pow(2, x).</doc>
3651 <return-value transfer-ownership="none">
3652 <doc xml:whitespace="preserve">the power of 2 to the passed value</doc>
3653 <type name="uint" c:type="unsigned int"/>
3656 <parameter name="x" transfer-ownership="none">
3657 <doc xml:whitespace="preserve">a #CoglFixed number</doc>
3658 <type name="Fixed" c:type="CoglFixed"/>
3662 <function name="fixed_sin" c:identifier="cogl_fixed_sin" version="1.0">
3663 <doc xml:whitespace="preserve">Computes the sine of @angle.</doc>
3664 <return-value transfer-ownership="full">
3665 <doc xml:whitespace="preserve">the sine of the passed angle, in fixed point notation</doc>
3666 <type name="Fixed" c:type="CoglFixed"/>
3669 <parameter name="angle" transfer-ownership="none">
3670 <doc xml:whitespace="preserve">a #CoglFixed number</doc>
3671 <type name="Fixed" c:type="CoglFixed"/>
3675 <function name="fixed_sqrt" c:identifier="cogl_fixed_sqrt" version="1.0">
3676 <doc xml:whitespace="preserve">Computes the square root of @x.
3678 <return-value transfer-ownership="full">
3679 <doc xml:whitespace="preserve">the square root of the passed value, in floating point</doc>
3680 <type name="Fixed" c:type="CoglFixed"/>
3683 <parameter name="x" transfer-ownership="none">
3684 <doc xml:whitespace="preserve">a #CoglFixed number</doc>
3685 <type name="Fixed" c:type="CoglFixed"/>
3689 <function name="fixed_tan" c:identifier="cogl_fixed_tan" version="1.0">
3690 <doc xml:whitespace="preserve">Computes the tangent of @angle.</doc>
3691 <return-value transfer-ownership="full">
3692 <doc xml:whitespace="preserve">the tangent of the passed angle, in fixed point notation</doc>
3693 <type name="Fixed" c:type="CoglFixed"/>
3696 <parameter name="angle" transfer-ownership="none">
3697 <doc xml:whitespace="preserve">a #CoglFixed number</doc>
3698 <type name="Fixed" c:type="CoglFixed"/>
3702 <function name="flush" c:identifier="cogl_flush" version="1.0">
3703 <doc xml:whitespace="preserve">This function should only need to be called in exceptional circumstances.
3704 As an optimization Cogl drawing functions may batch up primitives
3705 internally, so if you are trying to use raw GL outside of Cogl you stand a
3706 better chance of being successful if you ask Cogl to flush any batched
3707 geometry before making your state changes.
3708 It only ensure that the underlying driver is issued all the commands
3709 necessary to draw the batched primitives. It provides no guarantees about
3710 when the driver will complete the rendering.
3711 This provides no guarantees about the GL state upon returning and to avoid
3712 confusing Cogl you should aim to restore any changes you make before
3713 resuming use of Cogl.
3714 If you are making state changes with the intention of affecting Cogl drawing
3715 primitives you are 100% on your own since you stand a good chance of
3716 conflicting with Cogl internals. For example clutter-gst which currently
3717 uses direct GL calls to bind ARBfp programs will very likely break when Cogl
3718 starts to use ARBfb programs itself for the material API.</doc>
3719 <return-value transfer-ownership="none">
3720 <type name="none" c:type="void"/>
3723 <function name="frustum" c:identifier="cogl_frustum" version="0.8.2">
3724 <doc xml:whitespace="preserve">Replaces the current projection matrix with a perspective matrix
3725 for the given viewing frustum.</doc>
3726 <return-value transfer-ownership="none">
3727 <type name="none" c:type="void"/>
3730 <parameter name="left" transfer-ownership="none">
3731 <doc xml:whitespace="preserve">Left clipping plane</doc>
3732 <type name="float" c:type="float"/>
3734 <parameter name="right" transfer-ownership="none">
3735 <doc xml:whitespace="preserve">Right clipping plane</doc>
3736 <type name="float" c:type="float"/>
3738 <parameter name="bottom" transfer-ownership="none">
3739 <doc xml:whitespace="preserve">Bottom clipping plane</doc>
3740 <type name="float" c:type="float"/>
3742 <parameter name="top" transfer-ownership="none">
3743 <doc xml:whitespace="preserve">Top clipping plane</doc>
3744 <type name="float" c:type="float"/>
3746 <parameter name="z_near" transfer-ownership="none">
3747 <doc xml:whitespace="preserve">Nearest visible point</doc>
3748 <type name="float" c:type="float"/>
3750 <parameter name="z_far" transfer-ownership="none">
3751 <doc xml:whitespace="preserve">Furthest visible point along the z-axis</doc>
3752 <type name="float" c:type="float"/>
3756 <function name="get_backface_culling_enabled"
3757 c:identifier="cogl_get_backface_culling_enabled">
3758 <doc xml:whitespace="preserve">Queries if backface culling has been enabled via
3759 cogl_set_backface_culling_enabled()</doc>
3760 <return-value transfer-ownership="none">
3761 <doc xml:whitespace="preserve">%TRUE if backface culling is enabled, and %FALSE otherwise</doc>
3762 <type name="boolean" c:type="gboolean"/>
3765 <function name="get_bitmasks" c:identifier="cogl_get_bitmasks">
3766 <doc xml:whitespace="preserve">Gets the number of bitplanes used for each of the color components
3767 in the color buffer. Pass %NULL for any of the arguments if the
3768 value is not required.</doc>
3769 <return-value transfer-ownership="none">
3770 <type name="none" c:type="void"/>
3773 <parameter name="red"
3775 caller-allocates="0"
3776 transfer-ownership="full">
3777 <doc xml:whitespace="preserve">Return location for the number of red bits or %NULL</doc>
3778 <type name="int" c:type="int*"/>
3780 <parameter name="green"
3782 caller-allocates="0"
3783 transfer-ownership="full">
3784 <doc xml:whitespace="preserve">Return location for the number of green bits or %NULL</doc>
3785 <type name="int" c:type="int*"/>
3787 <parameter name="blue"
3789 caller-allocates="0"
3790 transfer-ownership="full">
3791 <doc xml:whitespace="preserve">Return location for the number of blue bits or %NULL</doc>
3792 <type name="int" c:type="int*"/>
3794 <parameter name="alpha"
3796 caller-allocates="0"
3797 transfer-ownership="full">
3798 <doc xml:whitespace="preserve">Return location for the number of alpha bits or %NULL</doc>
3799 <type name="int" c:type="int*"/>
3803 <function name="get_depth_test_enabled"
3804 c:identifier="cogl_get_depth_test_enabled"
3805 deprecated="Use cogl_material_get_depth_test_enabled()"
3806 deprecated-version="1.4">
3807 <doc xml:whitespace="preserve">Queries if depth testing has been enabled via cogl_set_depth_test_enable()
3809 <return-value transfer-ownership="none">
3810 <doc xml:whitespace="preserve">%TRUE if depth testing is enabled, and %FALSE otherwise</doc>
3811 <type name="boolean" c:type="gboolean"/>
3814 <function name="get_features"
3815 c:identifier="cogl_get_features"
3817 <doc xml:whitespace="preserve">Returns all of the features supported by COGL.</doc>
3818 <return-value transfer-ownership="full">
3819 <doc xml:whitespace="preserve">A logical OR of all the supported COGL features.</doc>
3820 <type name="FeatureFlags" c:type="CoglFeatureFlags"/>
3823 <function name="get_modelview_matrix"
3824 c:identifier="cogl_get_modelview_matrix">
3825 <doc xml:whitespace="preserve">Stores the current model-view matrix in @matrix.</doc>
3826 <return-value transfer-ownership="none">
3827 <type name="none" c:type="void"/>
3830 <parameter name="matrix"
3832 caller-allocates="1"
3833 transfer-ownership="none">
3834 <doc xml:whitespace="preserve">return location for the model-view matrix</doc>
3835 <type name="Matrix" c:type="CoglMatrix*"/>
3839 <function name="get_option_group"
3840 c:identifier="cogl_get_option_group"
3842 <doc xml:whitespace="preserve">Retrieves the #GOptionGroup used by COGL to parse the command
3843 line options. Clutter uses this to handle the COGL command line
3844 options during its initialization process.</doc>
3845 <return-value transfer-ownership="full">
3846 <doc xml:whitespace="preserve">a #GOptionGroup</doc>
3847 <type name="GLib.OptionGroup" c:type="GOptionGroup*"/>
3850 <function name="get_path" c:identifier="cogl_get_path" version="1.4">
3851 <doc xml:whitespace="preserve">Gets a pointer to the current path. The path can later be used
3852 again by calling cogl_path_set(). Note that the path isn't copied
3853 so if you later call any functions to add to the path it will
3854 affect the returned object too. No reference is taken on the path
3855 so if you want to retain it you should take your own reference with
3856 cogl_object_ref().</doc>
3857 <return-value transfer-ownership="full">
3858 <doc xml:whitespace="preserve">a pointer to the current path.</doc>
3859 <type name="Path" c:type="CoglPath*"/>
3862 <function name="get_proc_address" c:identifier="cogl_get_proc_address">
3863 <doc xml:whitespace="preserve">Gets a pointer to a given GL or GL ES extension function. This acts
3864 as a wrapper around glXGetProcAddress() or whatever is the
3865 appropriate function for the current backend.
3866 function is not available.</doc>
3867 <return-value transfer-ownership="full">
3868 <doc xml:whitespace="preserve">a pointer to the requested function or %NULL if the</doc>
3869 <type name="FuncPtr" c:type="CoglFuncPtr"/>
3872 <parameter name="name" transfer-ownership="none">
3873 <doc xml:whitespace="preserve">the name of the function.</doc>
3874 <type name="utf8" c:type="char*"/>
3878 <function name="get_projection_matrix"
3879 c:identifier="cogl_get_projection_matrix">
3880 <doc xml:whitespace="preserve">Stores the current projection matrix in @matrix.</doc>
3881 <return-value transfer-ownership="none">
3882 <type name="none" c:type="void"/>
3885 <parameter name="matrix"
3887 caller-allocates="1"
3888 transfer-ownership="none">
3889 <doc xml:whitespace="preserve">return location for the projection matrix</doc>
3890 <type name="Matrix" c:type="CoglMatrix*"/>
3894 <function name="get_viewport" c:identifier="cogl_get_viewport">
3895 <doc xml:whitespace="preserve">Stores the current viewport in @v. @v[0] and @v[1] get the x and y
3896 position of the viewport and @v[2] and @v[3] get the width and
3898 <return-value transfer-ownership="none">
3899 <type name="none" c:type="void"/>
3904 caller-allocates="0"
3905 transfer-ownership="full">
3906 <doc xml:whitespace="preserve">pointer to a 4 element array of #float<!-- -->s to receive the viewport dimensions.</doc>
3907 <array c:type="float" fixed-size="4">
3908 <type name="float"/>
3913 <function name="is_bitmap" c:identifier="cogl_is_bitmap" version="1.0">
3914 <doc xml:whitespace="preserve">Checks whether @handle is a #CoglHandle for a bitmap
3915 and %FALSE otherwise</doc>
3916 <return-value transfer-ownership="none">
3917 <doc xml:whitespace="preserve">%TRUE if the passed handle represents a bitmap,</doc>
3918 <type name="boolean" c:type="gboolean"/>
3921 <parameter name="handle" transfer-ownership="none">
3922 <doc xml:whitespace="preserve">a #CoglHandle for a bitmap</doc>
3923 <type name="Handle" c:type="CoglHandle"/>
3927 <function name="is_buffer_EXP" c:identifier="cogl_is_buffer_EXP">
3928 <return-value transfer-ownership="none">
3929 <type name="boolean" c:type="gboolean"/>
3932 <parameter name="object" transfer-ownership="none">
3933 <type name="any" c:type="void*"/>
3937 <function name="is_material" c:identifier="cogl_is_material">
3938 <doc xml:whitespace="preserve">Gets whether the given handle references an existing material object.
3939 %FALSE otherwise</doc>
3940 <return-value transfer-ownership="none">
3941 <doc xml:whitespace="preserve">%TRUE if the handle references a #CoglMaterial,</doc>
3942 <type name="boolean" c:type="gboolean"/>
3945 <parameter name="handle" transfer-ownership="none">
3946 <doc xml:whitespace="preserve">A CoglHandle</doc>
3947 <type name="Handle" c:type="CoglHandle"/>
3951 <function name="is_offscreen" c:identifier="cogl_is_offscreen">
3952 <doc xml:whitespace="preserve">Determines whether the given #CoglHandle references an offscreen buffer
3954 %FALSE otherwise</doc>
3955 <return-value transfer-ownership="none">
3956 <doc xml:whitespace="preserve">%TRUE if the handle references an offscreen buffer,</doc>
3957 <type name="boolean" c:type="gboolean"/>
3960 <parameter name="handle" transfer-ownership="none">
3961 <doc xml:whitespace="preserve">A CoglHandle for an offscreen buffer</doc>
3962 <type name="Handle" c:type="CoglHandle"/>
3966 <function name="is_path" c:identifier="cogl_is_path">
3967 <doc xml:whitespace="preserve">Gets whether the given handle references an existing path object.
3968 %FALSE otherwise</doc>
3969 <return-value transfer-ownership="none">
3970 <doc xml:whitespace="preserve">%TRUE if the handle references a #CoglPath,</doc>
3971 <type name="boolean" c:type="gboolean"/>
3974 <parameter name="handle" transfer-ownership="none">
3975 <doc xml:whitespace="preserve">A CoglHandle</doc>
3976 <type name="Handle" c:type="CoglHandle"/>
3980 <function name="is_pixel_array_EXP" c:identifier="cogl_is_pixel_array_EXP">
3981 <return-value transfer-ownership="none">
3982 <type name="boolean" c:type="gboolean"/>
3985 <parameter name="object" transfer-ownership="none">
3986 <type name="any" c:type="void*"/>
3990 <function name="is_program" c:identifier="cogl_is_program">
3991 <doc xml:whitespace="preserve">Gets whether the given handle references an existing program object.
3992 %FALSE otherwise</doc>
3993 <return-value transfer-ownership="none">
3994 <doc xml:whitespace="preserve">%TRUE if the handle references a program,</doc>
3995 <type name="boolean" c:type="gboolean"/>
3998 <parameter name="handle" transfer-ownership="none">
3999 <doc xml:whitespace="preserve">A CoglHandle</doc>
4000 <type name="Handle" c:type="CoglHandle"/>
4004 <function name="is_shader" c:identifier="cogl_is_shader">
4005 <doc xml:whitespace="preserve">Gets whether the given handle references an existing shader object.
4006 %FALSE otherwise</doc>
4007 <return-value transfer-ownership="none">
4008 <doc xml:whitespace="preserve">%TRUE if the handle references a shader,</doc>
4009 <type name="boolean" c:type="gboolean"/>
4012 <parameter name="handle" transfer-ownership="none">
4013 <doc xml:whitespace="preserve">A CoglHandle</doc>
4014 <type name="Handle" c:type="CoglHandle"/>
4018 <function name="is_texture" c:identifier="cogl_is_texture">
4019 <doc xml:whitespace="preserve">Gets whether the given handle references an existing texture object.
4020 %FALSE otherwise</doc>
4021 <return-value transfer-ownership="none">
4022 <doc xml:whitespace="preserve">%TRUE if the handle references a texture, and</doc>
4023 <type name="boolean" c:type="gboolean"/>
4026 <parameter name="handle" transfer-ownership="none">
4027 <doc xml:whitespace="preserve">A CoglHandle</doc>
4028 <type name="Handle" c:type="CoglHandle"/>
4032 <function name="is_texture_3d_EXP" c:identifier="cogl_is_texture_3d_EXP">
4033 <return-value transfer-ownership="none">
4034 <type name="boolean" c:type="gboolean"/>
4037 <parameter name="handle" transfer-ownership="none">
4038 <type name="Handle" c:type="CoglHandle"/>
4042 <function name="is_texture_pixmap_x11_EXP"
4043 c:identifier="cogl_is_texture_pixmap_x11_EXP">
4044 <return-value transfer-ownership="none">
4045 <type name="boolean" c:type="gboolean"/>
4048 <parameter name="handle" transfer-ownership="none">
4049 <type name="Handle" c:type="CoglHandle"/>
4053 <function name="is_vertex_buffer"
4054 c:identifier="cogl_is_vertex_buffer"
4056 <doc xml:whitespace="preserve">Checks whether @handle is a Vertex Buffer Object
4058 <return-value transfer-ownership="none">
4059 <doc xml:whitespace="preserve">%TRUE if the handle is a VBO, and %FALSE</doc>
4060 <type name="boolean" c:type="gboolean"/>
4063 <parameter name="handle" transfer-ownership="none">
4064 <doc xml:whitespace="preserve">a #CoglHandle for a vertex buffer object</doc>
4065 <type name="Handle" c:type="CoglHandle"/>
4069 <function name="is_vertex_buffer_indices"
4070 c:identifier="cogl_is_vertex_buffer_indices"
4072 <doc xml:whitespace="preserve">Checks whether @handle is a handle to the indices for a vertex
4075 <return-value transfer-ownership="none">
4076 <doc xml:whitespace="preserve">%TRUE if the handle is indices, and %FALSE</doc>
4077 <type name="boolean" c:type="gboolean"/>
4080 <parameter name="handle" transfer-ownership="none">
4081 <doc xml:whitespace="preserve">a #CoglHandle</doc>
4082 <type name="Handle" c:type="CoglHandle"/>
4086 <function name="material_get_point_size"
4087 c:identifier="cogl_material_get_point_size"
4089 <doc xml:whitespace="preserve">Get the size of points drawn when %COGL_VERTICES_MODE_POINTS is
4090 used with the vertex buffer API.</doc>
4091 <return-value transfer-ownership="none">
4092 <doc xml:whitespace="preserve">the point size of the material.</doc>
4093 <type name="float" c:type="float"/>
4096 <parameter name="material" transfer-ownership="none">
4097 <doc xml:whitespace="preserve">a #CoglHandle to a material.</doc>
4098 <type name="Handle" c:type="CoglHandle"/>
4102 <function name="material_layer_get_type"
4103 c:identifier="cogl_material_layer_get_type">
4104 <doc xml:whitespace="preserve">Retrieves the type of the layer
4105 Currently there is only one type of layer defined:
4106 %COGL_MATERIAL_LAYER_TYPE_TEXTURE, but considering we may add purely GLSL
4107 based layers in the future, you should write code that checks the type
4109 <return-value transfer-ownership="full">
4110 <doc xml:whitespace="preserve">the type of the layer</doc>
4111 <type name="MaterialLayerType" c:type="CoglMaterialLayerType"/>
4114 <parameter name="layer" transfer-ownership="none">
4115 <doc xml:whitespace="preserve">A #CoglMaterialLayer object</doc>
4116 <type name="MaterialLayer" c:type="CoglMaterialLayer*"/>
4120 <function name="material_ref"
4121 c:identifier="cogl_material_ref"
4123 deprecated="Use cogl_object_ref() instead"
4124 deprecated-version="1.2">
4125 <doc xml:whitespace="preserve">Increment the reference count for a #CoglMaterial.</doc>
4126 <return-value transfer-ownership="full">
4127 <doc xml:whitespace="preserve">the @material.</doc>
4128 <type name="Handle" c:type="CoglHandle"/>
4131 <parameter name="handle" transfer-ownership="none">
4132 <type name="Handle" c:type="CoglHandle"/>
4136 <function name="material_set_point_size"
4137 c:identifier="cogl_material_set_point_size"
4139 <doc xml:whitespace="preserve">Changes the size of points drawn when %COGL_VERTICES_MODE_POINTS is
4140 used with the vertex buffer API. Note that typically the GPU will
4141 only support a limited minimum and maximum range of point sizes. If
4142 the chosen point size is outside that range then the nearest value
4143 within that range will be used instead. The size of a point is in
4144 screen space so it will be the same regardless of any
4145 transformations. The default point size is 1.0.</doc>
4146 <return-value transfer-ownership="none">
4147 <type name="none" c:type="void"/>
4150 <parameter name="material" transfer-ownership="none">
4151 <doc xml:whitespace="preserve">a #CoglHandle to a material.</doc>
4152 <type name="Handle" c:type="CoglHandle"/>
4154 <parameter name="point_size" transfer-ownership="none">
4155 <type name="float" c:type="float"/>
4159 <function name="material_unref"
4160 c:identifier="cogl_material_unref"
4162 deprecated="Use cogl_object_unref() instead"
4163 deprecated-version="1.2">
4164 <doc xml:whitespace="preserve">Decrement the reference count for a #CoglMaterial.</doc>
4165 <return-value transfer-ownership="none">
4166 <type name="none" c:type="void"/>
4169 <parameter name="handle" transfer-ownership="none">
4170 <type name="Handle" c:type="CoglHandle"/>
4174 <function name="matrix_equal"
4175 c:identifier="cogl_matrix_equal"
4177 <doc xml:whitespace="preserve">Compares two matrices to see if they represent the same
4178 transformation. Although internally the matrices may have different
4179 annotations associated with them and may potentially have a cached
4180 inverse matrix these are not considered in the comparison.</doc>
4181 <return-value transfer-ownership="none">
4182 <type name="boolean" c:type="gboolean"/>
4185 <parameter name="v1" transfer-ownership="none">
4186 <doc xml:whitespace="preserve">A 4x4 transformation matrix</doc>
4187 <type name="any" c:type="gconstpointer"/>
4189 <parameter name="v2" transfer-ownership="none">
4190 <doc xml:whitespace="preserve">A 4x4 transformation matrix</doc>
4191 <type name="any" c:type="gconstpointer"/>
4195 <function name="object_ref" c:identifier="cogl_object_ref">
4196 <doc xml:whitespace="preserve">Increases the reference count of @handle by 1</doc>
4197 <return-value transfer-ownership="none">
4198 <doc xml:whitespace="preserve">the @object, with its reference count increased</doc>
4199 <type name="any" c:type="void*"/>
4202 <parameter name="object" transfer-ownership="none">
4203 <doc xml:whitespace="preserve">a #CoglObject</doc>
4204 <type name="any" c:type="void*"/>
4208 <function name="object_unref" c:identifier="cogl_object_unref">
4209 <doc xml:whitespace="preserve">Drecreases the reference count of @object by 1; if the reference
4210 count reaches 0, the resources allocated by @object will be freed</doc>
4211 <return-value transfer-ownership="none">
4212 <type name="none" c:type="void"/>
4215 <parameter name="object" transfer-ownership="none">
4216 <doc xml:whitespace="preserve">a #CoglObject</doc>
4217 <type name="any" c:type="void*"/>
4221 <function name="offscreen_new_to_texture"
4222 c:identifier="cogl_offscreen_new_to_texture">
4223 <doc xml:whitespace="preserve">This creates an offscreen buffer object using the given texture as the
4224 primary color buffer. It doesn't just initialize the contents of the
4225 offscreen buffer with the texture; they are tightly bound so that
4226 drawing to the offscreen buffer effectivly updates the contents of the
4227 given texture. You don't need to destroy the offscreen buffer before
4228 you can use the texture again.
4229 if it wasn't possible to create the buffer.</doc>
4230 <return-value transfer-ownership="full">
4231 <doc xml:whitespace="preserve">a #CoglHandle for the new offscreen buffer or %COGL_INVALID_HANDLE</doc>
4232 <type name="Handle" c:type="CoglHandle"/>
4235 <parameter name="handle" transfer-ownership="none">
4236 <doc xml:whitespace="preserve">A CoglHandle for a Cogl texture</doc>
4237 <type name="Handle" c:type="CoglHandle"/>
4241 <function name="offscreen_ref"
4242 c:identifier="cogl_offscreen_ref"
4243 deprecated="cogl_handle_ref should be used in new code."
4244 deprecated-version="1.2">
4245 <doc xml:whitespace="preserve">Increments the reference count on the offscreen buffer.</doc>
4246 <return-value transfer-ownership="full">
4247 <doc xml:whitespace="preserve">For convenience it returns the given CoglHandle</doc>
4248 <type name="Handle" c:type="CoglHandle"/>
4251 <parameter name="handle" transfer-ownership="none">
4252 <doc xml:whitespace="preserve">A CoglHandle for an offscreen buffer</doc>
4253 <type name="Handle" c:type="CoglHandle"/>
4257 <function name="offscreen_unref"
4258 c:identifier="cogl_offscreen_unref"
4259 deprecated="cogl_handle_unref should be used in new code."
4260 deprecated-version="1.2">
4261 <doc xml:whitespace="preserve">Decreases the reference count for the offscreen buffer and frees it when
4262 the count reaches 0.</doc>
4263 <return-value transfer-ownership="none">
4264 <type name="none" c:type="void"/>
4267 <parameter name="handle" transfer-ownership="none">
4268 <doc xml:whitespace="preserve">A CoglHandle for an offscreen buffer</doc>
4269 <type name="Handle" c:type="CoglHandle"/>
4273 <function name="ortho" c:identifier="cogl_ortho" version="1.0">
4274 <doc xml:whitespace="preserve">Replaces the current projection matrix with an orthographic projection
4275 matrix. See <xref linkend="cogl-ortho-matrix"/> to see how the matrix is
4277 <figure id="cogl-ortho-matrix">
4278 <title></title>
4279 <graphic fileref="cogl_ortho.png" format="PNG"/>
4281 <note>This function copies the arguments from OpenGL's glOrtho() even
4282 though they are unnecessarily confusing due to the z near and z far
4283 arguments actually being a "distance" from the origin, where
4284 negative values are behind the viewer, instead of coordinates for
4285 the z clipping planes which would have been consistent with the
4286 left, right bottom and top arguments.</note></doc>
4287 <return-value transfer-ownership="none">
4288 <type name="none" c:type="void"/>
4291 <parameter name="left" transfer-ownership="none">
4292 <doc xml:whitespace="preserve">The coordinate for the left clipping plane</doc>
4293 <type name="float" c:type="float"/>
4295 <parameter name="right" transfer-ownership="none">
4296 <doc xml:whitespace="preserve">The coordinate for the right clipping plane</doc>
4297 <type name="float" c:type="float"/>
4299 <parameter name="bottom" transfer-ownership="none">
4300 <doc xml:whitespace="preserve">The coordinate for the bottom clipping plane</doc>
4301 <type name="float" c:type="float"/>
4303 <parameter name="top" transfer-ownership="none">
4304 <doc xml:whitespace="preserve">The coordinate for the top clipping plane</doc>
4305 <type name="float" c:type="float"/>
4307 <parameter name="near" transfer-ownership="none">
4308 <doc xml:whitespace="preserve">The <emphasis>distance</emphasis> to the near clipping plane (negative if the plane is behind the viewer)</doc>
4309 <type name="float" c:type="float"/>
4311 <parameter name="far" transfer-ownership="none">
4312 <doc xml:whitespace="preserve">The <emphasis>distance</emphasis> for the far clipping plane (negative if the plane is behind the viewer)</doc>
4313 <type name="float" c:type="float"/>
4317 <function name="path_arc" c:identifier="cogl_path_arc">
4318 <doc xml:whitespace="preserve">Adds an elliptical arc segment to the current path. A straight line
4319 segment will link the current pen location with the first vertex
4320 of the arc. If you perform a move_to to the arcs start just before
4321 drawing it you create a free standing arc.
4322 The angles are measured in degrees where 0° is in the direction of
4323 the positive X axis and 90° is in the direction of the positive Y
4324 axis. The angle of the arc begins at @angle_1 and heads towards
4325 otherwise it will increase).</doc>
4326 <return-value transfer-ownership="none">
4327 <type name="none" c:type="void"/>
4330 <parameter name="center_x" transfer-ownership="none">
4331 <doc xml:whitespace="preserve">X coordinate of the elliptical arc center</doc>
4332 <type name="float" c:type="float"/>
4334 <parameter name="center_y" transfer-ownership="none">
4335 <doc xml:whitespace="preserve">Y coordinate of the elliptical arc center</doc>
4336 <type name="float" c:type="float"/>
4338 <parameter name="radius_x" transfer-ownership="none">
4339 <doc xml:whitespace="preserve">X radius of the elliptical arc</doc>
4340 <type name="float" c:type="float"/>
4342 <parameter name="radius_y" transfer-ownership="none">
4343 <doc xml:whitespace="preserve">Y radius of the elliptical arc</doc>
4344 <type name="float" c:type="float"/>
4346 <parameter name="angle_1" transfer-ownership="none">
4347 <doc xml:whitespace="preserve">Angle in degrees at which the arc begin</doc>
4348 <type name="float" c:type="float"/>
4350 <parameter name="angle_2" transfer-ownership="none">
4351 <doc xml:whitespace="preserve">Angle in degrees at which the arc ends</doc>
4352 <type name="float" c:type="float"/>
4356 <function name="path_close" c:identifier="cogl_path_close">
4357 <doc xml:whitespace="preserve">Closes the path being constructed by adding a straight line segment
4358 to it that ends at the first vertex of the path.</doc>
4359 <return-value transfer-ownership="none">
4360 <type name="none" c:type="void"/>
4363 <function name="path_curve_to" c:identifier="cogl_path_curve_to">
4364 <doc xml:whitespace="preserve">Adds a cubic bezier curve segment to the current path with the given
4365 second, third and fourth control points and using current pen location
4366 as the first control point.</doc>
4367 <return-value transfer-ownership="none">
4368 <type name="none" c:type="void"/>
4371 <parameter name="x_1" transfer-ownership="none">
4372 <doc xml:whitespace="preserve">X coordinate of the second bezier control point</doc>
4373 <type name="float" c:type="float"/>
4375 <parameter name="y_1" transfer-ownership="none">
4376 <doc xml:whitespace="preserve">Y coordinate of the second bezier control point</doc>
4377 <type name="float" c:type="float"/>
4379 <parameter name="x_2" transfer-ownership="none">
4380 <doc xml:whitespace="preserve">X coordinate of the third bezier control point</doc>
4381 <type name="float" c:type="float"/>
4383 <parameter name="y_2" transfer-ownership="none">
4384 <doc xml:whitespace="preserve">Y coordinate of the third bezier control point</doc>
4385 <type name="float" c:type="float"/>
4387 <parameter name="x_3" transfer-ownership="none">
4388 <doc xml:whitespace="preserve">X coordinate of the fourth bezier control point</doc>
4389 <type name="float" c:type="float"/>
4391 <parameter name="y_3" transfer-ownership="none">
4392 <doc xml:whitespace="preserve">Y coordinate of the fourth bezier control point</doc>
4393 <type name="float" c:type="float"/>
4397 <function name="path_ellipse" c:identifier="cogl_path_ellipse">
4398 <doc xml:whitespace="preserve">Constructs an ellipse shape. If there is an existing path this will
4399 start a new disjoint sub-path.</doc>
4400 <return-value transfer-ownership="none">
4401 <type name="none" c:type="void"/>
4404 <parameter name="center_x" transfer-ownership="none">
4405 <doc xml:whitespace="preserve">X coordinate of the ellipse center</doc>
4406 <type name="float" c:type="float"/>
4408 <parameter name="center_y" transfer-ownership="none">
4409 <doc xml:whitespace="preserve">Y coordinate of the ellipse center</doc>
4410 <type name="float" c:type="float"/>
4412 <parameter name="radius_x" transfer-ownership="none">
4413 <doc xml:whitespace="preserve">X radius of the ellipse</doc>
4414 <type name="float" c:type="float"/>
4416 <parameter name="radius_y" transfer-ownership="none">
4417 <doc xml:whitespace="preserve">Y radius of the ellipse</doc>
4418 <type name="float" c:type="float"/>
4422 <function name="path_fill" c:identifier="cogl_path_fill">
4423 <doc xml:whitespace="preserve">Fills the interior of the constructed shape using the current
4424 drawing color. The current path is then cleared. To use the path
4425 again, call cogl_path_fill_preserve() instead.
4426 The interior of the shape is determined using the fill rule of the
4427 path. See %CoglPathFillRule for details.</doc>
4428 <return-value transfer-ownership="none">
4429 <type name="none" c:type="void"/>
4432 <function name="path_fill_preserve"
4433 c:identifier="cogl_path_fill_preserve"
4435 <doc xml:whitespace="preserve">Fills the interior of the constructed shape using the current
4436 drawing color and preserves the path to be used again. See
4437 cogl_path_fill() for a description what is considered the interior
4439 <return-value transfer-ownership="none">
4440 <type name="none" c:type="void"/>
4443 <function name="path_get_fill_rule"
4444 c:identifier="cogl_path_get_fill_rule"
4446 <return-value transfer-ownership="full">
4447 <doc xml:whitespace="preserve">the fill rule that is used for the current path.</doc>
4448 <type name="PathFillRule" c:type="CoglPathFillRule"/>
4451 <function name="path_line" c:identifier="cogl_path_line">
4452 <doc xml:whitespace="preserve">Constructs a straight line shape starting and ending at the given
4453 coordinates. If there is an existing path this will start a new
4454 disjoint sub-path.</doc>
4455 <return-value transfer-ownership="none">
4456 <type name="none" c:type="void"/>
4459 <parameter name="x_1" transfer-ownership="none">
4460 <doc xml:whitespace="preserve">X coordinate of the start line vertex</doc>
4461 <type name="float" c:type="float"/>
4463 <parameter name="y_1" transfer-ownership="none">
4464 <doc xml:whitespace="preserve">Y coordinate of the start line vertex</doc>
4465 <type name="float" c:type="float"/>
4467 <parameter name="x_2" transfer-ownership="none">
4468 <doc xml:whitespace="preserve">X coordinate of the end line vertex</doc>
4469 <type name="float" c:type="float"/>
4471 <parameter name="y_2" transfer-ownership="none">
4472 <doc xml:whitespace="preserve">Y coordinate of the end line vertex</doc>
4473 <type name="float" c:type="float"/>
4477 <function name="path_line_to" c:identifier="cogl_path_line_to">
4478 <doc xml:whitespace="preserve">Adds a straight line segment to the current path that ends at the
4479 given coordinates.</doc>
4480 <return-value transfer-ownership="none">
4481 <type name="none" c:type="void"/>
4484 <parameter name="x" transfer-ownership="none">
4485 <doc xml:whitespace="preserve">X coordinate of the end line vertex</doc>
4486 <type name="float" c:type="float"/>
4488 <parameter name="y" transfer-ownership="none">
4489 <doc xml:whitespace="preserve">Y coordinate of the end line vertex</doc>
4490 <type name="float" c:type="float"/>
4494 <function name="path_move_to" c:identifier="cogl_path_move_to">
4495 <doc xml:whitespace="preserve">Moves the pen to the given location. If there is an existing path
4496 this will start a new disjoint subpath.</doc>
4497 <return-value transfer-ownership="none">
4498 <type name="none" c:type="void"/>
4501 <parameter name="x" transfer-ownership="none">
4502 <doc xml:whitespace="preserve">X coordinate of the pen location to move to.</doc>
4503 <type name="float" c:type="float"/>
4505 <parameter name="y" transfer-ownership="none">
4506 <doc xml:whitespace="preserve">Y coordinate of the pen location to move to.</doc>
4507 <type name="float" c:type="float"/>
4511 <function name="path_new" c:identifier="cogl_path_new" version="1.0">
4512 <doc xml:whitespace="preserve">Clears the current path and starts a new one. Creating a new path
4513 also resets the fill rule to the default which is
4514 %COGL_PATH_FILL_RULE_EVEN_ODD.</doc>
4515 <return-value transfer-ownership="none">
4516 <type name="none" c:type="void"/>
4519 <function name="path_polygon" c:identifier="cogl_path_polygon">
4520 <doc xml:whitespace="preserve">Constructs a polygonal shape of the given number of vertices. If
4521 there is an existing path this will start a new disjoint sub-path.
4522 The coords array must contain 2 * num_points values. The first value
4523 represents the X coordinate of the first vertex, the second value
4524 represents the Y coordinate of the first vertex, continuing in the same
4525 fashion for the rest of the vertices.</doc>
4526 <return-value transfer-ownership="none">
4527 <type name="none" c:type="void"/>
4530 <parameter name="coords" transfer-ownership="none">
4531 <doc xml:whitespace="preserve">A pointer to the first element of an array of fixed-point values that specify the vertex coordinates.</doc>
4532 <array c:type="float*">
4533 <type name="float"/>
4536 <parameter name="num_points" transfer-ownership="none">
4537 <doc xml:whitespace="preserve">The total number of vertices.</doc>
4538 <type name="int" c:type="int"/>
4542 <function name="path_polyline" c:identifier="cogl_path_polyline">
4543 <doc xml:whitespace="preserve">Constructs a series of straight line segments, starting from the
4544 first given vertex coordinate. If there is an existing path this
4545 will start a new disjoint sub-path. Each subsequent segment starts
4546 where the previous one ended and ends at the next given vertex
4548 The coords array must contain 2 * num_points values. The first value
4549 represents the X coordinate of the first vertex, the second value
4550 represents the Y coordinate of the first vertex, continuing in the same
4551 fashion for the rest of the vertices. (num_points - 1) segments will
4552 be constructed.</doc>
4553 <return-value transfer-ownership="none">
4554 <type name="none" c:type="void"/>
4557 <parameter name="coords" transfer-ownership="none">
4558 <doc xml:whitespace="preserve">A pointer to the first element of an array of fixed-point values that specify the vertex coordinates.</doc>
4559 <array c:type="float*">
4560 <type name="float"/>
4563 <parameter name="num_points" transfer-ownership="none">
4564 <doc xml:whitespace="preserve">The total number of vertices.</doc>
4565 <type name="int" c:type="int"/>
4569 <function name="path_rectangle" c:identifier="cogl_path_rectangle">
4570 <doc xml:whitespace="preserve">Constructs a rectangular shape at the given coordinates. If there
4571 is an existing path this will start a new disjoint sub-path.</doc>
4572 <return-value transfer-ownership="none">
4573 <type name="none" c:type="void"/>
4576 <parameter name="x_1" transfer-ownership="none">
4577 <doc xml:whitespace="preserve">X coordinate of the top-left corner.</doc>
4578 <type name="float" c:type="float"/>
4580 <parameter name="y_1" transfer-ownership="none">
4581 <doc xml:whitespace="preserve">Y coordinate of the top-left corner.</doc>
4582 <type name="float" c:type="float"/>
4584 <parameter name="x_2" transfer-ownership="none">
4585 <doc xml:whitespace="preserve">X coordinate of the bottom-right corner.</doc>
4586 <type name="float" c:type="float"/>
4588 <parameter name="y_2" transfer-ownership="none">
4589 <doc xml:whitespace="preserve">Y coordinate of the bottom-right corner.</doc>
4590 <type name="float" c:type="float"/>
4594 <function name="path_rel_curve_to" c:identifier="cogl_path_rel_curve_to">
4595 <doc xml:whitespace="preserve">Adds a cubic bezier curve segment to the current path with the given
4596 second, third and fourth control points and using current pen location
4597 as the first control point. The given coordinates are relative to the
4598 current pen location.</doc>
4599 <return-value transfer-ownership="none">
4600 <type name="none" c:type="void"/>
4603 <parameter name="x_1" transfer-ownership="none">
4604 <doc xml:whitespace="preserve">X coordinate of the second bezier control point</doc>
4605 <type name="float" c:type="float"/>
4607 <parameter name="y_1" transfer-ownership="none">
4608 <doc xml:whitespace="preserve">Y coordinate of the second bezier control point</doc>
4609 <type name="float" c:type="float"/>
4611 <parameter name="x_2" transfer-ownership="none">
4612 <doc xml:whitespace="preserve">X coordinate of the third bezier control point</doc>
4613 <type name="float" c:type="float"/>
4615 <parameter name="y_2" transfer-ownership="none">
4616 <doc xml:whitespace="preserve">Y coordinate of the third bezier control point</doc>
4617 <type name="float" c:type="float"/>
4619 <parameter name="x_3" transfer-ownership="none">
4620 <doc xml:whitespace="preserve">X coordinate of the fourth bezier control point</doc>
4621 <type name="float" c:type="float"/>
4623 <parameter name="y_3" transfer-ownership="none">
4624 <doc xml:whitespace="preserve">Y coordinate of the fourth bezier control point</doc>
4625 <type name="float" c:type="float"/>
4629 <function name="path_rel_line_to" c:identifier="cogl_path_rel_line_to">
4630 <doc xml:whitespace="preserve">Adds a straight line segment to the current path that ends at the
4631 given coordinates relative to the current pen location.</doc>
4632 <return-value transfer-ownership="none">
4633 <type name="none" c:type="void"/>
4636 <parameter name="x" transfer-ownership="none">
4637 <doc xml:whitespace="preserve">X offset from the current pen location of the end line vertex</doc>
4638 <type name="float" c:type="float"/>
4640 <parameter name="y" transfer-ownership="none">
4641 <doc xml:whitespace="preserve">Y offset from the current pen location of the end line vertex</doc>
4642 <type name="float" c:type="float"/>
4646 <function name="path_rel_move_to" c:identifier="cogl_path_rel_move_to">
4647 <doc xml:whitespace="preserve">Moves the pen to the given offset relative to the current pen
4648 location. If there is an existing path this will start a new
4649 disjoint subpath.</doc>
4650 <return-value transfer-ownership="none">
4651 <type name="none" c:type="void"/>
4654 <parameter name="x" transfer-ownership="none">
4655 <doc xml:whitespace="preserve">X offset from the current pen location to move the pen to.</doc>
4656 <type name="float" c:type="float"/>
4658 <parameter name="y" transfer-ownership="none">
4659 <doc xml:whitespace="preserve">Y offset from the current pen location to move the pen to.</doc>
4660 <type name="float" c:type="float"/>
4664 <function name="path_round_rectangle"
4665 c:identifier="cogl_path_round_rectangle">
4666 <doc xml:whitespace="preserve">Constructs a rectangular shape with rounded corners. If there is an
4667 existing path this will start a new disjoint sub-path.</doc>
4668 <return-value transfer-ownership="none">
4669 <type name="none" c:type="void"/>
4672 <parameter name="x_1" transfer-ownership="none">
4673 <doc xml:whitespace="preserve">X coordinate of the top-left corner.</doc>
4674 <type name="float" c:type="float"/>
4676 <parameter name="y_1" transfer-ownership="none">
4677 <doc xml:whitespace="preserve">Y coordinate of the top-left corner.</doc>
4678 <type name="float" c:type="float"/>
4680 <parameter name="x_2" transfer-ownership="none">
4681 <doc xml:whitespace="preserve">X coordinate of the bottom-right corner.</doc>
4682 <type name="float" c:type="float"/>
4684 <parameter name="y_2" transfer-ownership="none">
4685 <doc xml:whitespace="preserve">Y coordinate of the bottom-right corner.</doc>
4686 <type name="float" c:type="float"/>
4688 <parameter name="radius" transfer-ownership="none">
4689 <doc xml:whitespace="preserve">Radius of the corner arcs.</doc>
4690 <type name="float" c:type="float"/>
4692 <parameter name="arc_step" transfer-ownership="none">
4693 <doc xml:whitespace="preserve">Angle increment resolution for subdivision of the corner arcs.</doc>
4694 <type name="float" c:type="float"/>
4698 <function name="path_set_fill_rule"
4699 c:identifier="cogl_path_set_fill_rule"
4701 <doc xml:whitespace="preserve">Sets the fill rule of the current path to @fill_rule. This will
4702 affect how the path is filled when cogl_path_fill() is later
4703 called. Note that the fill rule state is attached to the path so
4704 calling cogl_get_path() will preserve the fill rule and calling
4705 cogl_path_new() will reset the fill rule back to the default.</doc>
4706 <return-value transfer-ownership="none">
4707 <type name="none" c:type="void"/>
4710 <parameter name="fill_rule" transfer-ownership="none">
4711 <doc xml:whitespace="preserve">The new fill rule.</doc>
4712 <type name="PathFillRule" c:type="CoglPathFillRule"/>
4716 <function name="path_stroke" c:identifier="cogl_path_stroke">
4717 <doc xml:whitespace="preserve">Strokes the constructed shape using the current drawing color and a
4718 width of 1 pixel (regardless of the current transformation
4719 matrix). To current path is then cleared. To use the path again,
4720 call cogl_path_stroke_preserve() instead.</doc>
4721 <return-value transfer-ownership="none">
4722 <type name="none" c:type="void"/>
4725 <function name="path_stroke_preserve"
4726 c:identifier="cogl_path_stroke_preserve"
4728 <doc xml:whitespace="preserve">Strokes the constructed shape using the current drawing color and
4729 preserves the path to be used again.</doc>
4730 <return-value transfer-ownership="none">
4731 <type name="none" c:type="void"/>
4734 <function name="perspective" c:identifier="cogl_perspective">
4735 <doc xml:whitespace="preserve">Replaces the current projection matrix with a perspective matrix
4736 based on the provided values.</doc>
4737 <return-value transfer-ownership="none">
4738 <type name="none" c:type="void"/>
4741 <parameter name="fovy" transfer-ownership="none">
4742 <doc xml:whitespace="preserve">Vertical of view angle in degrees.</doc>
4743 <type name="float" c:type="float"/>
4745 <parameter name="aspect" transfer-ownership="none">
4746 <doc xml:whitespace="preserve">Aspect ratio of diesplay</doc>
4747 <type name="float" c:type="float"/>
4749 <parameter name="z_near" transfer-ownership="none">
4750 <doc xml:whitespace="preserve">Nearest visible point</doc>
4751 <type name="float" c:type="float"/>
4753 <parameter name="z_far" transfer-ownership="none">
4754 <doc xml:whitespace="preserve">Furthest visible point along the z-axis</doc>
4755 <type name="float" c:type="float"/>
4759 <function name="polygon" c:identifier="cogl_polygon" version="1.0">
4760 <doc xml:whitespace="preserve">Draws a convex polygon using the current source material to fill / texture
4761 with according to the texture coordinates passed.
4762 If @use_color is %TRUE then the color will be changed for each vertex using
4763 the value specified in the color member of #CoglTextureVertex. This can be
4764 used for example to make the texture fade out by setting the alpha value of
4766 All of the texture coordinates must be in the range [0,1] and repeating the
4767 texture is not supported.
4768 Because of the way this function is implemented it will currently
4769 only work if either the texture is not sliced or the backend is not
4770 OpenGL ES and the minifying and magnifying functions are both set
4771 to COGL_MATERIAL_FILTER_NEAREST.</doc>
4772 <return-value transfer-ownership="none">
4773 <type name="none" c:type="void"/>
4776 <parameter name="vertices" transfer-ownership="none">
4777 <doc xml:whitespace="preserve">An array of #CoglTextureVertex structs</doc>
4778 <type name="TextureVertex" c:type="CoglTextureVertex*"/>
4780 <parameter name="n_vertices" transfer-ownership="none">
4781 <doc xml:whitespace="preserve">The length of the vertices array</doc>
4782 <type name="uint" c:type="unsigned int"/>
4784 <parameter name="use_color" transfer-ownership="none">
4785 <doc xml:whitespace="preserve">%TRUE if the color member of #CoglTextureVertex should be used</doc>
4786 <type name="boolean" c:type="gboolean"/>
4790 <function name="pop_draw_buffer"
4791 c:identifier="cogl_pop_draw_buffer"
4792 deprecated="The draw buffer API was replaced with a framebuffer API"
4793 deprecated-version="1.2">
4794 <doc xml:whitespace="preserve">Restore cogl_set_draw_buffer() state.</doc>
4795 <return-value transfer-ownership="none">
4796 <type name="none" c:type="void"/>
4799 <function name="pop_framebuffer"
4800 c:identifier="cogl_pop_framebuffer"
4802 <doc xml:whitespace="preserve">Restores the framebuffer that was previously at the top of the stack.
4803 All subsequent drawing will be redirected to this framebuffer.</doc>
4804 <return-value transfer-ownership="none">
4805 <type name="none" c:type="void"/>
4808 <function name="pop_matrix" c:identifier="cogl_pop_matrix">
4809 <doc xml:whitespace="preserve">Restores the current model-view matrix from the matrix stack.</doc>
4810 <return-value transfer-ownership="none">
4811 <type name="none" c:type="void"/>
4814 <function name="program_attach_shader"
4815 c:identifier="cogl_program_attach_shader">
4816 <doc xml:whitespace="preserve">Attaches a shader to a program object, a program can have one vertex shader
4817 and one fragment shader attached.</doc>
4818 <return-value transfer-ownership="none">
4819 <type name="none" c:type="void"/>
4822 <parameter name="program_handle" transfer-ownership="none">
4823 <doc xml:whitespace="preserve">a #CoglHandle for a shdaer program.</doc>
4824 <type name="Handle" c:type="CoglHandle"/>
4826 <parameter name="shader_handle" transfer-ownership="none">
4827 <doc xml:whitespace="preserve">a #CoglHandle for a vertex of fragment shader.</doc>
4828 <type name="Handle" c:type="CoglHandle"/>
4832 <function name="program_get_uniform_location"
4833 c:identifier="cogl_program_get_uniform_location">
4834 <doc xml:whitespace="preserve">Retrieve the location (offset) of a uniform variable in a shader program,
4835 a uniform is a variable that is constant for all vertices/fragments for a
4836 shader object and is possible to modify as an external parameter.
4837 This uniform can be set using cogl_program_uniform_1f() when the
4838 program is in use.</doc>
4839 <return-value transfer-ownership="none">
4840 <doc xml:whitespace="preserve">the offset of a uniform in a specified program.</doc>
4841 <type name="int" c:type="int"/>
4844 <parameter name="handle" transfer-ownership="none">
4845 <doc xml:whitespace="preserve">a #CoglHandle for a shader program.</doc>
4846 <type name="Handle" c:type="CoglHandle"/>
4848 <parameter name="uniform_name" transfer-ownership="none">
4849 <doc xml:whitespace="preserve">the name of a uniform.</doc>
4850 <type name="utf8" c:type="char*"/>
4854 <function name="program_link" c:identifier="cogl_program_link">
4855 <doc xml:whitespace="preserve">Links a program making it ready for use.</doc>
4856 <return-value transfer-ownership="none">
4857 <type name="none" c:type="void"/>
4860 <parameter name="handle" transfer-ownership="none">
4861 <doc xml:whitespace="preserve">a #CoglHandle for a shader program.</doc>
4862 <type name="Handle" c:type="CoglHandle"/>
4866 <function name="program_ref" c:identifier="cogl_program_ref">
4867 <doc xml:whitespace="preserve">Add an extra reference to a program.</doc>
4868 <return-value transfer-ownership="full">
4869 <doc xml:whitespace="preserve">@handle</doc>
4870 <type name="Handle" c:type="CoglHandle"/>
4873 <parameter name="handle" transfer-ownership="none">
4874 <doc xml:whitespace="preserve">A #CoglHandle to a program.</doc>
4875 <type name="Handle" c:type="CoglHandle"/>
4879 <function name="program_set_uniform_1f"
4880 c:identifier="cogl_program_set_uniform_1f"
4882 <doc xml:whitespace="preserve">Changes the value of a floating point uniform for the given linked</doc>
4883 <return-value transfer-ownership="none">
4884 <type name="none" c:type="void"/>
4887 <parameter name="program" transfer-ownership="none">
4888 <doc xml:whitespace="preserve">A #CoglHandle for a linked program</doc>
4889 <type name="Handle" c:type="CoglHandle"/>
4891 <parameter name="uniform_location" transfer-ownership="none">
4892 <doc xml:whitespace="preserve">the uniform location retrieved from cogl_program_get_uniform_location().</doc>
4893 <type name="int" c:type="int"/>
4895 <parameter name="value" transfer-ownership="none">
4896 <doc xml:whitespace="preserve">the new value of the uniform.</doc>
4897 <type name="float" c:type="float"/>
4901 <function name="program_set_uniform_1i"
4902 c:identifier="cogl_program_set_uniform_1i"
4904 <doc xml:whitespace="preserve">Changes the value of an integer uniform for the given linked</doc>
4905 <return-value transfer-ownership="none">
4906 <type name="none" c:type="void"/>
4909 <parameter name="program" transfer-ownership="none">
4910 <doc xml:whitespace="preserve">A #CoglHandle for a linked program</doc>
4911 <type name="Handle" c:type="CoglHandle"/>
4913 <parameter name="uniform_location" transfer-ownership="none">
4914 <doc xml:whitespace="preserve">the uniform location retrieved from cogl_program_get_uniform_location().</doc>
4915 <type name="int" c:type="int"/>
4917 <parameter name="value" transfer-ownership="none">
4918 <doc xml:whitespace="preserve">the new value of the uniform.</doc>
4919 <type name="int" c:type="int"/>
4923 <function name="program_set_uniform_float"
4924 c:identifier="cogl_program_set_uniform_float"
4926 <doc xml:whitespace="preserve">Changes the value of a float vector uniform, or uniform array for
4927 the given linked @program.</doc>
4928 <return-value transfer-ownership="none">
4929 <type name="none" c:type="void"/>
4932 <parameter name="program" transfer-ownership="none">
4933 <doc xml:whitespace="preserve">A #CoglHandle for a linked program</doc>
4934 <type name="Handle" c:type="CoglHandle"/>
4936 <parameter name="uniform_location" transfer-ownership="none">
4937 <doc xml:whitespace="preserve">the uniform location retrieved from cogl_program_get_uniform_location().</doc>
4938 <type name="int" c:type="int"/>
4940 <parameter name="n_components" transfer-ownership="none">
4941 <doc xml:whitespace="preserve">The number of components for the uniform. For example with glsl you'd use 3 for a vec3 or 4 for a vec4.</doc>
4942 <type name="int" c:type="int"/>
4944 <parameter name="count" transfer-ownership="none">
4945 <doc xml:whitespace="preserve">For uniform arrays this is the array length otherwise just pass 1</doc>
4946 <type name="int" c:type="int"/>
4948 <parameter name="value" transfer-ownership="none">
4949 <doc xml:whitespace="preserve">the new value of the uniform[s].</doc>
4950 <array length="3" c:type="float*">
4951 <type name="float"/>
4956 <function name="program_set_uniform_int"
4957 c:identifier="cogl_program_set_uniform_int"
4959 <doc xml:whitespace="preserve">Changes the value of a int vector uniform, or uniform array for
4960 the given linked @program.</doc>
4961 <return-value transfer-ownership="none">
4962 <type name="none" c:type="void"/>
4965 <parameter name="program" transfer-ownership="none">
4966 <doc xml:whitespace="preserve">A #CoglHandle for a linked program</doc>
4967 <type name="Handle" c:type="CoglHandle"/>
4969 <parameter name="uniform_location" transfer-ownership="none">
4970 <doc xml:whitespace="preserve">the uniform location retrieved from cogl_program_get_uniform_location().</doc>
4971 <type name="int" c:type="int"/>
4973 <parameter name="n_components" transfer-ownership="none">
4974 <doc xml:whitespace="preserve">The number of components for the uniform. For example with glsl you'd use 3 for a vec3 or 4 for a vec4.</doc>
4975 <type name="int" c:type="int"/>
4977 <parameter name="count" transfer-ownership="none">
4978 <doc xml:whitespace="preserve">For uniform arrays this is the array length otherwise just pass 1</doc>
4979 <type name="int" c:type="int"/>
4981 <parameter name="value" transfer-ownership="none">
4982 <doc xml:whitespace="preserve">the new value of the uniform[s].</doc>
4983 <array length="3" c:type="int*">
4989 <function name="program_set_uniform_matrix"
4990 c:identifier="cogl_program_set_uniform_matrix"
4992 <doc xml:whitespace="preserve">Changes the value of a matrix uniform, or uniform array in the
4993 given linked @program.</doc>
4994 <return-value transfer-ownership="none">
4995 <type name="none" c:type="void"/>
4998 <parameter name="program" transfer-ownership="none">
4999 <doc xml:whitespace="preserve">A #CoglHandle for a linked program</doc>
5000 <type name="Handle" c:type="CoglHandle"/>
5002 <parameter name="uniform_location" transfer-ownership="none">
5003 <doc xml:whitespace="preserve">the uniform location retrieved from cogl_program_get_uniform_location().</doc>
5004 <type name="int" c:type="int"/>
5006 <parameter name="dimensions" transfer-ownership="none">
5007 <doc xml:whitespace="preserve">The dimensions of the matrix. So for for example pass 2 for a 2x2 matrix or 3 for 3x3.</doc>
5008 <type name="int" c:type="int"/>
5010 <parameter name="count" transfer-ownership="none">
5011 <doc xml:whitespace="preserve">For uniform arrays this is the array length otherwise just pass 1</doc>
5012 <type name="int" c:type="int"/>
5014 <parameter name="transpose" transfer-ownership="none">
5015 <doc xml:whitespace="preserve">Whether to transpose the matrix when setting the uniform.</doc>
5016 <type name="boolean" c:type="gboolean"/>
5018 <parameter name="value" transfer-ownership="none">
5019 <doc xml:whitespace="preserve">the new value of the uniform.</doc>
5020 <array length="3" c:type="float*">
5021 <type name="float"/>
5026 <function name="program_uniform_1f"
5027 c:identifier="cogl_program_uniform_1f"
5028 deprecated="Use cogl_program_set_uniform_1f() instead."
5029 deprecated-version="1.4">
5030 <doc xml:whitespace="preserve">Changes the value of a floating point uniform in the currently
5031 used (see cogl_program_use()) shader program.</doc>
5032 <return-value transfer-ownership="none">
5033 <type name="none" c:type="void"/>
5036 <parameter name="uniform_no" transfer-ownership="none">
5037 <doc xml:whitespace="preserve">the uniform to set.</doc>
5038 <type name="int" c:type="int"/>
5040 <parameter name="value" transfer-ownership="none">
5041 <doc xml:whitespace="preserve">the new value of the uniform.</doc>
5042 <type name="float" c:type="float"/>
5046 <function name="program_uniform_1i"
5047 c:identifier="cogl_program_uniform_1i"
5048 deprecated="Use cogl_program_set_uniform_1i() instead."
5049 deprecated-version="1.4">
5050 <doc xml:whitespace="preserve">Changes the value of an integer uniform in the currently
5051 used (see cogl_program_use()) shader program.</doc>
5052 <return-value transfer-ownership="none">
5053 <type name="none" c:type="void"/>
5056 <parameter name="uniform_no" transfer-ownership="none">
5057 <doc xml:whitespace="preserve">the uniform to set.</doc>
5058 <type name="int" c:type="int"/>
5060 <parameter name="value" transfer-ownership="none">
5061 <doc xml:whitespace="preserve">the new value of the uniform.</doc>
5062 <type name="int" c:type="int"/>
5066 <function name="program_uniform_float"
5067 c:identifier="cogl_program_uniform_float"
5068 deprecated="Use cogl_program_set_uniform_float() instead."
5069 deprecated-version="1.4">
5070 <doc xml:whitespace="preserve">Changes the value of a float vector uniform, or uniform array in the
5071 currently used (see cogl_program_use()) shader program.</doc>
5072 <return-value transfer-ownership="none">
5073 <type name="none" c:type="void"/>
5076 <parameter name="uniform_no" transfer-ownership="none">
5077 <doc xml:whitespace="preserve">the uniform to set.</doc>
5078 <type name="int" c:type="int"/>
5080 <parameter name="size" transfer-ownership="none">
5081 <doc xml:whitespace="preserve">Size of float vector.</doc>
5082 <type name="int" c:type="int"/>
5084 <parameter name="count" transfer-ownership="none">
5085 <doc xml:whitespace="preserve">Size of array of uniforms.</doc>
5086 <type name="int" c:type="int"/>
5088 <parameter name="value" transfer-ownership="none">
5089 <doc xml:whitespace="preserve">the new value of the uniform.</doc>
5090 <array length="2" c:type="float*">
5091 <type name="float"/>
5096 <function name="program_uniform_int"
5097 c:identifier="cogl_program_uniform_int">
5098 <doc xml:whitespace="preserve">Changes the value of a int vector uniform, or uniform array in the
5099 currently used (see cogl_program_use()) shader program.</doc>
5100 <return-value transfer-ownership="none">
5101 <type name="none" c:type="void"/>
5104 <parameter name="uniform_no" transfer-ownership="none">
5105 <doc xml:whitespace="preserve">the uniform to set.</doc>
5106 <type name="int" c:type="int"/>
5108 <parameter name="size" transfer-ownership="none">
5109 <doc xml:whitespace="preserve">Size of int vector.</doc>
5110 <type name="int" c:type="int"/>
5112 <parameter name="count" transfer-ownership="none">
5113 <doc xml:whitespace="preserve">Size of array of uniforms.</doc>
5114 <type name="int" c:type="int"/>
5116 <parameter name="value" transfer-ownership="none">
5117 <doc xml:whitespace="preserve">the new value of the uniform.</doc>
5118 <array length="2" c:type="int*">
5124 <function name="program_uniform_matrix"
5125 c:identifier="cogl_program_uniform_matrix">
5126 <doc xml:whitespace="preserve">Changes the value of a matrix uniform, or uniform array in the
5127 currently used (see cogl_program_use()) shader program. The @size
5128 parameter is used to determine the square size of the matrix.</doc>
5129 <return-value transfer-ownership="none">
5130 <type name="none" c:type="void"/>
5133 <parameter name="uniform_no" transfer-ownership="none">
5134 <doc xml:whitespace="preserve">the uniform to set.</doc>
5135 <type name="int" c:type="int"/>
5137 <parameter name="size" transfer-ownership="none">
5138 <doc xml:whitespace="preserve">Size of matrix.</doc>
5139 <type name="int" c:type="int"/>
5141 <parameter name="count" transfer-ownership="none">
5142 <doc xml:whitespace="preserve">Size of array of uniforms.</doc>
5143 <type name="int" c:type="int"/>
5145 <parameter name="transpose" transfer-ownership="none">
5146 <doc xml:whitespace="preserve">Whether to transpose the matrix when setting the uniform.</doc>
5147 <type name="boolean" c:type="gboolean"/>
5149 <parameter name="value" transfer-ownership="none">
5150 <doc xml:whitespace="preserve">the new value of the uniform.</doc>
5151 <array length="2" c:type="float*">
5152 <type name="float"/>
5157 <function name="program_unref" c:identifier="cogl_program_unref">
5158 <doc xml:whitespace="preserve">Removes a reference to a program. If it was the last reference the
5159 program object will be destroyed.</doc>
5160 <return-value transfer-ownership="none">
5161 <type name="none" c:type="void"/>
5164 <parameter name="handle" transfer-ownership="none">
5165 <doc xml:whitespace="preserve">A #CoglHandle to a program.</doc>
5166 <type name="Handle" c:type="CoglHandle"/>
5170 <function name="program_use" c:identifier="cogl_program_use">
5171 <doc xml:whitespace="preserve">Activate a specific shader program replacing that part of the GL
5172 rendering pipeline, if passed in %COGL_INVALID_HANDLE the default
5173 behavior of GL is reinstated.</doc>
5174 <return-value transfer-ownership="none">
5175 <type name="none" c:type="void"/>
5178 <parameter name="handle" transfer-ownership="none">
5179 <doc xml:whitespace="preserve">a #CoglHandle for a shader program or %COGL_INVALID_HANDLE.</doc>
5180 <type name="Handle" c:type="CoglHandle"/>
5184 <function name="push_draw_buffer"
5185 c:identifier="cogl_push_draw_buffer"
5186 deprecated="The draw buffer API was replaced with a framebuffer API"
5187 deprecated-version="1.2">
5188 <doc xml:whitespace="preserve">Save cogl_set_draw_buffer() state.</doc>
5189 <return-value transfer-ownership="none">
5190 <type name="none" c:type="void"/>
5193 <function name="push_framebuffer"
5194 c:identifier="cogl_push_framebuffer"
5196 <doc xml:whitespace="preserve">Redirects all subsequent drawing to the specified framebuffer. This can
5197 either be an offscreen buffer created with cogl_offscreen_new_to_texture ()
5198 or in the future it may be an onscreen framebuffer too.
5199 You should understand that a framebuffer owns the following state:
5200 <itemizedlist>
5201 <listitem><simpara>The projection matrix</simpara></listitem>
5202 <listitem><simpara>The modelview matrix stack</simpara></listitem>
5203 <listitem><simpara>The viewport</simpara></listitem>
5204 <listitem><simpara>The clip stack</simpara></listitem>
5205 </itemizedlist>
5206 So these items will automatically be saved and restored when you
5207 push and pop between different framebuffers.
5208 Also remember a newly allocated framebuffer will have an identity matrix for
5209 the projection and modelview matrices which gives you a coordinate space
5210 like OpenGL with (-1, -1) corresponding to the top left of the viewport,
5211 (1, 1) corresponding to the bottom right and +z coming out towards the
5213 If you want to set up a coordinate space like Clutter does with (0, 0)
5214 corresponding to the top left and (framebuffer_width, framebuffer_height)
5215 corresponding to the bottom right you can do so like this:
5218 setup_viewport (unsigned int width,
5219 unsigned int height,
5226 CoglMatrix projection_matrix;
5227 CoglMatrix mv_matrix;
5228 cogl_set_viewport (0, 0, width, height);
5229 cogl_perspective (fovy, aspect, z_near, z_far);
5230 cogl_get_projection_matrix (&amp;projection_matrix);
5231 z_camera = 0.5 * projection_matrix.xx;
5232 cogl_matrix_init_identity (&amp;mv_matrix);
5233 cogl_matrix_translate (&amp;mv_matrix, -0.5f, -0.5f, -z_camera);
5234 cogl_matrix_scale (&amp;mv_matrix, 1.0f / width, -1.0f / height, 1.0f / width);
5235 cogl_matrix_translate (&amp;mv_matrix, 0.0f, -1.0 * height, 0.0f);
5236 cogl_set_modelview_matrix (&amp;mv_matrix);
5239 my_init_framebuffer (ClutterStage *stage,
5240 CoglFramebuffer *framebuffer,
5241 unsigned int framebuffer_width,
5242 unsigned int framebuffer_height)
5244 ClutterPerspective perspective;
5245 clutter_stage_get_perspective (stage, &perspective);
5246 cogl_push_framebuffer (framebuffer);
5247 setup_viewport (framebuffer_width,
5255 The previous framebuffer can be restored by calling cogl_pop_framebuffer()</doc>
5256 <return-value transfer-ownership="none">
5257 <type name="none" c:type="void"/>
5260 <parameter name="buffer" transfer-ownership="none">
5261 <doc xml:whitespace="preserve">A #CoglFramebuffer object, either onscreen or offscreen.</doc>
5262 <type name="Framebuffer" c:type="CoglFramebuffer*"/>
5266 <function name="push_matrix" c:identifier="cogl_push_matrix">
5267 <doc xml:whitespace="preserve">Stores the current model-view matrix on the matrix stack. The matrix
5268 can later be restored with cogl_pop_matrix().</doc>
5269 <return-value transfer-ownership="none">
5270 <type name="none" c:type="void"/>
5273 <function name="read_pixels" c:identifier="cogl_read_pixels">
5274 <doc xml:whitespace="preserve">This reads a rectangle of pixels from the current framebuffer where
5275 position (0, 0) is the top left. The pixel at (x, y) is the first
5276 read, and the data is returned with a rowstride of (width * 4).
5277 Currently Cogl assumes that the framebuffer is in a premultiplied
5278 format so if @format is non-premultiplied it will convert it. To
5279 read the pixel values without any conversion you should either
5280 specify a format that doesn't use an alpha channel or use one of
5281 the formats ending in PRE.</doc>
5282 <return-value transfer-ownership="none">
5283 <type name="none" c:type="void"/>
5286 <parameter name="x" transfer-ownership="none">
5287 <doc xml:whitespace="preserve">The window x position to start reading from</doc>
5288 <type name="int" c:type="int"/>
5290 <parameter name="y" transfer-ownership="none">
5291 <doc xml:whitespace="preserve">The window y position to start reading from</doc>
5292 <type name="int" c:type="int"/>
5294 <parameter name="width" transfer-ownership="none">
5295 <doc xml:whitespace="preserve">The width of the rectangle you want to read</doc>
5296 <type name="int" c:type="int"/>
5298 <parameter name="height" transfer-ownership="none">
5299 <doc xml:whitespace="preserve">The height of the rectangle you want to read</doc>
5300 <type name="int" c:type="int"/>
5302 <parameter name="source" transfer-ownership="none">
5303 <doc xml:whitespace="preserve">Identifies which auxillary buffer you want to read (only COGL_READ_PIXELS_COLOR_BUFFER supported currently)</doc>
5304 <type name="ReadPixelsFlags" c:type="CoglReadPixelsFlags"/>
5306 <parameter name="format" transfer-ownership="none">
5307 <doc xml:whitespace="preserve">The pixel format you want the result in (only COGL_PIXEL_FORMAT_RGBA_8888 supported currently)</doc>
5308 <type name="PixelFormat" c:type="CoglPixelFormat"/>
5310 <parameter name="pixels" transfer-ownership="none">
5311 <doc xml:whitespace="preserve">The location to write the pixel data.</doc>
5312 <array c:type="guint8*">
5313 <type name="uint8"/>
5318 <function name="rectangle" c:identifier="cogl_rectangle">
5319 <doc xml:whitespace="preserve">Fills a rectangle at the given coordinates with the current source material</doc>
5320 <return-value transfer-ownership="none">
5321 <type name="none" c:type="void"/>
5324 <parameter name="x_1" transfer-ownership="none">
5325 <doc xml:whitespace="preserve">X coordinate of the top-left corner</doc>
5326 <type name="float" c:type="float"/>
5328 <parameter name="y_1" transfer-ownership="none">
5329 <doc xml:whitespace="preserve">Y coordinate of the top-left corner</doc>
5330 <type name="float" c:type="float"/>
5332 <parameter name="x_2" transfer-ownership="none">
5333 <doc xml:whitespace="preserve">X coordinate of the bottom-right corner</doc>
5334 <type name="float" c:type="float"/>
5336 <parameter name="y_2" transfer-ownership="none">
5337 <doc xml:whitespace="preserve">Y coordinate of the bottom-right corner</doc>
5338 <type name="float" c:type="float"/>
5342 <function name="rectangle_with_multitexture_coords"
5343 c:identifier="cogl_rectangle_with_multitexture_coords"
5345 <doc xml:whitespace="preserve">This function draws a rectangle using the current source material to
5346 texture or fill with. As a material may contain multiple texture layers
5347 this interface lets you supply texture coordinates for each layer of the
5349 The first pair of coordinates are for the first layer (with the smallest
5350 layer index) and if you supply less texture coordinates than there are
5351 layers in the current source material then default texture coordinates
5352 (0.0, 0.0, 1.0, 1.0) are generated.</doc>
5353 <return-value transfer-ownership="none">
5354 <type name="none" c:type="void"/>
5357 <parameter name="x1" transfer-ownership="none">
5358 <doc xml:whitespace="preserve">x coordinate upper left on screen.</doc>
5359 <type name="float" c:type="float"/>
5361 <parameter name="y1" transfer-ownership="none">
5362 <doc xml:whitespace="preserve">y coordinate upper left on screen.</doc>
5363 <type name="float" c:type="float"/>
5365 <parameter name="x2" transfer-ownership="none">
5366 <doc xml:whitespace="preserve">x coordinate lower right on screen.</doc>
5367 <type name="float" c:type="float"/>
5369 <parameter name="y2" transfer-ownership="none">
5370 <doc xml:whitespace="preserve">y coordinate lower right on screen.</doc>
5371 <type name="float" c:type="float"/>
5373 <parameter name="tex_coords" transfer-ownership="none">
5374 <doc xml:whitespace="preserve">An array containing groups of 4 float values: [tx1, ty1, tx2, ty2] that are interpreted as two texture coordinates; one for the upper left texel, and one for the lower right texel. Each value should be between 0.0 and 1.0, where the coordinate (0.0, 0.0) represents the top left of the texture, and (1.0, 1.0) the bottom right.</doc>
5375 <array c:type="float*">
5376 <type name="float"/>
5379 <parameter name="tex_coords_len" transfer-ownership="none">
5380 <doc xml:whitespace="preserve">The length of the tex_coords array. (e.g. for one layer and one group of texture coordinates, this would be 4)</doc>
5381 <type name="int" c:type="int"/>
5385 <function name="rectangle_with_texture_coords"
5386 c:identifier="cogl_rectangle_with_texture_coords"
5388 <doc xml:whitespace="preserve">Draw a rectangle using the current material and supply texture coordinates
5389 to be used for the first texture layer of the material. To draw the entire
5390 texture pass in @tx1=0.0 @ty1=0.0 @tx2=1.0 @ty2=1.0.</doc>
5391 <return-value transfer-ownership="none">
5392 <type name="none" c:type="void"/>
5395 <parameter name="x1" transfer-ownership="none">
5396 <doc xml:whitespace="preserve">x coordinate upper left on screen.</doc>
5397 <type name="float" c:type="float"/>
5399 <parameter name="y1" transfer-ownership="none">
5400 <doc xml:whitespace="preserve">y coordinate upper left on screen.</doc>
5401 <type name="float" c:type="float"/>
5403 <parameter name="x2" transfer-ownership="none">
5404 <doc xml:whitespace="preserve">x coordinate lower right on screen.</doc>
5405 <type name="float" c:type="float"/>
5407 <parameter name="y2" transfer-ownership="none">
5408 <doc xml:whitespace="preserve">y coordinate lower right on screen.</doc>
5409 <type name="float" c:type="float"/>
5411 <parameter name="tx1" transfer-ownership="none">
5412 <doc xml:whitespace="preserve">x part of texture coordinate to use for upper left pixel</doc>
5413 <type name="float" c:type="float"/>
5415 <parameter name="ty1" transfer-ownership="none">
5416 <doc xml:whitespace="preserve">y part of texture coordinate to use for upper left pixel</doc>
5417 <type name="float" c:type="float"/>
5419 <parameter name="tx2" transfer-ownership="none">
5420 <doc xml:whitespace="preserve">x part of texture coordinate to use for lower right pixel</doc>
5421 <type name="float" c:type="float"/>
5423 <parameter name="ty2" transfer-ownership="none">
5424 <doc xml:whitespace="preserve">y part of texture coordinate to use for left pixel</doc>
5425 <type name="float" c:type="float"/>
5429 <function name="rectangles" c:identifier="cogl_rectangles" version="1.0">
5430 <doc xml:whitespace="preserve">Draws a series of rectangles in the same way that
5431 cogl_rectangle() does. In some situations it can give a
5432 significant performance boost to use this function rather than
5433 calling cogl_rectangle() separately for each rectangle.
5434 parameters x1, y1, x2, and y2, and have the same
5435 meaning as in cogl_rectangle().</doc>
5436 <return-value transfer-ownership="none">
5437 <type name="none" c:type="void"/>
5440 <parameter name="verts" transfer-ownership="none">
5441 <doc xml:whitespace="preserve">an array of vertices</doc>
5442 <array c:type="float*">
5443 <type name="float"/>
5446 <parameter name="n_rects" transfer-ownership="none">
5447 <doc xml:whitespace="preserve">number of rectangles to draw</doc>
5448 <type name="uint" c:type="unsigned int"/>
5452 <function name="rectangles_with_texture_coords"
5453 c:identifier="cogl_rectangles_with_texture_coords"
5455 <doc xml:whitespace="preserve">Draws a series of rectangles in the same way that
5456 cogl_rectangle_with_texture_coords() does. In some situations it can give a
5457 significant performance boost to use this function rather than
5458 calling cogl_rectangle_with_texture_coords() separately for each rectangle.
5459 parameters x1, y1, x2, y2, tx1, ty1, tx2 and ty2 and have the same
5460 meaning as in cogl_rectangle_with_texture_coords().</doc>
5461 <return-value transfer-ownership="none">
5462 <type name="none" c:type="void"/>
5465 <parameter name="verts" transfer-ownership="none">
5466 <doc xml:whitespace="preserve">an array of vertices</doc>
5467 <array c:type="float*">
5468 <type name="float"/>
5471 <parameter name="n_rects" transfer-ownership="none">
5472 <doc xml:whitespace="preserve">number of rectangles to draw</doc>
5473 <type name="uint" c:type="unsigned int"/>
5477 <function name="rotate" c:identifier="cogl_rotate">
5478 <doc xml:whitespace="preserve">Multiplies the current model-view matrix by one that rotates the
5479 model around the vertex specified by @x, @y and @z. The rotation
5480 follows the right-hand thumb rule so for example rotating by 10
5481 degrees about the vertex (0, 0, 1) causes a small counter-clockwise
5483 <return-value transfer-ownership="none">
5484 <type name="none" c:type="void"/>
5487 <parameter name="angle" transfer-ownership="none">
5488 <doc xml:whitespace="preserve">Angle in degrees to rotate.</doc>
5489 <type name="float" c:type="float"/>
5491 <parameter name="x" transfer-ownership="none">
5492 <doc xml:whitespace="preserve">X-component of vertex to rotate around.</doc>
5493 <type name="float" c:type="float"/>
5495 <parameter name="y" transfer-ownership="none">
5496 <doc xml:whitespace="preserve">Y-component of vertex to rotate around.</doc>
5497 <type name="float" c:type="float"/>
5499 <parameter name="z" transfer-ownership="none">
5500 <doc xml:whitespace="preserve">Z-component of vertex to rotate around.</doc>
5501 <type name="float" c:type="float"/>
5505 <function name="scale" c:identifier="cogl_scale">
5506 <doc xml:whitespace="preserve">Multiplies the current model-view matrix by one that scales the x,
5507 y and z axes by the given values.</doc>
5508 <return-value transfer-ownership="none">
5509 <type name="none" c:type="void"/>
5512 <parameter name="x" transfer-ownership="none">
5513 <doc xml:whitespace="preserve">Amount to scale along the x-axis</doc>
5514 <type name="float" c:type="float"/>
5516 <parameter name="y" transfer-ownership="none">
5517 <doc xml:whitespace="preserve">Amount to scale along the y-axis</doc>
5518 <type name="float" c:type="float"/>
5520 <parameter name="z" transfer-ownership="none">
5521 <doc xml:whitespace="preserve">Amount to scale along the z-axis</doc>
5522 <type name="float" c:type="float"/>
5526 <function name="set_backface_culling_enabled"
5527 c:identifier="cogl_set_backface_culling_enabled">
5528 <doc xml:whitespace="preserve">Sets whether textures positioned so that their backface is showing
5529 should be hidden. This can be used to efficiently draw two-sided
5530 textures or fully closed cubes without enabling depth testing. This
5531 only affects calls to the cogl_rectangle* family of functions and
5532 cogl_vertex_buffer_draw*. Backface culling is disabled by default.</doc>
5533 <return-value transfer-ownership="none">
5534 <type name="none" c:type="void"/>
5537 <parameter name="setting" transfer-ownership="none">
5538 <doc xml:whitespace="preserve">%TRUE to enable backface culling or %FALSE to disable.</doc>
5539 <type name="boolean" c:type="gboolean"/>
5543 <function name="set_depth_test_enabled"
5544 c:identifier="cogl_set_depth_test_enabled"
5545 deprecated="Use cogl_material_set_depth_test_enabled()"
5546 deprecated-version="1.4">
5547 <doc xml:whitespace="preserve">Sets whether depth testing is enabled. If it is disabled then the
5548 order that actors are layered on the screen depends solely on the
5549 order specified using clutter_actor_raise() and
5550 clutter_actor_lower(), otherwise it will also take into account the
5551 actor's depth. Depth testing is disabled by default.
5553 <return-value transfer-ownership="none">
5554 <type name="none" c:type="void"/>
5557 <parameter name="setting" transfer-ownership="none">
5558 <doc xml:whitespace="preserve">%TRUE to enable depth testing or %FALSE to disable.</doc>
5559 <type name="boolean" c:type="gboolean"/>
5563 <function name="set_draw_buffer"
5564 c:identifier="cogl_set_draw_buffer"
5565 deprecated="The target argument was redundant since we could look at"
5566 deprecated-version="1.2">
5567 <doc xml:whitespace="preserve">Redirects all subsequent drawing to the specified framebuffer. This
5568 can either be an offscreen buffer created with
5569 cogl_offscreen_new_to_texture () or you can revert to your original
5570 on screen window buffer.
5571 the type of CoglHandle given instead.</doc>
5572 <return-value transfer-ownership="none">
5573 <type name="none" c:type="void"/>
5576 <parameter name="target" transfer-ownership="none">
5577 <doc xml:whitespace="preserve">A #CoglBufferTarget that specifies what kind of framebuffer you are setting as the render target.</doc>
5578 <type name="BufferTarget" c:type="CoglBufferTarget"/>
5580 <parameter name="offscreen" transfer-ownership="none">
5581 <doc xml:whitespace="preserve">If you are setting a framebuffer of type COGL_OFFSCREEN_BUFFER then this is a CoglHandle for the offscreen buffer.</doc>
5582 <type name="Handle" c:type="CoglHandle"/>
5586 <function name="set_fog" c:identifier="cogl_set_fog">
5587 <doc xml:whitespace="preserve">Enables fogging. Fogging causes vertices that are further away from the eye
5588 to be rendered with a different color. The color is determined according to
5589 the chosen fog mode; at it's simplest the color is linearly interpolated so
5590 that vertices at @z_near are drawn fully with their original color and
5591 vertices at @z_far are drawn fully with @fog_color. Fogging will remain
5592 enabled until you call cogl_disable_fog().
5593 <note>The fogging functions only work correctly when primitives use
5594 unmultiplied alpha colors. By default Cogl will premultiply textures
5595 and cogl_set_source_color() will premultiply colors, so unless you
5596 explicitly load your textures requesting an unmultiplied internal format
5597 and use cogl_material_set_color() you can only use fogging with fully
5598 opaque primitives. This might improve in the future when we can depend
5599 on fragment shaders.</note></doc>
5600 <return-value transfer-ownership="none">
5601 <type name="none" c:type="void"/>
5604 <parameter name="fog_color" transfer-ownership="none">
5605 <doc xml:whitespace="preserve">The color of the fog</doc>
5606 <type name="Color" c:type="CoglColor*"/>
5608 <parameter name="mode" transfer-ownership="none">
5609 <doc xml:whitespace="preserve">A #CoglFogMode that determines the equation used to calculate the fogging blend factor.</doc>
5610 <type name="FogMode" c:type="CoglFogMode"/>
5612 <parameter name="density" transfer-ownership="none">
5613 <doc xml:whitespace="preserve">Used by %COGL_FOG_MODE_EXPONENTIAL and by %COGL_FOG_MODE_EXPONENTIAL_SQUARED equations.</doc>
5614 <type name="float" c:type="float"/>
5616 <parameter name="z_near" transfer-ownership="none">
5617 <doc xml:whitespace="preserve">Position along Z axis where no fogging should be applied</doc>
5618 <type name="float" c:type="float"/>
5620 <parameter name="z_far" transfer-ownership="none">
5621 <doc xml:whitespace="preserve">Position along Z axis where full fogging should be applied</doc>
5622 <type name="float" c:type="float"/>
5626 <function name="set_framebuffer"
5627 c:identifier="cogl_set_framebuffer"
5629 <doc xml:whitespace="preserve">This redirects all subsequent drawing to the specified framebuffer. This can
5630 either be an offscreen buffer created with cogl_offscreen_new_to_texture ()
5631 or in the future it may be an onscreen framebuffers too.</doc>
5632 <return-value transfer-ownership="none">
5633 <type name="none" c:type="void"/>
5636 <parameter name="buffer" transfer-ownership="none">
5637 <doc xml:whitespace="preserve">A #CoglFramebuffer object, either onscreen or offscreen.</doc>
5638 <type name="Framebuffer" c:type="CoglFramebuffer*"/>
5642 <function name="set_modelview_matrix"
5643 c:identifier="cogl_set_modelview_matrix">
5644 <doc xml:whitespace="preserve">Loads @matrix as the new model-view matrix.</doc>
5645 <return-value transfer-ownership="none">
5646 <type name="none" c:type="void"/>
5649 <parameter name="matrix" transfer-ownership="none">
5650 <doc xml:whitespace="preserve">the new model-view matrix</doc>
5651 <type name="Matrix" c:type="CoglMatrix*"/>
5655 <function name="set_path" c:identifier="cogl_set_path" version="1.4">
5656 <doc xml:whitespace="preserve">Replaces the current path with @path. A reference is taken on the
5657 object so if you no longer need the path you should unref with
5658 cogl_object_unref().</doc>
5659 <return-value transfer-ownership="none">
5660 <type name="none" c:type="void"/>
5663 <parameter name="path" transfer-ownership="none">
5664 <doc xml:whitespace="preserve">A #CoglPath object</doc>
5665 <type name="Path" c:type="CoglPath*"/>
5669 <function name="set_projection_matrix"
5670 c:identifier="cogl_set_projection_matrix">
5671 <doc xml:whitespace="preserve">Loads matrix as the new projection matrix.</doc>
5672 <return-value transfer-ownership="none">
5673 <type name="none" c:type="void"/>
5676 <parameter name="matrix" transfer-ownership="none">
5677 <doc xml:whitespace="preserve">the new projection matrix</doc>
5678 <type name="Matrix" c:type="CoglMatrix*"/>
5682 <function name="set_source" c:identifier="cogl_set_source" version="1.0">
5683 <doc xml:whitespace="preserve">This function sets the source material that will be used to fill subsequent
5684 geometry emitted via the cogl API.
5685 <note>In the future we may add the ability to set a front facing material,
5686 and a back facing material, in which case this function will set both to the
5687 same.</note></doc>
5688 <return-value transfer-ownership="none">
5689 <type name="none" c:type="void"/>
5692 <parameter name="material" transfer-ownership="none">
5693 <doc xml:whitespace="preserve">A #CoglHandle for a material</doc>
5694 <type name="Handle" c:type="CoglHandle"/>
5698 <function name="set_source_color"
5699 c:identifier="cogl_set_source_color"
5701 <doc xml:whitespace="preserve">This is a convenience function for creating a solid fill source material
5702 from the given color. This color will be used for any subsequent drawing
5704 The color will be premultiplied by Cogl, so the color should be
5705 semi-transparent red.
5706 See also cogl_set_source_color4ub() and cogl_set_source_color4f()
5707 if you already have the color components.</doc>
5708 <return-value transfer-ownership="none">
5709 <type name="none" c:type="void"/>
5712 <parameter name="color" transfer-ownership="none">
5713 <doc xml:whitespace="preserve">a #CoglColor</doc>
5714 <type name="Color" c:type="CoglColor*"/>
5718 <function name="set_source_color4f"
5719 c:identifier="cogl_set_source_color4f"
5721 <doc xml:whitespace="preserve">This is a convenience function for creating a solid fill source material
5722 from the given color using normalized values for each component. This color
5723 will be used for any subsequent drawing operation.
5724 The value for each component is a fixed point number in the range
5725 between 0 and %1.0. If the values passed in are outside that
5726 range, they will be clamped.</doc>
5727 <return-value transfer-ownership="none">
5728 <type name="none" c:type="void"/>
5731 <parameter name="red" transfer-ownership="none">
5732 <doc xml:whitespace="preserve">value of the red channel, between 0 and %1.0</doc>
5733 <type name="float" c:type="float"/>
5735 <parameter name="green" transfer-ownership="none">
5736 <doc xml:whitespace="preserve">value of the green channel, between 0 and %1.0</doc>
5737 <type name="float" c:type="float"/>
5739 <parameter name="blue" transfer-ownership="none">
5740 <doc xml:whitespace="preserve">value of the blue channel, between 0 and %1.0</doc>
5741 <type name="float" c:type="float"/>
5743 <parameter name="alpha" transfer-ownership="none">
5744 <doc xml:whitespace="preserve">value of the alpha channel, between 0 and %1.0</doc>
5745 <type name="float" c:type="float"/>
5749 <function name="set_source_color4ub"
5750 c:identifier="cogl_set_source_color4ub"
5752 <doc xml:whitespace="preserve">This is a convenience function for creating a solid fill source material
5753 from the given color using unsigned bytes for each component. This
5754 color will be used for any subsequent drawing operation.
5755 The value for each component is an unsigned byte in the range
5756 between 0 and 255.</doc>
5757 <return-value transfer-ownership="none">
5758 <type name="none" c:type="void"/>
5761 <parameter name="red" transfer-ownership="none">
5762 <doc xml:whitespace="preserve">value of the red channel, between 0 and 255</doc>
5763 <type name="uint8" c:type="guint8"/>
5765 <parameter name="green" transfer-ownership="none">
5766 <doc xml:whitespace="preserve">value of the green channel, between 0 and 255</doc>
5767 <type name="uint8" c:type="guint8"/>
5769 <parameter name="blue" transfer-ownership="none">
5770 <doc xml:whitespace="preserve">value of the blue channel, between 0 and 255</doc>
5771 <type name="uint8" c:type="guint8"/>
5773 <parameter name="alpha" transfer-ownership="none">
5774 <doc xml:whitespace="preserve">value of the alpha channel, between 0 and 255</doc>
5775 <type name="uint8" c:type="guint8"/>
5779 <function name="set_source_texture"
5780 c:identifier="cogl_set_source_texture"
5782 <doc xml:whitespace="preserve">This is a convenience function for creating a material with the first
5783 layer set to #texture_handle and setting that material as the source with
5785 and cogl_set_source_texture. If you need to blend a texture with a color then
5786 you can create a simple material like this:
5787 <programlisting>
5788 material = cogl_material_new ();
5789 cogl_material_set_color4ub (material, 0xff, 0x00, 0x00, 0x80);
5790 cogl_material_set_layer (material, 0, tex_handle);
5791 cogl_set_source (material);
5792 </programlisting></doc>
5793 <return-value transfer-ownership="none">
5794 <type name="none" c:type="void"/>
5797 <parameter name="texture_handle" transfer-ownership="none">
5798 <doc xml:whitespace="preserve">The Cogl texture you want as your source</doc>
5799 <type name="Handle" c:type="CoglHandle"/>
5803 <function name="set_viewport"
5804 c:identifier="cogl_set_viewport"
5806 <doc xml:whitespace="preserve">Replaces the current viewport with the given values.</doc>
5807 <return-value transfer-ownership="none">
5808 <type name="none" c:type="void"/>
5811 <parameter name="x" transfer-ownership="none">
5812 <doc xml:whitespace="preserve">X offset of the viewport</doc>
5813 <type name="int" c:type="int"/>
5815 <parameter name="y" transfer-ownership="none">
5816 <doc xml:whitespace="preserve">Y offset of the viewport</doc>
5817 <type name="int" c:type="int"/>
5819 <parameter name="width" transfer-ownership="none">
5820 <doc xml:whitespace="preserve">Width of the viewport</doc>
5821 <type name="int" c:type="int"/>
5823 <parameter name="height" transfer-ownership="none">
5824 <doc xml:whitespace="preserve">Height of the viewport</doc>
5825 <type name="int" c:type="int"/>
5829 <function name="shader_compile" c:identifier="cogl_shader_compile">
5830 <doc xml:whitespace="preserve">Compiles the shader, no return value, but the shader is now ready for
5831 linking into a program.</doc>
5832 <return-value transfer-ownership="none">
5833 <type name="none" c:type="void"/>
5836 <parameter name="handle" transfer-ownership="none">
5837 <doc xml:whitespace="preserve">#CoglHandle for a shader.</doc>
5838 <type name="Handle" c:type="CoglHandle"/>
5842 <function name="shader_get_info_log"
5843 c:identifier="cogl_shader_get_info_log">
5844 <doc xml:whitespace="preserve">Retrieves the information log for a coglobject, can be used in conjunction
5845 with cogl_shader_get_parameteriv() to retrieve the compiler warnings/error
5846 messages that caused a shader to not compile correctly, mainly useful for
5848 g_free() to free it</doc>
5849 <return-value transfer-ownership="full">
5850 <doc xml:whitespace="preserve">a newly allocated string containing the info log. Use</doc>
5851 <type name="utf8" c:type="char*"/>
5854 <parameter name="handle" transfer-ownership="none">
5855 <doc xml:whitespace="preserve">#CoglHandle for a shader.</doc>
5856 <type name="Handle" c:type="CoglHandle"/>
5860 <function name="shader_get_type" c:identifier="cogl_shader_get_type">
5861 <doc xml:whitespace="preserve">Retrieves the type of a shader #CoglHandle
5862 or %COGL_SHADER_TYPE_FRAGMENT if the shader is a frament processor</doc>
5863 <return-value transfer-ownership="full">
5864 <doc xml:whitespace="preserve">%COGL_SHADER_TYPE_VERTEX if the shader is a vertex processor</doc>
5865 <type name="ShaderType" c:type="CoglShaderType"/>
5868 <parameter name="handle" transfer-ownership="none">
5869 <doc xml:whitespace="preserve">#CoglHandle for a shader.</doc>
5870 <type name="Handle" c:type="CoglHandle"/>
5874 <function name="shader_is_compiled" c:identifier="cogl_shader_is_compiled">
5875 <doc xml:whitespace="preserve">Retrieves whether a shader #CoglHandle has been compiled</doc>
5876 <return-value transfer-ownership="none">
5877 <doc xml:whitespace="preserve">%TRUE if the shader object has sucessfully be compiled</doc>
5878 <type name="boolean" c:type="gboolean"/>
5881 <parameter name="handle" transfer-ownership="none">
5882 <doc xml:whitespace="preserve">#CoglHandle for a shader.</doc>
5883 <type name="Handle" c:type="CoglHandle"/>
5887 <function name="shader_ref" c:identifier="cogl_shader_ref">
5888 <doc xml:whitespace="preserve">Add an extra reference to a shader.</doc>
5889 <return-value transfer-ownership="full">
5890 <doc xml:whitespace="preserve">@handle</doc>
5891 <type name="Handle" c:type="CoglHandle"/>
5894 <parameter name="handle" transfer-ownership="none">
5895 <doc xml:whitespace="preserve">A #CoglHandle to a shader.</doc>
5896 <type name="Handle" c:type="CoglHandle"/>
5900 <function name="shader_source" c:identifier="cogl_shader_source">
5901 <doc xml:whitespace="preserve">Replaces the current GLSL source associated with a shader with a new
5903 <return-value transfer-ownership="none">
5904 <type name="none" c:type="void"/>
5907 <parameter name="shader" transfer-ownership="none">
5908 <doc xml:whitespace="preserve">#CoglHandle for a shader.</doc>
5909 <type name="Handle" c:type="CoglHandle"/>
5911 <parameter name="source" transfer-ownership="none">
5912 <doc xml:whitespace="preserve">GLSL shader source.</doc>
5913 <type name="utf8" c:type="char*"/>
5917 <function name="shader_unref" c:identifier="cogl_shader_unref">
5918 <doc xml:whitespace="preserve">Removes a reference to a shader. If it was the last reference the
5919 shader object will be destroyed.</doc>
5920 <return-value transfer-ownership="none">
5921 <type name="none" c:type="void"/>
5924 <parameter name="handle" transfer-ownership="none">
5925 <doc xml:whitespace="preserve">A #CoglHandle to a shader.</doc>
5926 <type name="Handle" c:type="CoglHandle"/>
5930 <function name="sqrti" c:identifier="cogl_sqrti" version="1.0">
5931 <doc xml:whitespace="preserve">Very fast fixed point implementation of square root for integers.
5932 This function is at least 6x faster than clib sqrt() on x86, and (this is
5933 not a typo!) about 500x faster on ARM without FPU. It's error is less than
5934 5% for arguments smaller than %COGL_SQRTI_ARG_5_PERCENT and less than 10%
5935 for narguments smaller than %COGL_SQRTI_ARG_10_PERCENT. The maximum
5936 argument that can be passed to this function is %COGL_SQRTI_ARG_MAX.</doc>
5937 <return-value transfer-ownership="none">
5938 <doc xml:whitespace="preserve">integer square root.</doc>
5939 <type name="int" c:type="int"/>
5942 <parameter name="x" transfer-ownership="none">
5943 <doc xml:whitespace="preserve">integer value</doc>
5944 <type name="int" c:type="int"/>
5948 <function name="texture_3d_new_from_data_EXP"
5949 c:identifier="cogl_texture_3d_new_from_data_EXP"
5951 <return-value transfer-ownership="full">
5952 <type name="Handle" c:type="CoglHandle"/>
5955 <parameter name="width" transfer-ownership="none">
5956 <type name="uint" c:type="unsigned int"/>
5958 <parameter name="height" transfer-ownership="none">
5959 <type name="uint" c:type="unsigned int"/>
5961 <parameter name="depth" transfer-ownership="none">
5962 <type name="uint" c:type="unsigned int"/>
5964 <parameter name="flags" transfer-ownership="none">
5965 <type name="TextureFlags" c:type="CoglTextureFlags"/>
5967 <parameter name="format" transfer-ownership="none">
5968 <type name="PixelFormat" c:type="CoglPixelFormat"/>
5970 <parameter name="internal_format" transfer-ownership="none">
5971 <type name="PixelFormat" c:type="CoglPixelFormat"/>
5973 <parameter name="rowstride" transfer-ownership="none">
5974 <type name="uint" c:type="unsigned int"/>
5976 <parameter name="image_stride" transfer-ownership="none">
5977 <type name="uint" c:type="unsigned int"/>
5979 <parameter name="data" transfer-ownership="none">
5980 <array c:type="guint8*">
5981 <type name="uint8"/>
5986 <function name="texture_3d_new_with_size_EXP"
5987 c:identifier="cogl_texture_3d_new_with_size_EXP"
5989 <return-value transfer-ownership="full">
5990 <type name="Handle" c:type="CoglHandle"/>
5993 <parameter name="width" transfer-ownership="none">
5994 <type name="uint" c:type="unsigned int"/>
5996 <parameter name="height" transfer-ownership="none">
5997 <type name="uint" c:type="unsigned int"/>
5999 <parameter name="depth" transfer-ownership="none">
6000 <type name="uint" c:type="unsigned int"/>
6002 <parameter name="flags" transfer-ownership="none">
6003 <type name="TextureFlags" c:type="CoglTextureFlags"/>
6005 <parameter name="internal_format" transfer-ownership="none">
6006 <type name="PixelFormat" c:type="CoglPixelFormat"/>
6010 <function name="texture_get_data" c:identifier="cogl_texture_get_data">
6011 <doc xml:whitespace="preserve">Copies the pixel data from a cogl texture to system memory.
6013 <return-value transfer-ownership="none">
6014 <doc xml:whitespace="preserve">the size of the texture data in bytes, or 0 if the texture</doc>
6015 <type name="int" c:type="int"/>
6018 <parameter name="handle" transfer-ownership="none">
6019 <doc xml:whitespace="preserve">a #CoglHandle for a texture.</doc>
6020 <type name="Handle" c:type="CoglHandle"/>
6022 <parameter name="format" transfer-ownership="none">
6023 <doc xml:whitespace="preserve">the #CoglPixelFormat to store the texture as.</doc>
6024 <type name="PixelFormat" c:type="CoglPixelFormat"/>
6026 <parameter name="rowstride" transfer-ownership="none">
6027 <doc xml:whitespace="preserve">the rowstride of @data or retrieved from texture if none is specified.</doc>
6028 <type name="uint" c:type="unsigned int"/>
6030 <parameter name="data" transfer-ownership="none">
6031 <doc xml:whitespace="preserve">memory location to write contents of buffer, or %NULL if we're only querying the data size through the return value.</doc>
6032 <array c:type="guint8*">
6033 <type name="uint8"/>
6038 <function name="texture_get_format" c:identifier="cogl_texture_get_format">
6039 <doc xml:whitespace="preserve">Queries the #CoglPixelFormat of a cogl texture.</doc>
6040 <return-value transfer-ownership="full">
6041 <doc xml:whitespace="preserve">the #CoglPixelFormat of the GPU side texture</doc>
6042 <type name="PixelFormat" c:type="CoglPixelFormat"/>
6045 <parameter name="handle" transfer-ownership="none">
6046 <doc xml:whitespace="preserve">a #CoglHandle for a texture.</doc>
6047 <type name="Handle" c:type="CoglHandle"/>
6051 <function name="texture_get_gl_texture"
6052 c:identifier="cogl_texture_get_gl_texture">
6053 <doc xml:whitespace="preserve">Queries the GL handles for a GPU side texture through its #CoglHandle.
6054 If the texture is spliced the data for the first sub texture will be
6056 if the handle was invalid</doc>
6057 <return-value transfer-ownership="none">
6058 <doc xml:whitespace="preserve">%TRUE if the handle was successfully retrieved, %FALSE</doc>
6059 <type name="boolean" c:type="gboolean"/>
6062 <parameter name="handle" transfer-ownership="none">
6063 <doc xml:whitespace="preserve">a #CoglHandle for a texture.</doc>
6064 <type name="Handle" c:type="CoglHandle"/>
6066 <parameter name="out_gl_handle"
6068 caller-allocates="1"
6069 transfer-ownership="none"
6071 <doc xml:whitespace="preserve">pointer to return location for the textures GL handle, or %NULL.</doc>
6072 <type name="GL.uint" c:type="GLuint*"/>
6074 <parameter name="out_gl_target"
6076 caller-allocates="1"
6077 transfer-ownership="none"
6079 <doc xml:whitespace="preserve">pointer to return location for the GL target type, or %NULL.</doc>
6080 <type name="GL.enum" c:type="GLenum*"/>
6084 <function name="texture_get_height" c:identifier="cogl_texture_get_height">
6085 <doc xml:whitespace="preserve">Queries the height of a cogl texture.</doc>
6086 <return-value transfer-ownership="none">
6087 <doc xml:whitespace="preserve">the height of the GPU side texture in pixels</doc>
6088 <type name="uint" c:type="unsigned int"/>
6091 <parameter name="handle" transfer-ownership="none">
6092 <doc xml:whitespace="preserve">a #CoglHandle for a texture.</doc>
6093 <type name="Handle" c:type="CoglHandle"/>
6097 <function name="texture_get_max_waste"
6098 c:identifier="cogl_texture_get_max_waste">
6099 <doc xml:whitespace="preserve">Queries the maximum wasted (unused) pixels in one dimension of a GPU side
6101 <return-value transfer-ownership="none">
6102 <doc xml:whitespace="preserve">the maximum waste</doc>
6103 <type name="int" c:type="int"/>
6106 <parameter name="handle" transfer-ownership="none">
6107 <doc xml:whitespace="preserve">a #CoglHandle for a texture.</doc>
6108 <type name="Handle" c:type="CoglHandle"/>
6112 <function name="texture_get_rowstride"
6113 c:identifier="cogl_texture_get_rowstride">
6114 <doc xml:whitespace="preserve">Queries the rowstride of a cogl texture.</doc>
6115 <return-value transfer-ownership="none">
6116 <doc xml:whitespace="preserve">the offset in bytes between each consequetive row of pixels</doc>
6117 <type name="uint" c:type="unsigned int"/>
6120 <parameter name="handle" transfer-ownership="none">
6121 <doc xml:whitespace="preserve">a #CoglHandle for a texture.</doc>
6122 <type name="Handle" c:type="CoglHandle"/>
6126 <function name="texture_get_width" c:identifier="cogl_texture_get_width">
6127 <doc xml:whitespace="preserve">Queries the width of a cogl texture.</doc>
6128 <return-value transfer-ownership="none">
6129 <doc xml:whitespace="preserve">the width of the GPU side texture in pixels</doc>
6130 <type name="uint" c:type="unsigned int"/>
6133 <parameter name="handle" transfer-ownership="none">
6134 <doc xml:whitespace="preserve">a #CoglHandle for a texture.</doc>
6135 <type name="Handle" c:type="CoglHandle"/>
6139 <function name="texture_is_sliced" c:identifier="cogl_texture_is_sliced">
6140 <doc xml:whitespace="preserve">Queries if a texture is sliced (stored as multiple GPU side tecture
6142 is stored as a single GPU texture</doc>
6143 <return-value transfer-ownership="none">
6144 <doc xml:whitespace="preserve">%TRUE if the texture is sliced, %FALSE if the texture</doc>
6145 <type name="boolean" c:type="gboolean"/>
6148 <parameter name="handle" transfer-ownership="none">
6149 <doc xml:whitespace="preserve">a #CoglHandle for a texture.</doc>
6150 <type name="Handle" c:type="CoglHandle"/>
6154 <function name="texture_new_from_bitmap"
6155 c:identifier="cogl_texture_new_from_bitmap"
6157 <doc xml:whitespace="preserve">Creates a COGL texture from a CoglBitmap.
6158 %COGL_INVALID_HANDLE on failure</doc>
6159 <return-value transfer-ownership="full">
6160 <doc xml:whitespace="preserve">a #CoglHandle to the newly created texture or</doc>
6161 <type name="Handle" c:type="CoglHandle"/>
6164 <parameter name="bmp_handle" transfer-ownership="none">
6165 <doc xml:whitespace="preserve">A CoglBitmap handle</doc>
6166 <type name="Handle" c:type="CoglHandle"/>
6168 <parameter name="flags" transfer-ownership="none">
6169 <doc xml:whitespace="preserve">Optional flags for the texture, or %COGL_TEXTURE_NONE</doc>
6170 <type name="TextureFlags" c:type="CoglTextureFlags"/>
6172 <parameter name="internal_format" transfer-ownership="none">
6173 <doc xml:whitespace="preserve">the #CoglPixelFormat to use for the GPU storage of the texture</doc>
6174 <type name="PixelFormat" c:type="CoglPixelFormat"/>
6178 <function name="texture_new_from_buffer"
6179 c:identifier="cogl_texture_new_from_buffer"
6181 <doc xml:whitespace="preserve">Creates a new texture using the buffer specified by @handle. If the buffer
6182 has been created using cogl_pixel_buffer_new_for_size() it's possible to omit
6183 the height and width values already specified at creation time.
6185 <return-value transfer-ownership="full">
6186 <doc xml:whitespace="preserve">a #CoglHandle to the new texture or %COGL_INVALID_HANDLE on</doc>
6187 <type name="Handle" c:type="CoglHandle"/>
6190 <parameter name="buffer" transfer-ownership="none">
6191 <doc xml:whitespace="preserve">the #CoglHandle of a pixel buffer</doc>
6192 <type name="Handle" c:type="CoglHandle"/>
6194 <parameter name="width" transfer-ownership="none">
6195 <doc xml:whitespace="preserve">width of texture in pixels or 0</doc>
6196 <type name="uint" c:type="unsigned int"/>
6198 <parameter name="height" transfer-ownership="none">
6199 <doc xml:whitespace="preserve">height of texture in pixels or 0</doc>
6200 <type name="uint" c:type="unsigned int"/>
6202 <parameter name="flags" transfer-ownership="none">
6203 <doc xml:whitespace="preserve">optional flags for the texture, or %COGL_TEXTURE_NONE</doc>
6204 <type name="TextureFlags" c:type="CoglTextureFlags"/>
6206 <parameter name="format" transfer-ownership="none">
6207 <doc xml:whitespace="preserve">the #CoglPixelFormat the buffer is stored in in RAM</doc>
6208 <type name="PixelFormat" c:type="CoglPixelFormat"/>
6210 <parameter name="internal_format" transfer-ownership="none">
6211 <doc xml:whitespace="preserve">the #CoglPixelFormat that will be used for storing the buffer on the GPU. If %COGL_PIXEL_FORMAT_ANY is given then a premultiplied format similar to the format of the source data will be used. The default blending equations of Cogl expect premultiplied color data; the main use of passing a non-premultiplied format here is if you have non-premultiplied source data and are going to adjust the blend mode (see cogl_material_set_blend()) or use the data for something other than straight blending</doc>
6212 <type name="PixelFormat" c:type="CoglPixelFormat"/>
6214 <parameter name="rowstride" transfer-ownership="none">
6215 <doc xml:whitespace="preserve">the memory offset in bytes between the starts of scanlines in @data. If 0 is given the row stride will be deduced from</doc>
6216 <type name="uint" c:type="unsigned int"/>
6218 <parameter name="offset" transfer-ownership="none">
6219 <doc xml:whitespace="preserve">offset in bytes in @buffer from where the texture data starts</doc>
6220 <type name="uint" c:type="unsigned int"/>
6224 <function name="texture_new_from_buffer_EXP"
6225 c:identifier="cogl_texture_new_from_buffer_EXP">
6226 <return-value transfer-ownership="full">
6227 <type name="Handle" c:type="CoglHandle"/>
6230 <parameter name="buffer" transfer-ownership="none">
6231 <type name="Handle" c:type="CoglHandle"/>
6233 <parameter name="width" transfer-ownership="none">
6234 <type name="uint" c:type="unsigned int"/>
6236 <parameter name="height" transfer-ownership="none">
6237 <type name="uint" c:type="unsigned int"/>
6239 <parameter name="flags" transfer-ownership="none">
6240 <type name="TextureFlags" c:type="CoglTextureFlags"/>
6242 <parameter name="format" transfer-ownership="none">
6243 <type name="PixelFormat" c:type="CoglPixelFormat"/>
6245 <parameter name="internal_format" transfer-ownership="none">
6246 <type name="PixelFormat" c:type="CoglPixelFormat"/>
6248 <parameter name="rowstride" transfer-ownership="none">
6249 <type name="uint" c:type="unsigned int"/>
6251 <parameter name="offset" transfer-ownership="none">
6252 <type name="uint" c:type="unsigned int"/>
6256 <function name="texture_new_from_data"
6257 c:identifier="cogl_texture_new_from_data"
6259 <doc xml:whitespace="preserve">Creates a new COGL texture based on data residing in memory.
6260 %COGL_INVALID_HANDLE on failure</doc>
6261 <return-value transfer-ownership="full">
6262 <doc xml:whitespace="preserve">a #CoglHandle to the newly created texture or</doc>
6263 <type name="Handle" c:type="CoglHandle"/>
6266 <parameter name="width" transfer-ownership="none">
6267 <doc xml:whitespace="preserve">width of texture in pixels</doc>
6268 <type name="uint" c:type="unsigned int"/>
6270 <parameter name="height" transfer-ownership="none">
6271 <doc xml:whitespace="preserve">height of texture in pixels</doc>
6272 <type name="uint" c:type="unsigned int"/>
6274 <parameter name="flags" transfer-ownership="none">
6275 <doc xml:whitespace="preserve">Optional flags for the texture, or %COGL_TEXTURE_NONE</doc>
6276 <type name="TextureFlags" c:type="CoglTextureFlags"/>
6278 <parameter name="format" transfer-ownership="none">
6279 <doc xml:whitespace="preserve">the #CoglPixelFormat the buffer is stored in in RAM</doc>
6280 <type name="PixelFormat" c:type="CoglPixelFormat"/>
6282 <parameter name="internal_format" transfer-ownership="none">
6283 <doc xml:whitespace="preserve">the #CoglPixelFormat that will be used for storing the buffer on the GPU. If COGL_PIXEL_FORMAT_ANY is given then a premultiplied format similar to the format of the source data will be used. The default blending equations of Cogl expect premultiplied color data; the main use of passing a non-premultiplied format here is if you have non-premultiplied source data and are going to adjust the blend mode (see cogl_material_set_blend()) or use the data for something other than straight blending.</doc>
6284 <type name="PixelFormat" c:type="CoglPixelFormat"/>
6286 <parameter name="rowstride" transfer-ownership="none">
6287 <doc xml:whitespace="preserve">the memory offset in bytes between the starts of scanlines in @data</doc>
6288 <type name="uint" c:type="unsigned int"/>
6290 <parameter name="data" transfer-ownership="none">
6291 <doc xml:whitespace="preserve">pointer the memory region where the source buffer resides</doc>
6292 <array c:type="guint8*">
6293 <type name="uint8"/>
6298 <function name="texture_new_from_file"
6299 c:identifier="cogl_texture_new_from_file"
6302 <doc xml:whitespace="preserve">Creates a COGL texture from an image file.
6303 %COGL_INVALID_HANDLE on failure</doc>
6304 <return-value transfer-ownership="full">
6305 <doc xml:whitespace="preserve">a #CoglHandle to the newly created texture or</doc>
6306 <type name="Handle" c:type="CoglHandle"/>
6309 <parameter name="filename" transfer-ownership="none">
6310 <doc xml:whitespace="preserve">the file to load</doc>
6311 <type name="utf8" c:type="char*"/>
6313 <parameter name="flags" transfer-ownership="none">
6314 <doc xml:whitespace="preserve">Optional flags for the texture, or %COGL_TEXTURE_NONE</doc>
6315 <type name="TextureFlags" c:type="CoglTextureFlags"/>
6317 <parameter name="internal_format" transfer-ownership="none">
6318 <doc xml:whitespace="preserve">the #CoglPixelFormat to use for the GPU storage of the texture. If %COGL_PIXEL_FORMAT_ANY is given then a premultiplied format similar to the format of the source data will be used. The default blending equations of Cogl expect premultiplied color data; the main use of passing a non-premultiplied format here is if you have non-premultiplied source data and are going to adjust the blend mode (see cogl_material_set_blend()) or use the data for something other than straight blending.</doc>
6319 <type name="PixelFormat" c:type="CoglPixelFormat"/>
6323 <function name="texture_new_from_foreign"
6324 c:identifier="cogl_texture_new_from_foreign"
6326 <doc xml:whitespace="preserve">Creates a COGL texture based on an existing OpenGL texture; the
6327 width, height and format are passed along since it is not always
6328 possible to query these from OpenGL.
6329 The waste arguments allow you to create a Cogl texture that maps to
6330 a region smaller than the real OpenGL texture. For instance if your
6331 hardware only supports power-of-two textures you may load a
6332 non-power-of-two image into a larger power-of-two texture and use
6333 the waste arguments to tell Cogl which region should be mapped to
6334 the texture coordinate range [0:1].
6335 %COGL_INVALID_HANDLE on failure</doc>
6336 <return-value transfer-ownership="full">
6337 <doc xml:whitespace="preserve">a #CoglHandle to the newly created texture or</doc>
6338 <type name="Handle" c:type="CoglHandle"/>
6341 <parameter name="gl_handle" transfer-ownership="none">
6342 <doc xml:whitespace="preserve">opengl handle of foreign texture.</doc>
6343 <type name="GL.uint" c:type="GLuint"/>
6345 <parameter name="gl_target" transfer-ownership="none">
6346 <doc xml:whitespace="preserve">opengl target type of foreign texture</doc>
6347 <type name="GL.enum" c:type="GLenum"/>
6349 <parameter name="width" transfer-ownership="none">
6350 <doc xml:whitespace="preserve">width of foreign texture</doc>
6351 <type name="GL.uint" c:type="GLuint"/>
6353 <parameter name="height" transfer-ownership="none">
6354 <doc xml:whitespace="preserve">height of foreign texture.</doc>
6355 <type name="GL.uint" c:type="GLuint"/>
6357 <parameter name="x_pot_waste" transfer-ownership="none">
6358 <doc xml:whitespace="preserve">horizontal waste on the right hand edge of the texture.</doc>
6359 <type name="GL.uint" c:type="GLuint"/>
6361 <parameter name="y_pot_waste" transfer-ownership="none">
6362 <doc xml:whitespace="preserve">vertical waste on the bottom edge of the texture.</doc>
6363 <type name="GL.uint" c:type="GLuint"/>
6365 <parameter name="format" transfer-ownership="none">
6366 <doc xml:whitespace="preserve">format of the foreign texture.</doc>
6367 <type name="PixelFormat" c:type="CoglPixelFormat"/>
6371 <function name="texture_new_from_sub_texture"
6372 c:identifier="cogl_texture_new_from_sub_texture"
6374 <doc xml:whitespace="preserve">Creates a new texture which represents a subregion of another
6375 texture. The GL resources will be shared so that no new texture
6376 data is actually allocated.
6377 Sub textures have undefined behaviour texture coordinates outside
6378 of the range [0,1] are used. They also do not work with
6380 The sub texture will keep a reference to the full texture so you do
6381 not need to keep one separately if you only want to use the sub
6383 <return-value transfer-ownership="full">
6384 <doc xml:whitespace="preserve">a #CoglHandle to the new texture.</doc>
6385 <type name="Handle" c:type="CoglHandle"/>
6388 <parameter name="full_texture" transfer-ownership="none">
6389 <doc xml:whitespace="preserve">a #CoglHandle to an existing texture</doc>
6390 <type name="Handle" c:type="CoglHandle"/>
6392 <parameter name="sub_x" transfer-ownership="none">
6393 <doc xml:whitespace="preserve">X coordinate of the top-left of the subregion</doc>
6394 <type name="int" c:type="int"/>
6396 <parameter name="sub_y" transfer-ownership="none">
6397 <doc xml:whitespace="preserve">Y coordinate of the top-left of the subregion</doc>
6398 <type name="int" c:type="int"/>
6400 <parameter name="sub_width" transfer-ownership="none">
6401 <doc xml:whitespace="preserve">Width in pixels of the subregion</doc>
6402 <type name="int" c:type="int"/>
6404 <parameter name="sub_height" transfer-ownership="none">
6405 <doc xml:whitespace="preserve">Height in pixels of the subregion</doc>
6406 <type name="int" c:type="int"/>
6410 <function name="texture_new_with_size"
6411 c:identifier="cogl_texture_new_with_size"
6413 <doc xml:whitespace="preserve">Creates a new COGL texture with the specified dimensions and pixel format.
6414 %COGL_INVALID_HANDLE on failure</doc>
6415 <return-value transfer-ownership="full">
6416 <doc xml:whitespace="preserve">a #CoglHandle to the newly created texture or</doc>
6417 <type name="Handle" c:type="CoglHandle"/>
6420 <parameter name="width" transfer-ownership="none">
6421 <doc xml:whitespace="preserve">width of texture in pixels.</doc>
6422 <type name="uint" c:type="unsigned int"/>
6424 <parameter name="height" transfer-ownership="none">
6425 <doc xml:whitespace="preserve">height of texture in pixels.</doc>
6426 <type name="uint" c:type="unsigned int"/>
6428 <parameter name="flags" transfer-ownership="none">
6429 <doc xml:whitespace="preserve">Optional flags for the texture, or %COGL_TEXTURE_NONE</doc>
6430 <type name="TextureFlags" c:type="CoglTextureFlags"/>
6432 <parameter name="internal_format" transfer-ownership="none">
6433 <doc xml:whitespace="preserve">the #CoglPixelFormat to use for the GPU storage of the texture.</doc>
6434 <type name="PixelFormat" c:type="CoglPixelFormat"/>
6438 <function name="texture_pixmap_x11_is_using_tfp_extension_EXP"
6439 c:identifier="cogl_texture_pixmap_x11_is_using_tfp_extension_EXP">
6440 <return-value transfer-ownership="none">
6441 <type name="boolean" c:type="gboolean"/>
6444 <parameter name="handle" transfer-ownership="none">
6445 <type name="Handle" c:type="CoglHandle"/>
6449 <function name="texture_pixmap_x11_new_EXP"
6450 c:identifier="cogl_texture_pixmap_x11_new_EXP">
6451 <return-value transfer-ownership="full">
6452 <type name="Handle" c:type="CoglHandle"/>
6455 <parameter name="pixmap" transfer-ownership="none">
6456 <type name="uint32" c:type="guint32"/>
6458 <parameter name="automatic_updates" transfer-ownership="none">
6459 <type name="boolean" c:type="gboolean"/>
6463 <function name="texture_pixmap_x11_set_damage_object_EXP"
6464 c:identifier="cogl_texture_pixmap_x11_set_damage_object_EXP">
6465 <return-value transfer-ownership="none">
6466 <type name="none" c:type="void"/>
6469 <parameter name="handle" transfer-ownership="none">
6470 <type name="Handle" c:type="CoglHandle"/>
6472 <parameter name="damage" transfer-ownership="none">
6473 <type name="uint32" c:type="guint32"/>
6475 <parameter name="report_level" transfer-ownership="none">
6476 <type name="TexturePixmapX11ReportLevel"
6477 c:type="CoglTexturePixmapX11ReportLevel"/>
6481 <function name="texture_pixmap_x11_update_area_EXP"
6482 c:identifier="cogl_texture_pixmap_x11_update_area_EXP">
6483 <return-value transfer-ownership="none">
6484 <type name="none" c:type="void"/>
6487 <parameter name="handle" transfer-ownership="none">
6488 <type name="Handle" c:type="CoglHandle"/>
6490 <parameter name="x" transfer-ownership="none">
6491 <type name="int" c:type="int"/>
6493 <parameter name="y" transfer-ownership="none">
6494 <type name="int" c:type="int"/>
6496 <parameter name="width" transfer-ownership="none">
6497 <type name="int" c:type="int"/>
6499 <parameter name="height" transfer-ownership="none">
6500 <type name="int" c:type="int"/>
6504 <function name="texture_ref"
6505 c:identifier="cogl_texture_ref"
6506 deprecated="Use cogl_handle_ref() instead"
6507 deprecated-version="1.2">
6508 <doc xml:whitespace="preserve">Increment the reference count for a cogl texture.</doc>
6509 <return-value transfer-ownership="full">
6510 <doc xml:whitespace="preserve">the @handle.</doc>
6511 <type name="Handle" c:type="CoglHandle"/>
6514 <parameter name="handle" transfer-ownership="none">
6515 <doc xml:whitespace="preserve">a @CoglHandle.</doc>
6516 <type name="Handle" c:type="CoglHandle"/>
6520 <function name="texture_set_region" c:identifier="cogl_texture_set_region">
6521 <doc xml:whitespace="preserve">Sets the pixels in a rectangular subregion of @handle from an in-memory
6522 buffer containing pixel data.
6523 %FALSE otherwise</doc>
6524 <return-value transfer-ownership="none">
6525 <doc xml:whitespace="preserve">%TRUE if the subregion upload was successful, and</doc>
6526 <type name="boolean" c:type="gboolean"/>
6529 <parameter name="handle" transfer-ownership="none">
6530 <doc xml:whitespace="preserve">a #CoglHandle.</doc>
6531 <type name="Handle" c:type="CoglHandle"/>
6533 <parameter name="src_x" transfer-ownership="none">
6534 <doc xml:whitespace="preserve">upper left coordinate to use from source data.</doc>
6535 <type name="int" c:type="int"/>
6537 <parameter name="src_y" transfer-ownership="none">
6538 <doc xml:whitespace="preserve">upper left coordinate to use from source data.</doc>
6539 <type name="int" c:type="int"/>
6541 <parameter name="dst_x" transfer-ownership="none">
6542 <doc xml:whitespace="preserve">upper left destination horizontal coordinate.</doc>
6543 <type name="int" c:type="int"/>
6545 <parameter name="dst_y" transfer-ownership="none">
6546 <doc xml:whitespace="preserve">upper left destination vertical coordinate.</doc>
6547 <type name="int" c:type="int"/>
6549 <parameter name="dst_width" transfer-ownership="none">
6550 <doc xml:whitespace="preserve">width of destination region to write.</doc>
6551 <type name="uint" c:type="unsigned int"/>
6553 <parameter name="dst_height" transfer-ownership="none">
6554 <doc xml:whitespace="preserve">height of destination region to write.</doc>
6555 <type name="uint" c:type="unsigned int"/>
6557 <parameter name="width" transfer-ownership="none">
6558 <doc xml:whitespace="preserve">width of source data buffer.</doc>
6559 <type name="int" c:type="int"/>
6561 <parameter name="height" transfer-ownership="none">
6562 <doc xml:whitespace="preserve">height of source data buffer.</doc>
6563 <type name="int" c:type="int"/>
6565 <parameter name="format" transfer-ownership="none">
6566 <doc xml:whitespace="preserve">the #CoglPixelFormat used in the source buffer.</doc>
6567 <type name="PixelFormat" c:type="CoglPixelFormat"/>
6569 <parameter name="rowstride" transfer-ownership="none">
6570 <doc xml:whitespace="preserve">rowstride of source buffer (computed from width if none specified)</doc>
6571 <type name="uint" c:type="unsigned int"/>
6573 <parameter name="data" transfer-ownership="none">
6574 <doc xml:whitespace="preserve">the actual pixel data.</doc>
6575 <array c:type="guint8*">
6576 <type name="uint8"/>
6581 <function name="texture_unref"
6582 c:identifier="cogl_texture_unref"
6583 deprecated="Use cogl_handle_unref() instead"
6584 deprecated-version="1.2">
6585 <doc xml:whitespace="preserve">Decrement the reference count for a cogl texture.</doc>
6586 <return-value transfer-ownership="none">
6587 <type name="none" c:type="void"/>
6590 <parameter name="handle" transfer-ownership="none">
6591 <doc xml:whitespace="preserve">a @CoglHandle.</doc>
6592 <type name="Handle" c:type="CoglHandle"/>
6596 <function name="transform" c:identifier="cogl_transform" version="1.4">
6597 <doc xml:whitespace="preserve">Multiplies the current model-view matrix by the given matrix.</doc>
6598 <return-value transfer-ownership="none">
6599 <type name="none" c:type="void"/>
6602 <parameter name="matrix" transfer-ownership="none">
6603 <doc xml:whitespace="preserve">the matrix to multiply with the current model-view</doc>
6604 <type name="Matrix" c:type="CoglMatrix*"/>
6608 <function name="translate" c:identifier="cogl_translate">
6609 <doc xml:whitespace="preserve">Multiplies the current model-view matrix by one that translates the
6610 model along all three axes according to the given values.</doc>
6611 <return-value transfer-ownership="none">
6612 <type name="none" c:type="void"/>
6615 <parameter name="x" transfer-ownership="none">
6616 <doc xml:whitespace="preserve">Distance to translate along the x-axis</doc>
6617 <type name="float" c:type="float"/>
6619 <parameter name="y" transfer-ownership="none">
6620 <doc xml:whitespace="preserve">Distance to translate along the y-axis</doc>
6621 <type name="float" c:type="float"/>
6623 <parameter name="z" transfer-ownership="none">
6624 <doc xml:whitespace="preserve">Distance to translate along the z-axis</doc>
6625 <type name="float" c:type="float"/>
6629 <function name="vector3_equal_EXP" c:identifier="cogl_vector3_equal_EXP">
6630 <return-value transfer-ownership="none">
6631 <type name="boolean" c:type="gboolean"/>
6634 <parameter name="v1" transfer-ownership="none">
6635 <type name="any" c:type="gconstpointer"/>
6637 <parameter name="v2" transfer-ownership="none">
6638 <type name="any" c:type="gconstpointer"/>
6642 <function name="vertex_buffer_add" c:identifier="cogl_vertex_buffer_add">
6643 <doc xml:whitespace="preserve">Adds an attribute to a buffer.
6644 You either can use one of the built-in names such as "gl_Vertex", or
6645 "gl_MultiTexCoord0" to add standard attributes, like positions, colors
6646 and normals, or you can add custom attributes for use in shaders.
6647 The number of vertices declared when calling cogl_vertex_buffer_new()
6648 determines how many attribute values will be read from the supplied
6649 The data for your attribute isn't copied anywhere until you call
6650 cogl_vertex_buffer_submit(), or issue a draw call which automatically
6651 submits pending attribute changes. so the supplied pointer must remain
6652 valid until then. If you are updating an existing attribute (done by
6653 re-adding it) then you still need to re-call cogl_vertex_buffer_submit()
6654 to commit the changes to the GPU. Be carefull to minimize the number
6655 of calls to cogl_vertex_buffer_submit(), though.
6656 <note>If you are interleving attributes it is assumed that each interleaved
6657 attribute starts no farther than +- stride bytes from the other attributes
6658 it is interleved with. I.e. this is ok:
6659 <programlisting>
6660 |-0-0-0-0-0-0-0-0-0-0|
6661 </programlisting>
6663 <programlisting>
6664 |- - - - -0-0-0-0-0-0 0 0 0 0|
6665 </programlisting>
6666 (Though you can have multiple groups of interleved attributes)</note></doc>
6667 <return-value transfer-ownership="none">
6668 <type name="none" c:type="void"/>
6671 <parameter name="handle" transfer-ownership="none">
6672 <doc xml:whitespace="preserve">A vertex buffer handle</doc>
6673 <type name="Handle" c:type="CoglHandle"/>
6675 <parameter name="attribute_name" transfer-ownership="none">
6676 <doc xml:whitespace="preserve">The name of your attribute. It should be a valid GLSL variable name and standard attribute types must use one of following built-in names: (Note: they correspond to the built-in names of GLSL) <itemizedlist> <listitem>"gl_Color"</listitem> <listitem>"gl_Normal"</listitem> <listitem>"gl_MultiTexCoord0, gl_MultiTexCoord1, ..."</listitem> <listitem>"gl_Vertex"</listitem> </itemizedlist> To support adding multiple variations of the same attribute the name can have a detail component, E.g. "gl_Color::active" or "gl_Color::inactive"</doc>
6677 <type name="utf8" c:type="char*"/>
6679 <parameter name="n_components" transfer-ownership="none">
6680 <doc xml:whitespace="preserve">The number of components per attribute and must be 1, 2, 3 or 4</doc>
6681 <type name="uint8" c:type="guint8"/>
6683 <parameter name="type" transfer-ownership="none">
6684 <doc xml:whitespace="preserve">a #CoglAttributeType specifying the data type of each component.</doc>
6685 <type name="AttributeType" c:type="CoglAttributeType"/>
6687 <parameter name="normalized" transfer-ownership="none">
6688 <doc xml:whitespace="preserve">If %TRUE, this specifies that values stored in an integer format should be mapped into the range [-1.0, 1.0] or [0.0, 1.0] for unsigned values. If %FALSE they are converted to floats directly.</doc>
6689 <type name="boolean" c:type="gboolean"/>
6691 <parameter name="stride" transfer-ownership="none">
6692 <doc xml:whitespace="preserve">This specifies the number of bytes from the start of one attribute value to the start of the next value (for the same attribute). So, for example, with a position interleved with color like this: XYRGBAXYRGBAXYRGBA, then if each letter represents a byte, the stride for both attributes is 6. The special value 0 means the values are stored sequentially in memory.</doc>
6693 <type name="uint16" c:type="guint16"/>
6695 <parameter name="pointer" transfer-ownership="none">
6696 <doc xml:whitespace="preserve">This addresses the first attribute in the vertex array. This must remain valid until you either call cogl_vertex_buffer_submit() or issue a draw call.</doc>
6697 <type name="any" c:type="void*"/>
6701 <function name="vertex_buffer_delete"
6702 c:identifier="cogl_vertex_buffer_delete">
6703 <doc xml:whitespace="preserve">Deletes an attribute from a buffer. You will need to call
6704 cogl_vertex_buffer_submit() or issue a draw call to commit this
6705 change to the GPU.</doc>
6706 <return-value transfer-ownership="none">
6707 <type name="none" c:type="void"/>
6710 <parameter name="handle" transfer-ownership="none">
6711 <doc xml:whitespace="preserve">A vertex buffer handle</doc>
6712 <type name="Handle" c:type="CoglHandle"/>
6714 <parameter name="attribute_name" transfer-ownership="none">
6715 <doc xml:whitespace="preserve">The name of a previously added attribute</doc>
6716 <type name="utf8" c:type="char*"/>
6720 <function name="vertex_buffer_disable"
6721 c:identifier="cogl_vertex_buffer_disable">
6722 <doc xml:whitespace="preserve">Disables a previosuly added attribute.
6723 Since it can be costly to add and remove new attributes to buffers; to make
6724 individual buffers more reuseable it is possible to enable and disable
6725 attributes before using a buffer for drawing.
6726 You don't need to call cogl_vertex_buffer_submit() after using this
6728 <return-value transfer-ownership="none">
6729 <type name="none" c:type="void"/>
6732 <parameter name="handle" transfer-ownership="none">
6733 <doc xml:whitespace="preserve">A vertex buffer handle</doc>
6734 <type name="Handle" c:type="CoglHandle"/>
6736 <parameter name="attribute_name" transfer-ownership="none">
6737 <doc xml:whitespace="preserve">The name of the attribute you want to disable</doc>
6738 <type name="utf8" c:type="char*"/>
6742 <function name="vertex_buffer_draw" c:identifier="cogl_vertex_buffer_draw">
6743 <doc xml:whitespace="preserve">Allows you to draw geometry using all or a subset of the
6744 vertices in a vertex buffer.
6745 Any un-submitted attribute changes are automatically submitted before
6747 <return-value transfer-ownership="none">
6748 <type name="none" c:type="void"/>
6751 <parameter name="handle" transfer-ownership="none">
6752 <doc xml:whitespace="preserve">A vertex buffer handle</doc>
6753 <type name="Handle" c:type="CoglHandle"/>
6755 <parameter name="mode" transfer-ownership="none">
6756 <doc xml:whitespace="preserve">A #CoglVerticesMode specifying how the vertices should be interpreted.</doc>
6757 <type name="VerticesMode" c:type="CoglVerticesMode"/>
6759 <parameter name="first" transfer-ownership="none">
6760 <doc xml:whitespace="preserve">Specifies the index of the first vertex you want to draw with</doc>
6761 <type name="int" c:type="int"/>
6763 <parameter name="count" transfer-ownership="none">
6764 <doc xml:whitespace="preserve">Specifies the number of vertices you want to draw.</doc>
6765 <type name="int" c:type="int"/>
6769 <function name="vertex_buffer_draw_elements"
6770 c:identifier="cogl_vertex_buffer_draw_elements">
6771 <doc xml:whitespace="preserve">This function lets you use an array of indices to specify the vertices
6772 within your vertex buffer that you want to draw. The indices themselves
6773 are created by calling cogl_vertex_buffer_indices_new ()
6774 Any un-submitted attribute changes are automatically submitted before
6776 <return-value transfer-ownership="none">
6777 <type name="none" c:type="void"/>
6780 <parameter name="handle" transfer-ownership="none">
6781 <doc xml:whitespace="preserve">A vertex buffer handle</doc>
6782 <type name="Handle" c:type="CoglHandle"/>
6784 <parameter name="mode" transfer-ownership="none">
6785 <doc xml:whitespace="preserve">A #CoglVerticesMode specifying how the vertices should be interpreted.</doc>
6786 <type name="VerticesMode" c:type="CoglVerticesMode"/>
6788 <parameter name="indices" transfer-ownership="none">
6789 <doc xml:whitespace="preserve">A CoglHandle for a set of indices allocated via cogl_vertex_buffer_indices_new ()</doc>
6790 <type name="Handle" c:type="CoglHandle"/>
6792 <parameter name="min_index" transfer-ownership="none">
6793 <doc xml:whitespace="preserve">Specifies the minimum vertex index contained in indices</doc>
6794 <type name="int" c:type="int"/>
6796 <parameter name="max_index" transfer-ownership="none">
6797 <doc xml:whitespace="preserve">Specifies the maximum vertex index contained in indices</doc>
6798 <type name="int" c:type="int"/>
6800 <parameter name="indices_offset" transfer-ownership="none">
6801 <doc xml:whitespace="preserve">An offset into named indices. The offset marks the first index to use for drawing.</doc>
6802 <type name="int" c:type="int"/>
6804 <parameter name="count" transfer-ownership="none">
6805 <doc xml:whitespace="preserve">Specifies the number of vertices you want to draw.</doc>
6806 <type name="int" c:type="int"/>
6810 <function name="vertex_buffer_enable"
6811 c:identifier="cogl_vertex_buffer_enable">
6812 <doc xml:whitespace="preserve">Enables a previosuly disabled attribute.
6813 Since it can be costly to add and remove new attributes to buffers; to make
6814 individual buffers more reuseable it is possible to enable and disable
6815 attributes before using a buffer for drawing.
6816 You don't need to call cogl_vertex_buffer_submit() after using this function</doc>
6817 <return-value transfer-ownership="none">
6818 <type name="none" c:type="void"/>
6821 <parameter name="handle" transfer-ownership="none">
6822 <doc xml:whitespace="preserve">A vertex buffer handle</doc>
6823 <type name="Handle" c:type="CoglHandle"/>
6825 <parameter name="attribute_name" transfer-ownership="none">
6826 <doc xml:whitespace="preserve">The name of the attribute you want to enable</doc>
6827 <type name="utf8" c:type="char*"/>
6831 <function name="vertex_buffer_get_n_vertices"
6832 c:identifier="cogl_vertex_buffer_get_n_vertices">
6833 <doc xml:whitespace="preserve">Retrieves the number of vertices that @handle represents</doc>
6834 <return-value transfer-ownership="none">
6835 <doc xml:whitespace="preserve">the number of vertices</doc>
6836 <type name="uint" c:type="unsigned int"/>
6839 <parameter name="handle" transfer-ownership="none">
6840 <doc xml:whitespace="preserve">A vertex buffer handle</doc>
6841 <type name="Handle" c:type="CoglHandle"/>
6845 <function name="vertex_buffer_indices_get_for_quads"
6846 c:identifier="cogl_vertex_buffer_indices_get_for_quads">
6847 <doc xml:whitespace="preserve">Creates a vertex buffer containing the indices needed to draw pairs
6848 of triangles from a list of vertices grouped as quads. There will
6849 be at least @n_indices entries in the buffer (but there may be
6851 The indices will follow this pattern:
6852 0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7 ... etc
6853 For example, if you submit vertices for a quad like like that shown
6854 in <xref linkend="quad-indices-order"/> then you can request 6
6855 indices to render two triangles like those shown in <xref
6856 linkend="quad-indices-triangles"/>.
6857 <figure id="quad-indices-order">
6858 <title>Example of vertices submitted to form a quad</title>
6859 <graphic fileref="quad-indices-order.png" format="PNG"/>
6861 <figure id="quad-indices-triangles">
6862 <title>Illustration of the triangle indices that will be generated</title>
6863 <graphic fileref="quad-indices-triangles.png" format="PNG"/>
6865 owned by Cogl and should not be modified or unref'd.</doc>
6866 <return-value transfer-ownership="full">
6867 <doc xml:whitespace="preserve">A %CoglHandle containing the indices. The handled is</doc>
6868 <type name="Handle" c:type="CoglHandle"/>
6871 <parameter name="n_indices" transfer-ownership="none">
6872 <doc xml:whitespace="preserve">the number of indices in the vertex buffer.</doc>
6873 <type name="uint" c:type="unsigned int"/>
6877 <function name="vertex_buffer_indices_get_type"
6878 c:identifier="cogl_vertex_buffer_indices_get_type">
6879 <doc xml:whitespace="preserve">Queries back the data type used for the given indices</doc>
6880 <return-value transfer-ownership="full">
6881 <doc xml:whitespace="preserve">The CoglIndicesType used</doc>
6882 <type name="IndicesType" c:type="CoglIndicesType"/>
6885 <parameter name="indices" transfer-ownership="none">
6886 <type name="Handle" c:type="CoglHandle"/>
6890 <function name="vertex_buffer_indices_new"
6891 c:identifier="cogl_vertex_buffer_indices_new">
6892 <doc xml:whitespace="preserve">Depending on how much geometry you are submitting it can be worthwhile
6893 optimizing the number of redundant vertices you submit. Using an index
6894 array allows you to reference vertices multiple times, for example
6895 during triangle strips.
6896 cogl_vertex_buffer_draw_elements().</doc>
6897 <return-value transfer-ownership="full">
6898 <doc xml:whitespace="preserve">A CoglHandle for the indices which you can pass to</doc>
6899 <type name="Handle" c:type="CoglHandle"/>
6902 <parameter name="indices_type" transfer-ownership="none">
6903 <doc xml:whitespace="preserve">a #CoglIndicesType specifying the data type used for the indices.</doc>
6904 <type name="IndicesType" c:type="CoglIndicesType"/>
6906 <parameter name="indices_array" transfer-ownership="none">
6907 <doc xml:whitespace="preserve">Specifies the address of your array of indices</doc>
6908 <array length="2" c:type="void*">
6912 <parameter name="indices_len" transfer-ownership="none">
6913 <doc xml:whitespace="preserve">The number of indices in indices_array</doc>
6914 <type name="int" c:type="int"/>
6918 <function name="vertex_buffer_new" c:identifier="cogl_vertex_buffer_new">
6919 <doc xml:whitespace="preserve">Creates a new vertex buffer that you can use to add attributes.</doc>
6920 <return-value transfer-ownership="full">
6921 <doc xml:whitespace="preserve">a new #CoglHandle</doc>
6922 <type name="Handle" c:type="CoglHandle"/>
6925 <parameter name="n_vertices" transfer-ownership="none">
6926 <doc xml:whitespace="preserve">The number of vertices that your attributes will correspond to.</doc>
6927 <type name="uint" c:type="unsigned int"/>
6931 <function name="vertex_buffer_ref"
6932 c:identifier="cogl_vertex_buffer_ref"
6933 deprecated="Use cogl_handle_ref() instead"
6934 deprecated-version="1.2">
6935 <doc xml:whitespace="preserve">Increment the reference count for a vertex buffer</doc>
6936 <return-value transfer-ownership="full">
6937 <doc xml:whitespace="preserve">the @handle.</doc>
6938 <type name="Handle" c:type="CoglHandle"/>
6941 <parameter name="handle" transfer-ownership="none">
6942 <doc xml:whitespace="preserve">a @CoglHandle.</doc>
6943 <type name="Handle" c:type="CoglHandle"/>
6947 <function name="vertex_buffer_submit"
6948 c:identifier="cogl_vertex_buffer_submit">
6949 <doc xml:whitespace="preserve">Submits all the user added attributes to the GPU; once submitted, the
6950 attributes can be used for drawing.
6951 You should aim to minimize calls to this function since it implies
6952 validating your data; it potentially incurs a transport cost (especially if
6953 you are using GLX indirect rendering) and potentially a format conversion
6954 cost if the GPU doesn't natively support any of the given attribute formats.</doc>
6955 <return-value transfer-ownership="none">
6956 <type name="none" c:type="void"/>
6959 <parameter name="handle" transfer-ownership="none">
6960 <doc xml:whitespace="preserve">A vertex buffer handle</doc>
6961 <type name="Handle" c:type="CoglHandle"/>
6965 <function name="vertex_buffer_unref"
6966 c:identifier="cogl_vertex_buffer_unref"
6967 deprecated="Use cogl_handle_unref() instead"
6968 deprecated-version="1.2">
6969 <doc xml:whitespace="preserve">Decrement the reference count for a vertex buffer</doc>
6970 <return-value transfer-ownership="none">
6971 <type name="none" c:type="void"/>
6974 <parameter name="handle" transfer-ownership="none">
6975 <doc xml:whitespace="preserve">a @CoglHandle.</doc>
6976 <type name="Handle" c:type="CoglHandle"/>
6980 <function name="viewport"
6981 c:identifier="cogl_viewport"
6983 deprecated="Use cogl_set_viewport() instead"
6984 deprecated-version="1.2">
6985 <doc xml:whitespace="preserve">Replace the current viewport with the given values.</doc>
6986 <return-value transfer-ownership="none">
6987 <type name="none" c:type="void"/>
6990 <parameter name="width" transfer-ownership="none">
6991 <doc xml:whitespace="preserve">Width of the viewport</doc>
6992 <type name="uint" c:type="unsigned int"/>
6994 <parameter name="height" transfer-ownership="none">
6995 <doc xml:whitespace="preserve">Height of the viewport</doc>
6996 <type name="uint" c:type="unsigned int"/>