~oem-solutions-group/unity-2d/clutter-1.0

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>General API</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="COGL Reference Manual">
<link rel="up" href="ch01.html" title="COGL - GL Abstraction API">
<link rel="prev" href="ch01.html" title="COGL - GL Abstraction API">
<link rel="next" href="cogl-Color-Type.html" title="Color Type">
<meta name="generator" content="GTK-Doc V1.13 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="ch01.html" title="COGL - GL Abstraction API">
<link rel="chapter" href="ch02.html" title="COGL experimental API">
<link rel="index" href="ix01.html" title="Index of all symbols">
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
<link rel="index" href="ix03.html" title="Index of new symbols in 0.8">
<link rel="index" href="ix04.html" title="Index of new symbols in 1.0">
<link rel="index" href="ix05.html" title="Index of new symbols in 1.2">
<link rel="appendix" href="license.html" title="Appendix A. License">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="ch01.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">COGL Reference Manual</th>
<td><a accesskey="n" href="cogl-Color-Type.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#cogl-General-API.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#cogl-General-API.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry" title="General API">
<a name="cogl-General-API"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="cogl-General-API.top_of_page"></a>General API</span></h2>
<p>General API — General purpose API</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="cogl-General-API.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">#define             <a class="link" href="cogl-General-API.html#COGL-INVALID-HANDLE:CAPS" title="COGL_INVALID_HANDLE">COGL_INVALID_HANDLE</a>
typedef             <a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle">CoglHandle</a>;
<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a>          <a class="link" href="cogl-General-API.html#cogl-handle-ref" title="cogl_handle_ref ()">cogl_handle_ref</a>                     (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> handle);
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-handle-unref" title="cogl_handle_unref ()">cogl_handle_unref</a>                   (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> Handle);

<span class="returnvalue">void</span>                (<a class="link" href="cogl-General-API.html#CoglFuncPtr" title="CoglFuncPtr ()">*CoglFuncPtr</a>)                      (void);
enum                <a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a>;
enum                <a class="link" href="cogl-General-API.html#CoglBufferTarget" title="enum CoglBufferTarget">CoglBufferTarget</a>;
enum                <a class="link" href="cogl-General-API.html#CoglBufferBit" title="enum CoglBufferBit">CoglBufferBit</a>;
enum                <a class="link" href="cogl-General-API.html#CoglAttributeType" title="enum CoglAttributeType">CoglAttributeType</a>;

enum                <a class="link" href="cogl-General-API.html#CoglFeatureFlags" title="enum CoglFeatureFlags">CoglFeatureFlags</a>;
<a class="link" href="cogl-General-API.html#CoglFeatureFlags" title="enum CoglFeatureFlags"><span class="returnvalue">CoglFeatureFlags</span></a>    <a class="link" href="cogl-General-API.html#cogl-get-features" title="cogl_get_features ()">cogl_get_features</a>                   (void);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="cogl-General-API.html#cogl-features-available" title="cogl_features_available ()">cogl_features_available</a>             (<a class="link" href="cogl-General-API.html#CoglFeatureFlags" title="enum CoglFeatureFlags"><span class="returnvalue">CoglFeatureFlags</span></a> features);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="cogl-General-API.html#cogl-check-extension" title="cogl_check_extension ()">cogl_check_extension</a>                (const <span class="returnvalue">char</span> *name,
                                                         const <span class="returnvalue">char</span> *ext);
<a class="link" href="cogl-General-API.html#CoglFuncPtr" title="CoglFuncPtr ()"><span class="returnvalue">CoglFuncPtr</span></a>         <a class="link" href="cogl-General-API.html#cogl-get-proc-address" title="cogl_get_proc_address ()">cogl_get_proc_address</a>               (const <span class="returnvalue">char</span> *name);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionGroup"><span class="returnvalue">GOptionGroup</span></a> *      <a class="link" href="cogl-General-API.html#cogl-get-option-group" title="cogl_get_option_group ()">cogl_get_option_group</a>               (void);

<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-push-matrix" title="cogl_push_matrix ()">cogl_push_matrix</a>                    (void);
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-pop-matrix" title="cogl_pop_matrix ()">cogl_pop_matrix</a>                     (void);
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-scale" title="cogl_scale ()">cogl_scale</a>                          (<span class="returnvalue">float</span> x,
                                                         <span class="returnvalue">float</span> y,
                                                         <span class="returnvalue">float</span> z);
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-translate" title="cogl_translate ()">cogl_translate</a>                      (<span class="returnvalue">float</span> x,
                                                         <span class="returnvalue">float</span> y,
                                                         <span class="returnvalue">float</span> z);
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-rotate" title="cogl_rotate ()">cogl_rotate</a>                         (<span class="returnvalue">float</span> angle,
                                                         <span class="returnvalue">float</span> x,
                                                         <span class="returnvalue">float</span> y,
                                                         <span class="returnvalue">float</span> z);
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-frustum" title="cogl_frustum ()">cogl_frustum</a>                        (<span class="returnvalue">float</span> left,
                                                         <span class="returnvalue">float</span> right,
                                                         <span class="returnvalue">float</span> bottom,
                                                         <span class="returnvalue">float</span> top,
                                                         <span class="returnvalue">float</span> z_near,
                                                         <span class="returnvalue">float</span> z_far);
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-perspective" title="cogl_perspective ()">cogl_perspective</a>                    (<span class="returnvalue">float</span> fovy,
                                                         <span class="returnvalue">float</span> aspect,
                                                         <span class="returnvalue">float</span> z_near,
                                                         <span class="returnvalue">float</span> z_far);
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-ortho" title="cogl_ortho ()">cogl_ortho</a>                          (<span class="returnvalue">float</span> left,
                                                         <span class="returnvalue">float</span> right,
                                                         <span class="returnvalue">float</span> bottom,
                                                         <span class="returnvalue">float</span> top,
                                                         <span class="returnvalue">float</span> near,
                                                         <span class="returnvalue">float</span> far);

<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-get-modelview-matrix" title="cogl_get_modelview_matrix ()">cogl_get_modelview_matrix</a>           (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix);
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-set-modelview-matrix" title="cogl_set_modelview_matrix ()">cogl_set_modelview_matrix</a>           (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix);
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-get-projection-matrix" title="cogl_get_projection_matrix ()">cogl_get_projection_matrix</a>          (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix);
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-set-projection-matrix" title="cogl_set_projection_matrix ()">cogl_set_projection_matrix</a>          (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix);
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-viewport" title="cogl_viewport ()">cogl_viewport</a>                       (unsigned <span class="returnvalue">int</span> width,
                                                         unsigned <span class="returnvalue">int</span> height);
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-set-viewport" title="cogl_set_viewport ()">cogl_set_viewport</a>                   (<span class="returnvalue">int</span> x,
                                                         <span class="returnvalue">int</span> y,
                                                         <span class="returnvalue">int</span> width,
                                                         <span class="returnvalue">int</span> height);
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-get-viewport" title="cogl_get_viewport ()">cogl_get_viewport</a>                   (<span class="returnvalue">float</span> v[4]);

<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-clear" title="cogl_clear ()">cogl_clear</a>                          (const <a class="link" href="cogl-Color-Type.html#CoglColor" title="CoglColor"><span class="returnvalue">CoglColor</span></a> *color,
                                                         <span class="returnvalue">unsigned long </span> buffers);
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-get-bitmasks" title="cogl_get_bitmasks ()">cogl_get_bitmasks</a>                   (<span class="returnvalue">int</span> *red,
                                                         <span class="returnvalue">int</span> *green,
                                                         <span class="returnvalue">int</span> *blue,
                                                         <span class="returnvalue">int</span> *alpha);
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-set-depth-test-enabled" title="cogl_set_depth_test_enabled ()">cogl_set_depth_test_enabled</a>         (<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> setting);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="cogl-General-API.html#cogl-get-depth-test-enabled" title="cogl_get_depth_test_enabled ()">cogl_get_depth_test_enabled</a>         (void);
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-set-backface-culling-enabled" title="cogl_set_backface_culling_enabled ()">cogl_set_backface_culling_enabled</a>   (<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> setting);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="cogl-General-API.html#cogl-get-backface-culling-enabled" title="cogl_get_backface_culling_enabled ()">cogl_get_backface_culling_enabled</a>   (void);

enum                <a class="link" href="cogl-General-API.html#CoglFogMode" title="enum CoglFogMode">CoglFogMode</a>;
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-set-fog" title="cogl_set_fog ()">cogl_set_fog</a>                        (const <a class="link" href="cogl-Color-Type.html#CoglColor" title="CoglColor"><span class="returnvalue">CoglColor</span></a> *fog_color,
                                                         <a class="link" href="cogl-General-API.html#CoglFogMode" title="enum CoglFogMode"><span class="returnvalue">CoglFogMode</span></a> mode,
                                                         <span class="returnvalue">float</span> density,
                                                         <span class="returnvalue">float</span> z_near,
                                                         <span class="returnvalue">float</span> z_far);
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-disable-fog" title="cogl_disable_fog ()">cogl_disable_fog</a>                    (void);

<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-set-source" title="cogl_set_source ()">cogl_set_source</a>                     (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> material);
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-set-source-color" title="cogl_set_source_color ()">cogl_set_source_color</a>               (const <a class="link" href="cogl-Color-Type.html#CoglColor" title="CoglColor"><span class="returnvalue">CoglColor</span></a> *color);
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-set-source-color4ub" title="cogl_set_source_color4ub ()">cogl_set_source_color4ub</a>            (<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="returnvalue">guint8</span></a> red,
                                                         <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="returnvalue">guint8</span></a> green,
                                                         <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="returnvalue">guint8</span></a> blue,
                                                         <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="returnvalue">guint8</span></a> alpha);
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-set-source-color4f" title="cogl_set_source_color4f ()">cogl_set_source_color4f</a>             (<span class="returnvalue">float</span> red,
                                                         <span class="returnvalue">float</span> green,
                                                         <span class="returnvalue">float</span> blue,
                                                         <span class="returnvalue">float</span> alpha);
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-set-source-texture" title="cogl_set_source_texture ()">cogl_set_source_texture</a>             (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> texture_handle);

enum                <a class="link" href="cogl-General-API.html#CoglReadPixelsFlags" title="enum CoglReadPixelsFlags">CoglReadPixelsFlags</a>;
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-read-pixels" title="cogl_read_pixels ()">cogl_read_pixels</a>                    (<span class="returnvalue">int</span> x,
                                                         <span class="returnvalue">int</span> y,
                                                         <span class="returnvalue">int</span> width,
                                                         <span class="returnvalue">int</span> height,
                                                         <a class="link" href="cogl-General-API.html#CoglReadPixelsFlags" title="enum CoglReadPixelsFlags"><span class="returnvalue">CoglReadPixelsFlags</span></a> source,
                                                         <a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="returnvalue">CoglPixelFormat</span></a> format,
                                                         <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="returnvalue">guint8</span></a> *pixels);

<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-flush" title="cogl_flush ()">cogl_flush</a>                          (void);
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-begin-gl" title="cogl_begin_gl ()">cogl_begin_gl</a>                       (void);
<span class="returnvalue">void</span>                <a class="link" href="cogl-General-API.html#cogl-end-gl" title="cogl_end_gl ()">cogl_end_gl</a>                         (void);
</pre>
</div>
<div class="refsect1" title="Description">
<a name="cogl-General-API.description"></a><h2>Description</h2>
<p>
General utility functions for COGL.</p>
</div>
<div class="refsect1" title="Details">
<a name="cogl-General-API.details"></a><h2>Details</h2>
<div class="refsect2" title="COGL_INVALID_HANDLE">
<a name="COGL-INVALID-HANDLE:CAPS"></a><h3>COGL_INVALID_HANDLE</h3>
<pre class="programlisting">#define COGL_INVALID_HANDLE NULL
</pre>
<p>
A COGL handle that is not valid, used for unitialized handles as well as
error conditions.</p>
</div>
<hr>
<div class="refsect2" title="CoglHandle">
<a name="CoglHandle"></a><h3>CoglHandle</h3>
<pre class="programlisting">typedef gpointer CoglHandle;
</pre>
<p>
Type used for storing references to cogl objects, the CoglHandle is
a fully opaque type without any public data members.</p>
</div>
<hr>
<div class="refsect2" title="cogl_handle_ref ()">
<a name="cogl-handle-ref"></a><h3>cogl_handle_ref ()</h3>
<pre class="programlisting"><a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a>          cogl_handle_ref                     (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> handle);</pre>
<p>
Increases the reference count of <em class="parameter"><code>handle</code></em> by 1</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
<td> a <a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="type">CoglHandle</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the handle, with its reference count increased
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cogl_handle_unref ()">
<a name="cogl-handle-unref"></a><h3>cogl_handle_unref ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_handle_unref                   (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> Handle);</pre>
<p>
Drecreases the reference count of <em class="parameter"><code>handle</code></em> by 1; if the reference
count reaches 0, the resources allocated by <em class="parameter"><code>handle</code></em> will be freed</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>Handle</code></em> :</span></p></td>
<td> a <a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="type">CoglHandle</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="CoglFuncPtr ()">
<a name="CoglFuncPtr"></a><h3>CoglFuncPtr ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                (*CoglFuncPtr)                      (void);</pre>
<p>
The type used by cogl for function pointers, note that this type
is used as a generic catch-all cast for function pointers and the
actual arguments and return type may be different.</p>
</div>
<hr>
<div class="refsect2" title="enum CoglPixelFormat">
<a name="CoglPixelFormat"></a><h3>enum CoglPixelFormat</h3>
<pre class="programlisting">typedef enum { /*&lt; prefix=COGL_PIXEL_FORMAT &gt;*/
  COGL_PIXEL_FORMAT_ANY           = 0,
  COGL_PIXEL_FORMAT_A_8           = 1 | COGL_A_BIT,

  COGL_PIXEL_FORMAT_RGB_565       = 4,
  COGL_PIXEL_FORMAT_RGBA_4444     = 5 | COGL_A_BIT,
  COGL_PIXEL_FORMAT_RGBA_5551     = 6 | COGL_A_BIT,
  COGL_PIXEL_FORMAT_YUV           = 7,
  COGL_PIXEL_FORMAT_G_8           = 8,

  COGL_PIXEL_FORMAT_RGB_888       =  COGL_PIXEL_FORMAT_24,
  COGL_PIXEL_FORMAT_BGR_888       = (COGL_PIXEL_FORMAT_24 | COGL_BGR_BIT),

  COGL_PIXEL_FORMAT_RGBA_8888     = (COGL_PIXEL_FORMAT_32 | COGL_A_BIT),
  COGL_PIXEL_FORMAT_BGRA_8888     = (COGL_PIXEL_FORMAT_32 | COGL_A_BIT | COGL_BGR_BIT),
  COGL_PIXEL_FORMAT_ARGB_8888     = (COGL_PIXEL_FORMAT_32 | COGL_A_BIT | COGL_AFIRST_BIT),
  COGL_PIXEL_FORMAT_ABGR_8888     = (COGL_PIXEL_FORMAT_32 | COGL_A_BIT | COGL_BGR_BIT | COGL_AFIRST_BIT),

  COGL_PIXEL_FORMAT_RGBA_8888_PRE = (COGL_PIXEL_FORMAT_32 | COGL_A_BIT | COGL_PREMULT_BIT),
  COGL_PIXEL_FORMAT_BGRA_8888_PRE = (COGL_PIXEL_FORMAT_32 | COGL_A_BIT | COGL_PREMULT_BIT | COGL_BGR_BIT),
  COGL_PIXEL_FORMAT_ARGB_8888_PRE = (COGL_PIXEL_FORMAT_32 | COGL_A_BIT | COGL_PREMULT_BIT | COGL_AFIRST_BIT),
  COGL_PIXEL_FORMAT_ABGR_8888_PRE = (COGL_PIXEL_FORMAT_32 | COGL_A_BIT | COGL_PREMULT_BIT | COGL_BGR_BIT | COGL_AFIRST_BIT),
  COGL_PIXEL_FORMAT_RGBA_4444_PRE = (COGL_PIXEL_FORMAT_RGBA_4444 | COGL_A_BIT | COGL_PREMULT_BIT),
  COGL_PIXEL_FORMAT_RGBA_5551_PRE = (COGL_PIXEL_FORMAT_RGBA_5551 | COGL_A_BIT | COGL_PREMULT_BIT),
} CoglPixelFormat;
</pre>
<p>
Pixel formats used by COGL. For the formats with a byte per
component, the order of the components specify the order in
increasing memory addresses. So for example
<a class="link" href="cogl-General-API.html#COGL-PIXEL-FORMAT-RGB-888:CAPS"><code class="literal">COGL_PIXEL_FORMAT_RGB_888</code></a> would have the red component in the
lowest address, green in the next address and blue after that
regardless of the endinanness of the system.
</p>
<p>
For the 16-bit formats the component order specifies the order
within a 16-bit number from most significant bit to least
significant. So for <a class="link" href="cogl-General-API.html#COGL-PIXEL-FORMAT-RGB-565:CAPS"><code class="literal">COGL_PIXEL_FORMAT_RGB_565</code></a>, the red component
would be in bits 11-15, the green component would be in 6-11 and
the blue component would be in 1-5. Therefore the order in memory
depends on the endianness of the system.
</p>
<p>
When uploading a texture <a class="link" href="cogl-General-API.html#COGL-PIXEL-FORMAT-ANY:CAPS"><code class="literal">COGL_PIXEL_FORMAT_ANY</code></a> can be used as the
internal format. Cogl will try to pick the best format to use
internally and convert the texture data if necessary.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="COGL-PIXEL-FORMAT-ANY:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_ANY</code></span></p></td>
<td> Any format
</td>
</tr>
<tr>
<td><p><a name="COGL-PIXEL-FORMAT-A-8:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_A_8</code></span></p></td>
<td> 8 bits alpha mask
</td>
</tr>
<tr>
<td><p><a name="COGL-PIXEL-FORMAT-RGB-565:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_RGB_565</code></span></p></td>
<td> RGB, 16 bits
</td>
</tr>
<tr>
<td><p><a name="COGL-PIXEL-FORMAT-RGBA-4444:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_RGBA_4444</code></span></p></td>
<td> RGBA, 16 bits
</td>
</tr>
<tr>
<td><p><a name="COGL-PIXEL-FORMAT-RGBA-5551:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_RGBA_5551</code></span></p></td>
<td> RGBA, 16 bits
</td>
</tr>
<tr>
<td><p><a name="COGL-PIXEL-FORMAT-YUV:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_YUV</code></span></p></td>
<td> Not currently supported
</td>
</tr>
<tr>
<td><p><a name="COGL-PIXEL-FORMAT-G-8:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_G_8</code></span></p></td>
<td> Single luminance component
</td>
</tr>
<tr>
<td><p><a name="COGL-PIXEL-FORMAT-RGB-888:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_RGB_888</code></span></p></td>
<td> RGB, 24 bits
</td>
</tr>
<tr>
<td><p><a name="COGL-PIXEL-FORMAT-BGR-888:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_BGR_888</code></span></p></td>
<td> BGR, 24 bits
</td>
</tr>
<tr>
<td><p><a name="COGL-PIXEL-FORMAT-RGBA-8888:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_RGBA_8888</code></span></p></td>
<td> RGBA, 32 bits
</td>
</tr>
<tr>
<td><p><a name="COGL-PIXEL-FORMAT-BGRA-8888:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_BGRA_8888</code></span></p></td>
<td> BGRA, 32 bits
</td>
</tr>
<tr>
<td><p><a name="COGL-PIXEL-FORMAT-ARGB-8888:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_ARGB_8888</code></span></p></td>
<td> ARGB, 32 bits
</td>
</tr>
<tr>
<td><p><a name="COGL-PIXEL-FORMAT-ABGR-8888:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_ABGR_8888</code></span></p></td>
<td> ABGR, 32 bits
</td>
</tr>
<tr>
<td><p><a name="COGL-PIXEL-FORMAT-RGBA-8888-PRE:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_RGBA_8888_PRE</code></span></p></td>
<td> Premultiplied RGBA, 32 bits
</td>
</tr>
<tr>
<td><p><a name="COGL-PIXEL-FORMAT-BGRA-8888-PRE:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_BGRA_8888_PRE</code></span></p></td>
<td> Premultiplied BGRA, 32 bits
</td>
</tr>
<tr>
<td><p><a name="COGL-PIXEL-FORMAT-ARGB-8888-PRE:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_ARGB_8888_PRE</code></span></p></td>
<td> Premultiplied ARGB, 32 bits
</td>
</tr>
<tr>
<td><p><a name="COGL-PIXEL-FORMAT-ABGR-8888-PRE:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_ABGR_8888_PRE</code></span></p></td>
<td> Premultiplied ABGR, 32 bits
</td>
</tr>
<tr>
<td><p><a name="COGL-PIXEL-FORMAT-RGBA-4444-PRE:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_RGBA_4444_PRE</code></span></p></td>
<td> Premultiplied RGBA, 16 bits
</td>
</tr>
<tr>
<td><p><a name="COGL-PIXEL-FORMAT-RGBA-5551-PRE:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_RGBA_5551_PRE</code></span></p></td>
<td> Premultiplied RGBA, 16 bits
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.8</p>
</div>
<hr>
<div class="refsect2" title="enum CoglBufferTarget">
<a name="CoglBufferTarget"></a><h3>enum CoglBufferTarget</h3>
<pre class="programlisting">typedef enum
{
  COGL_WINDOW_BUFFER      = (1 &lt;&lt; 1),
  COGL_OFFSCREEN_BUFFER   = (1 &lt;&lt; 2)
} CoglBufferTarget;
</pre>
<p>
Target flags for FBOs.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="COGL-WINDOW-BUFFER:CAPS"></a><span class="term"><code class="literal">COGL_WINDOW_BUFFER</code></span></p></td>
<td> FIXME
</td>
</tr>
<tr>
<td><p><a name="COGL-OFFSCREEN-BUFFER:CAPS"></a><span class="term"><code class="literal">COGL_OFFSCREEN_BUFFER</code></span></p></td>
<td> FIXME
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.8</p>
</div>
<hr>
<div class="refsect2" title="enum CoglBufferBit">
<a name="CoglBufferBit"></a><h3>enum CoglBufferBit</h3>
<pre class="programlisting">typedef enum {
  COGL_BUFFER_BIT_COLOR   = 1L&lt;&lt;0,
  COGL_BUFFER_BIT_DEPTH   = 1L&lt;&lt;1,
  COGL_BUFFER_BIT_STENCIL = 1L&lt;&lt;2
} CoglBufferBit;
</pre>
<p>
Types of auxiliary buffers</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="COGL-BUFFER-BIT-COLOR:CAPS"></a><span class="term"><code class="literal">COGL_BUFFER_BIT_COLOR</code></span></p></td>
<td> Selects the primary color buffer
</td>
</tr>
<tr>
<td><p><a name="COGL-BUFFER-BIT-DEPTH:CAPS"></a><span class="term"><code class="literal">COGL_BUFFER_BIT_DEPTH</code></span></p></td>
<td> Selects the depth buffer
</td>
</tr>
<tr>
<td><p><a name="COGL-BUFFER-BIT-STENCIL:CAPS"></a><span class="term"><code class="literal">COGL_BUFFER_BIT_STENCIL</code></span></p></td>
<td> Selects the stencil buffer
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.0</p>
</div>
<hr>
<div class="refsect2" title="enum CoglAttributeType">
<a name="CoglAttributeType"></a><h3>enum CoglAttributeType</h3>
<pre class="programlisting">typedef enum {
  COGL_ATTRIBUTE_TYPE_BYTE = GL_BYTE,
  COGL_ATTRIBUTE_TYPE_UNSIGNED_BYTE = GL_UNSIGNED_BYTE,
  COGL_ATTRIBUTE_TYPE_SHORT = GL_SHORT,
  COGL_ATTRIBUTE_TYPE_UNSIGNED_SHORT = GL_UNSIGNED_SHORT,
  COGL_ATTRIBUTE_TYPE_FLOAT = GL_FLOAT
} CoglAttributeType;
</pre>
<p>
Data types for the components of <a class="link" href="cogl-Vertex-Buffers.html#cogl-vertex-buffer-add" title="cogl_vertex_buffer_add ()"><code class="function">cogl_vertex_buffer_add()</code></a></p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="COGL-ATTRIBUTE-TYPE-BYTE:CAPS"></a><span class="term"><code class="literal">COGL_ATTRIBUTE_TYPE_BYTE</code></span></p></td>
<td> Data is the same size of a byte
</td>
</tr>
<tr>
<td><p><a name="COGL-ATTRIBUTE-TYPE-UNSIGNED-BYTE:CAPS"></a><span class="term"><code class="literal">COGL_ATTRIBUTE_TYPE_UNSIGNED_BYTE</code></span></p></td>
<td> Data is the same size of an
  unsigned byte
</td>
</tr>
<tr>
<td><p><a name="COGL-ATTRIBUTE-TYPE-SHORT:CAPS"></a><span class="term"><code class="literal">COGL_ATTRIBUTE_TYPE_SHORT</code></span></p></td>
<td> Data is the same size of a short integer
</td>
</tr>
<tr>
<td><p><a name="COGL-ATTRIBUTE-TYPE-UNSIGNED-SHORT:CAPS"></a><span class="term"><code class="literal">COGL_ATTRIBUTE_TYPE_UNSIGNED_SHORT</code></span></p></td>
<td> Data is the same size of
  an unsigned short integer
</td>
</tr>
<tr>
<td><p><a name="COGL-ATTRIBUTE-TYPE-FLOAT:CAPS"></a><span class="term"><code class="literal">COGL_ATTRIBUTE_TYPE_FLOAT</code></span></p></td>
<td> Data is the same size of a float
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.0</p>
</div>
<hr>
<div class="refsect2" title="enum CoglFeatureFlags">
<a name="CoglFeatureFlags"></a><h3>enum CoglFeatureFlags</h3>
<pre class="programlisting">typedef enum
{
  COGL_FEATURE_TEXTURE_RECTANGLE      = (1 &lt;&lt; 1),
  COGL_FEATURE_TEXTURE_NPOT           = (1 &lt;&lt; 2),
  COGL_FEATURE_TEXTURE_YUV            = (1 &lt;&lt; 3),
  COGL_FEATURE_TEXTURE_READ_PIXELS    = (1 &lt;&lt; 4),
  COGL_FEATURE_SHADERS_GLSL           = (1 &lt;&lt; 5),
  COGL_FEATURE_OFFSCREEN              = (1 &lt;&lt; 6),
  COGL_FEATURE_OFFSCREEN_MULTISAMPLE  = (1 &lt;&lt; 7),
  COGL_FEATURE_OFFSCREEN_BLIT         = (1 &lt;&lt; 8),
  COGL_FEATURE_FOUR_CLIP_PLANES       = (1 &lt;&lt; 9),
  COGL_FEATURE_STENCIL_BUFFER         = (1 &lt;&lt; 10),
  COGL_FEATURE_VBOS		      = (1 &lt;&lt; 11),
  COGL_FEATURE_PBOS		      = (1 &lt;&lt; 12),
  COGL_FEATURE_UNSIGNED_INT_INDICES   = (1 &lt;&lt; 13)
} CoglFeatureFlags;
</pre>
<p>
Flags for the supported features.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="COGL-FEATURE-TEXTURE-RECTANGLE:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_TEXTURE_RECTANGLE</code></span></p></td>
<td> ARB_texture_rectangle support
</td>
</tr>
<tr>
<td><p><a name="COGL-FEATURE-TEXTURE-NPOT:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_TEXTURE_NPOT</code></span></p></td>
<td> ARB_texture_non_power_of_two support
</td>
</tr>
<tr>
<td><p><a name="COGL-FEATURE-TEXTURE-YUV:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_TEXTURE_YUV</code></span></p></td>
<td> ycbcr conversion support
</td>
</tr>
<tr>
<td><p><a name="COGL-FEATURE-TEXTURE-READ-PIXELS:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_TEXTURE_READ_PIXELS</code></span></p></td>
<td> <code class="function">glReadPixels()</code> support
</td>
</tr>
<tr>
<td><p><a name="COGL-FEATURE-SHADERS-GLSL:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_SHADERS_GLSL</code></span></p></td>
<td> GLSL support
</td>
</tr>
<tr>
<td><p><a name="COGL-FEATURE-OFFSCREEN:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_OFFSCREEN</code></span></p></td>
<td> FBO support
</td>
</tr>
<tr>
<td><p><a name="COGL-FEATURE-OFFSCREEN-MULTISAMPLE:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_OFFSCREEN_MULTISAMPLE</code></span></p></td>
<td> Multisample support on FBOs
</td>
</tr>
<tr>
<td><p><a name="COGL-FEATURE-OFFSCREEN-BLIT:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_OFFSCREEN_BLIT</code></span></p></td>
<td> Blit support on FBOs
</td>
</tr>
<tr>
<td><p><a name="COGL-FEATURE-FOUR-CLIP-PLANES:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_FOUR_CLIP_PLANES</code></span></p></td>
<td> At least 4 clip planes available
</td>
</tr>
<tr>
<td><p><a name="COGL-FEATURE-STENCIL-BUFFER:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_STENCIL_BUFFER</code></span></p></td>
<td> Stencil buffer support
</td>
</tr>
<tr>
<td><p><a name="COGL-FEATURE-VBOS:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_VBOS</code></span></p></td>
<td> VBO support
</td>
</tr>
<tr>
<td><p><a name="COGL-FEATURE-PBOS:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_PBOS</code></span></p></td>
<td> PBO support
</td>
</tr>
<tr>
<td><p><a name="COGL-FEATURE-UNSIGNED-INT-INDICES:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_UNSIGNED_INT_INDICES</code></span></p></td>
<td> Set if
    <a class="link" href="cogl-Vertex-Buffers.html#COGL-INDICES-TYPE-UNSIGNED-INT:CAPS"><code class="literal">COGL_INDICES_TYPE_UNSIGNED_INT</code></a> is supported in
    <a class="link" href="cogl-Vertex-Buffers.html#cogl-vertex-buffer-indices-new" title="cogl_vertex_buffer_indices_new ()"><code class="function">cogl_vertex_buffer_indices_new()</code></a>.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.8</p>
</div>
<hr>
<div class="refsect2" title="cogl_get_features ()">
<a name="cogl-get-features"></a><h3>cogl_get_features ()</h3>
<pre class="programlisting"><a class="link" href="cogl-General-API.html#CoglFeatureFlags" title="enum CoglFeatureFlags"><span class="returnvalue">CoglFeatureFlags</span></a>    cogl_get_features                   (void);</pre>
<p>
Returns all of the features supported by COGL.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A logical OR of all the supported COGL features.

</td>
</tr></tbody>
</table></div>
<p class="since">Since 0.8</p>
</div>
<hr>
<div class="refsect2" title="cogl_features_available ()">
<a name="cogl-features-available"></a><h3>cogl_features_available ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            cogl_features_available             (<a class="link" href="cogl-General-API.html#CoglFeatureFlags" title="enum CoglFeatureFlags"><span class="returnvalue">CoglFeatureFlags</span></a> features);</pre>
<p>
Checks whether the given COGL features are available. Multiple
features can be checked for by or-ing them together with the '|'
operator. <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> is only returned if all of the requested features
are available.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>features</code></em> :</span></p></td>
<td> A bitmask of features to check for
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the features are available, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cogl_check_extension ()">
<a name="cogl-check-extension"></a><h3>cogl_check_extension ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            cogl_check_extension                (const <span class="returnvalue">char</span> *name,
                                                         const <span class="returnvalue">char</span> *ext);</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">cogl_check_extension</code> has been deprecated since version 1.2 and should not be used in newly-written code. OpenGL is an implementation detail for Cogl and so it's
  not appropriate to expose OpenGL extensions through the Cogl API. This
  function can be replaced by the following equivalent code:
</p>
<div class="informalexample"><pre class="programlisting">
  gboolean retval = (strstr (ext, name) != NULL) ? TRUE : FALSE;
</pre></div>
</div>
<p>
Check whether <em class="parameter"><code>name</code></em> occurs in list of extensions in <em class="parameter"><code>ext</code></em>.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td> extension to check for
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>ext</code></em> :</span></p></td>
<td> list of extensions
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the extension occurs in the list, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.

</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cogl_get_proc_address ()">
<a name="cogl-get-proc-address"></a><h3>cogl_get_proc_address ()</h3>
<pre class="programlisting"><a class="link" href="cogl-General-API.html#CoglFuncPtr" title="CoglFuncPtr ()"><span class="returnvalue">CoglFuncPtr</span></a>         cogl_get_proc_address               (const <span class="returnvalue">char</span> *name);</pre>
<p>
Gets a pointer to a given GL or GL ES extension function. This acts
as a wrapper around <code class="function">glXGetProcAddress()</code> or whatever is the
appropriate function for the current backend.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td> the name of the function.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a pointer to the requested function or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the
  function is not available.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cogl_get_option_group ()">
<a name="cogl-get-option-group"></a><h3>cogl_get_option_group ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionGroup"><span class="returnvalue">GOptionGroup</span></a> *      cogl_get_option_group               (void);</pre>
<p>
Retrieves the <a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a> used by COGL to parse the command
line options. Clutter uses this to handle the COGL command line
options during its initialization process.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a <a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a>

</td>
</tr></tbody>
</table></div>
<p class="since">Since 1.0</p>
</div>
<hr>
<div class="refsect2" title="cogl_push_matrix ()">
<a name="cogl-push-matrix"></a><h3>cogl_push_matrix ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_push_matrix                    (void);</pre>
<p>
Stores the current model-view matrix on the matrix stack. The matrix
can later be restored with <a class="link" href="cogl-General-API.html#cogl-pop-matrix" title="cogl_pop_matrix ()"><code class="function">cogl_pop_matrix()</code></a>.</p>
</div>
<hr>
<div class="refsect2" title="cogl_pop_matrix ()">
<a name="cogl-pop-matrix"></a><h3>cogl_pop_matrix ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_pop_matrix                     (void);</pre>
<p>
Restores the current model-view matrix from the matrix stack.</p>
</div>
<hr>
<div class="refsect2" title="cogl_scale ()">
<a name="cogl-scale"></a><h3>cogl_scale ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_scale                          (<span class="returnvalue">float</span> x,
                                                         <span class="returnvalue">float</span> y,
                                                         <span class="returnvalue">float</span> z);</pre>
<p>
Multiplies the current model-view matrix by one that scales the x,
y and z axes by the given values.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
<td> Amount to scale along the x-axis
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
<td> Amount to scale along the y-axis
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>z</code></em> :</span></p></td>
<td> Amount to scale along the z-axis
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cogl_translate ()">
<a name="cogl-translate"></a><h3>cogl_translate ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_translate                      (<span class="returnvalue">float</span> x,
                                                         <span class="returnvalue">float</span> y,
                                                         <span class="returnvalue">float</span> z);</pre>
<p>
Multiplies the current model-view matrix by one that translates the
model along all three axes according to the given values.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
<td> Distance to translate along the x-axis
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
<td> Distance to translate along the y-axis
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>z</code></em> :</span></p></td>
<td> Distance to translate along the z-axis
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cogl_rotate ()">
<a name="cogl-rotate"></a><h3>cogl_rotate ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_rotate                         (<span class="returnvalue">float</span> angle,
                                                         <span class="returnvalue">float</span> x,
                                                         <span class="returnvalue">float</span> y,
                                                         <span class="returnvalue">float</span> z);</pre>
<p>
Multiplies the current model-view matrix by one that rotates the
model around the vertex specified by <em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em> and <em class="parameter"><code>z</code></em>. The rotation
follows the right-hand thumb rule so for example rotating by 10
degrees about the vertex (0, 0, 1) causes a small counter-clockwise
rotation.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>angle</code></em> :</span></p></td>
<td> Angle in degrees to rotate.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
<td> X-component of vertex to rotate around.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
<td> Y-component of vertex to rotate around.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>z</code></em> :</span></p></td>
<td> Z-component of vertex to rotate around.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cogl_frustum ()">
<a name="cogl-frustum"></a><h3>cogl_frustum ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_frustum                        (<span class="returnvalue">float</span> left,
                                                         <span class="returnvalue">float</span> right,
                                                         <span class="returnvalue">float</span> bottom,
                                                         <span class="returnvalue">float</span> top,
                                                         <span class="returnvalue">float</span> z_near,
                                                         <span class="returnvalue">float</span> z_far);</pre>
<p>
Replaces the current projection matrix with a perspective matrix
for the given viewing frustum.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>left</code></em> :</span></p></td>
<td> Left clipping plane
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>right</code></em> :</span></p></td>
<td> Right clipping plane
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>bottom</code></em> :</span></p></td>
<td> Bottom clipping plane
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>top</code></em> :</span></p></td>
<td> Top clipping plane
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>z_near</code></em> :</span></p></td>
<td> Nearest visible point
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>z_far</code></em> :</span></p></td>
<td> Furthest visible point along the z-axis
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.8.2</p>
</div>
<hr>
<div class="refsect2" title="cogl_perspective ()">
<a name="cogl-perspective"></a><h3>cogl_perspective ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_perspective                    (<span class="returnvalue">float</span> fovy,
                                                         <span class="returnvalue">float</span> aspect,
                                                         <span class="returnvalue">float</span> z_near,
                                                         <span class="returnvalue">float</span> z_far);</pre>
<p>
Replaces the current projection matrix with a perspective matrix
based on the provided values.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>fovy</code></em> :</span></p></td>
<td> Vertical of view angle in degrees.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>aspect</code></em> :</span></p></td>
<td> Aspect ratio of diesplay
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>z_near</code></em> :</span></p></td>
<td> Nearest visible point
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>z_far</code></em> :</span></p></td>
<td> Furthest visible point along the z-axis
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cogl_ortho ()">
<a name="cogl-ortho"></a><h3>cogl_ortho ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_ortho                          (<span class="returnvalue">float</span> left,
                                                         <span class="returnvalue">float</span> right,
                                                         <span class="returnvalue">float</span> bottom,
                                                         <span class="returnvalue">float</span> top,
                                                         <span class="returnvalue">float</span> near,
                                                         <span class="returnvalue">float</span> far);</pre>
<p>
Replaces the current projection matrix with a parallel projection
matrix.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>left</code></em> :</span></p></td>
<td> The coordinate for the left clipping plane
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>right</code></em> :</span></p></td>
<td> The coordinate for the right clipping plane
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>bottom</code></em> :</span></p></td>
<td> The coordinate for the bottom clipping plane
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>top</code></em> :</span></p></td>
<td> The coordinate for the top clipping plane
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>near</code></em> :</span></p></td>
<td> The coordinate for the near clipping plane (may be negative if
       the plane is behind the viewer)
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>far</code></em> :</span></p></td>
<td> The coordinate for the far clipping plane (may be negative if
      the plane is behind the viewer)
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.0</p>
</div>
<hr>
<div class="refsect2" title="cogl_get_modelview_matrix ()">
<a name="cogl-get-modelview-matrix"></a><h3>cogl_get_modelview_matrix ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_get_modelview_matrix           (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix);</pre>
<p>
Stores the current model-view matrix in <em class="parameter"><code>matrix</code></em>.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
<td> return location for the model-view matrix. <a href="http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=out"><span class="acronym">out</span></a>. </td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cogl_set_modelview_matrix ()">
<a name="cogl-set-modelview-matrix"></a><h3>cogl_set_modelview_matrix ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_set_modelview_matrix           (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix);</pre>
<p>
Loads <em class="parameter"><code>matrix</code></em> as the new model-view matrix.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
<td> the new model-view matrix
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cogl_get_projection_matrix ()">
<a name="cogl-get-projection-matrix"></a><h3>cogl_get_projection_matrix ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_get_projection_matrix          (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix);</pre>
<p>
Stores the current projection matrix in <em class="parameter"><code>matrix</code></em>.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
<td> return location for the projection matrix. <a href="http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=out"><span class="acronym">out</span></a>. </td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cogl_set_projection_matrix ()">
<a name="cogl-set-projection-matrix"></a><h3>cogl_set_projection_matrix ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_set_projection_matrix          (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix);</pre>
<p>
Loads matrix as the new projection matrix.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
<td> the new projection matrix
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cogl_viewport ()">
<a name="cogl-viewport"></a><h3>cogl_viewport ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_viewport                       (unsigned <span class="returnvalue">int</span> width,
                                                         unsigned <span class="returnvalue">int</span> height);</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">cogl_viewport</code> has been deprecated since version 1.2 and should not be used in newly-written code. Use <a class="link" href="cogl-General-API.html#cogl-set-viewport" title="cogl_set_viewport ()"><code class="function">cogl_set_viewport()</code></a> instead</p>
</div>
<p>
Replace the current viewport with the given values.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
<td> Width of the viewport
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
<td> Height of the viewport
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.8.2</p>
</div>
<hr>
<div class="refsect2" title="cogl_set_viewport ()">
<a name="cogl-set-viewport"></a><h3>cogl_set_viewport ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_set_viewport                   (<span class="returnvalue">int</span> x,
                                                         <span class="returnvalue">int</span> y,
                                                         <span class="returnvalue">int</span> width,
                                                         <span class="returnvalue">int</span> height);</pre>
<p>
Replaces the current viewport with the given values.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
<td> X offset of the viewport
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
<td> Y offset of the viewport
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
<td> Width of the viewport
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
<td> Height of the viewport
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.2</p>
</div>
<hr>
<div class="refsect2" title="cogl_get_viewport ()">
<a name="cogl-get-viewport"></a><h3>cogl_get_viewport ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_get_viewport                   (<span class="returnvalue">float</span> v[4]);</pre>
<p>
Stores the current viewport in <em class="parameter"><code>v</code></em>. <em class="parameter"><code>v</code></em>[0] and <em class="parameter"><code>v</code></em>[1] get the x and y
position of the viewport and <em class="parameter"><code>v</code></em>[2] and <em class="parameter"><code>v</code></em>[3] get the width and
height.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>v</code></em> :</span></p></td>
<td>out) (array fixed-size=4. <a href="http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=out"><span class="acronym">out</span></a>. <a href="http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=array"><span class="acronym">array</span></a> fixed-size=4. </td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cogl_clear ()">
<a name="cogl-clear"></a><h3>cogl_clear ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_clear                          (const <a class="link" href="cogl-Color-Type.html#CoglColor" title="CoglColor"><span class="returnvalue">CoglColor</span></a> *color,
                                                         <span class="returnvalue">unsigned long </span> buffers);</pre>
<p>
Clears all the auxiliary buffers identified in the <em class="parameter"><code>buffers</code></em> mask, and if
that includes the color buffer then the specified <em class="parameter"><code>color</code></em> is used.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>color</code></em> :</span></p></td>
<td> Background color to clear to
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffers</code></em> :</span></p></td>
<td> A mask of <a class="link" href="cogl-General-API.html#CoglBufferBit" title="enum CoglBufferBit"><span class="type">CoglBufferBit</span></a>'s identifying which auxiliary
  buffers to clear
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cogl_get_bitmasks ()">
<a name="cogl-get-bitmasks"></a><h3>cogl_get_bitmasks ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_get_bitmasks                   (<span class="returnvalue">int</span> *red,
                                                         <span class="returnvalue">int</span> *green,
                                                         <span class="returnvalue">int</span> *blue,
                                                         <span class="returnvalue">int</span> *alpha);</pre>
<p>
Gets the number of bitplanes used for each of the color components
in the color buffer. Pass <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for any of the arguments if the
value is not required.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>red</code></em> :</span></p></td>
<td> Return location for the number of red bits or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <a href="http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=out"><span class="acronym">out</span></a>. </td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>green</code></em> :</span></p></td>
<td> Return location for the number of green bits or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <a href="http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=out"><span class="acronym">out</span></a>. </td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>blue</code></em> :</span></p></td>
<td> Return location for the number of blue bits or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <a href="http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=out"><span class="acronym">out</span></a>. </td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>alpha</code></em> :</span></p></td>
<td> Return location for the number of alpha bits or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <a href="http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=out"><span class="acronym">out</span></a>. </td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cogl_set_depth_test_enabled ()">
<a name="cogl-set-depth-test-enabled"></a><h3>cogl_set_depth_test_enabled ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_set_depth_test_enabled         (<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> setting);</pre>
<p>
Sets whether depth testing is enabled. If it is disabled then the
order that actors are layered on the screen depends solely on the
order specified using <a href="../clutter/ClutterActor.html#clutter-actor-raise"><code class="function">clutter_actor_raise()</code></a> and
<a href="../clutter/ClutterActor.html#clutter-actor-lower"><code class="function">clutter_actor_lower()</code></a>, otherwise it will also take into account the
actor's depth. Depth testing is disabled by default.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>setting</code></em> :</span></p></td>
<td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to enable depth testing or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> to disable.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cogl_get_depth_test_enabled ()">
<a name="cogl-get-depth-test-enabled"></a><h3>cogl_get_depth_test_enabled ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            cogl_get_depth_test_enabled         (void);</pre>
<p>
Queries if depth testing has been enabled via <code class="function">cogl_set_depth_test_enable()</code></p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if depth testing is enabled, and <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cogl_set_backface_culling_enabled ()">
<a name="cogl-set-backface-culling-enabled"></a><h3>cogl_set_backface_culling_enabled ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_set_backface_culling_enabled   (<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> setting);</pre>
<p>
Sets whether textures positioned so that their backface is showing
should be hidden. This can be used to efficiently draw two-sided
textures or fully closed cubes without enabling depth testing. This
only affects calls to the cogl_rectangle* family of functions and
cogl_vertex_buffer_draw*. Backface culling is disabled by default.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>setting</code></em> :</span></p></td>
<td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to enable backface culling or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> to disable.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cogl_get_backface_culling_enabled ()">
<a name="cogl-get-backface-culling-enabled"></a><h3>cogl_get_backface_culling_enabled ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            cogl_get_backface_culling_enabled   (void);</pre>
<p>
Queries if backface culling has been enabled via
<a class="link" href="cogl-General-API.html#cogl-set-backface-culling-enabled" title="cogl_set_backface_culling_enabled ()"><code class="function">cogl_set_backface_culling_enabled()</code></a></p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if backface culling is enabled, and <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enum CoglFogMode">
<a name="CoglFogMode"></a><h3>enum CoglFogMode</h3>
<pre class="programlisting">typedef enum {
  COGL_FOG_MODE_LINEAR,
  COGL_FOG_MODE_EXPONENTIAL,
  COGL_FOG_MODE_EXPONENTIAL_SQUARED
} CoglFogMode;
</pre>
<p>
The fog mode determines the equation used to calculate the fogging blend
factor while fogging is enabled. The simplest <a class="link" href="cogl-General-API.html#COGL-FOG-MODE-LINEAR:CAPS"><code class="literal">COGL_FOG_MODE_LINEAR</code></a> mode
determines f as:
</p>
<p>
</p>
<div class="informalexample"><pre class="programlisting">
  f = end - eye_distance / end - start
</pre></div>
<p>
</p>
<p>
Where eye_distance is the distance of the current fragment in eye
coordinates from the origin.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="COGL-FOG-MODE-LINEAR:CAPS"></a><span class="term"><code class="literal">COGL_FOG_MODE_LINEAR</code></span></p></td>
<td> Calculates the fog blend factor as:
<div class="informalexample"><pre class="programlisting">
  f = end - eye_distance / end - start
</pre></div>
</td>
</tr>
<tr>
<td><p><a name="COGL-FOG-MODE-EXPONENTIAL:CAPS"></a><span class="term"><code class="literal">COGL_FOG_MODE_EXPONENTIAL</code></span></p></td>
<td> Calculates the fog blend factor as:
<div class="informalexample"><pre class="programlisting">
  f = e ^ -(density * eye_distance)
</pre></div>
</td>
</tr>
<tr>
<td><p><a name="COGL-FOG-MODE-EXPONENTIAL-SQUARED:CAPS"></a><span class="term"><code class="literal">COGL_FOG_MODE_EXPONENTIAL_SQUARED</code></span></p></td>
<td> Calculates the fog blend factor as:
<div class="informalexample"><pre class="programlisting">
  f = e ^ -(density * eye_distance)^2
</pre></div>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.0</p>
</div>
<hr>
<div class="refsect2" title="cogl_set_fog ()">
<a name="cogl-set-fog"></a><h3>cogl_set_fog ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_set_fog                        (const <a class="link" href="cogl-Color-Type.html#CoglColor" title="CoglColor"><span class="returnvalue">CoglColor</span></a> *fog_color,
                                                         <a class="link" href="cogl-General-API.html#CoglFogMode" title="enum CoglFogMode"><span class="returnvalue">CoglFogMode</span></a> mode,
                                                         <span class="returnvalue">float</span> density,
                                                         <span class="returnvalue">float</span> z_near,
                                                         <span class="returnvalue">float</span> z_far);</pre>
<p>
Enables fogging. Fogging causes vertices that are further away from the eye
to be rendered with a different color. The color is determined according to
the chosen fog mode; at it's simplest the color is linearly interpolated so
that vertices at <em class="parameter"><code>z_near</code></em> are drawn fully with their original color and
vertices at <em class="parameter"><code>z_far</code></em> are drawn fully with <em class="parameter"><code>fog_color</code></em>. Fogging will remain
enabled until you call <a class="link" href="cogl-General-API.html#cogl-disable-fog" title="cogl_disable_fog ()"><code class="function">cogl_disable_fog()</code></a>.
</p>
<p>
</p>
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>The fogging functions only work correctly when primitives use
unmultiplied alpha colors. By default Cogl will premultiply textures
and <a class="link" href="cogl-General-API.html#cogl-set-source-color" title="cogl_set_source_color ()"><code class="function">cogl_set_source_color()</code></a> will premultiply colors, so unless you
explicitly load your textures requesting an unmultiplied internal format
and use <a class="link" href="cogl-Materials.html#cogl-material-set-color" title="cogl_material_set_color ()"><code class="function">cogl_material_set_color()</code></a> you can only use fogging with fully
opaque primitives. This might improve in the future when we can depend
on fragment shaders.</div>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>fog_color</code></em> :</span></p></td>
<td> The color of the fog
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>mode</code></em> :</span></p></td>
<td> A <a class="link" href="cogl-General-API.html#CoglFogMode" title="enum CoglFogMode"><span class="type">CoglFogMode</span></a> that determines the equation used to calculate the
  fogging blend factor.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>density</code></em> :</span></p></td>
<td> Used by <a class="link" href="cogl-General-API.html#COGL-FOG-MODE-EXPONENTIAL:CAPS"><code class="literal">COGL_FOG_MODE_EXPONENTIAL</code></a> and by
  <a class="link" href="cogl-General-API.html#COGL-FOG-MODE-EXPONENTIAL-SQUARED:CAPS"><code class="literal">COGL_FOG_MODE_EXPONENTIAL_SQUARED</code></a> equations.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>z_near</code></em> :</span></p></td>
<td> Position along Z axis where no fogging should be applied
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>z_far</code></em> :</span></p></td>
<td> Position along Z axis where full fogging should be applied
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cogl_disable_fog ()">
<a name="cogl-disable-fog"></a><h3>cogl_disable_fog ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_disable_fog                    (void);</pre>
<p>
This function disables fogging, so primitives drawn afterwards will not be
blended with any previously set fog color.</p>
</div>
<hr>
<div class="refsect2" title="cogl_set_source ()">
<a name="cogl-set-source"></a><h3>cogl_set_source ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_set_source                     (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> material);</pre>
<p>
This function sets the source material that will be used to fill subsequent
geometry emitted via the cogl API.
</p>
<p>
</p>
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>In the future we may add the ability to set a front facing material,
and a back facing material, in which case this function will set both to the
same.</div>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>material</code></em> :</span></p></td>
<td> A <a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="type">CoglHandle</span></a> for a material
</td>
</tr></tbody>
</table></div>
<p class="since">Since 1.0</p>
</div>
<hr>
<div class="refsect2" title="cogl_set_source_color ()">
<a name="cogl-set-source-color"></a><h3>cogl_set_source_color ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_set_source_color               (const <a class="link" href="cogl-Color-Type.html#CoglColor" title="CoglColor"><span class="returnvalue">CoglColor</span></a> *color);</pre>
<p>
This is a convenience function for creating a solid fill source material
from the given color. This color will be used for any subsequent drawing
operation.
</p>
<p>
The color will be premultiplied by Cogl, so the color should be
non-premultiplied. For example: use (1.0, 0.0, 0.0, 0.5) for
semi-transparent red.
</p>
<p>
See also <a class="link" href="cogl-General-API.html#cogl-set-source-color4ub" title="cogl_set_source_color4ub ()"><code class="function">cogl_set_source_color4ub()</code></a> and <a class="link" href="cogl-General-API.html#cogl-set-source-color4f" title="cogl_set_source_color4f ()"><code class="function">cogl_set_source_color4f()</code></a>
if you already have the color components.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>color</code></em> :</span></p></td>
<td> a <a class="link" href="cogl-Color-Type.html#CoglColor" title="CoglColor"><span class="type">CoglColor</span></a>
</td>
</tr></tbody>
</table></div>
<p class="since">Since 1.0</p>
</div>
<hr>
<div class="refsect2" title="cogl_set_source_color4ub ()">
<a name="cogl-set-source-color4ub"></a><h3>cogl_set_source_color4ub ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_set_source_color4ub            (<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="returnvalue">guint8</span></a> red,
                                                         <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="returnvalue">guint8</span></a> green,
                                                         <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="returnvalue">guint8</span></a> blue,
                                                         <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="returnvalue">guint8</span></a> alpha);</pre>
<p>
This is a convenience function for creating a solid fill source material
from the given color using unsigned bytes for each component. This
color will be used for any subsequent drawing operation.
</p>
<p>
The value for each component is an unsigned byte in the range
between 0 and 255.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>red</code></em> :</span></p></td>
<td> value of the red channel, between 0 and 255
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>green</code></em> :</span></p></td>
<td> value of the green channel, between 0 and 255
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>blue</code></em> :</span></p></td>
<td> value of the blue channel, between 0 and 255
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>alpha</code></em> :</span></p></td>
<td> value of the alpha channel, between 0 and 255
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.0</p>
</div>
<hr>
<div class="refsect2" title="cogl_set_source_color4f ()">
<a name="cogl-set-source-color4f"></a><h3>cogl_set_source_color4f ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_set_source_color4f             (<span class="returnvalue">float</span> red,
                                                         <span class="returnvalue">float</span> green,
                                                         <span class="returnvalue">float</span> blue,
                                                         <span class="returnvalue">float</span> alpha);</pre>
<p>
This is a convenience function for creating a solid fill source material
from the given color using normalized values for each component. This color
will be used for any subsequent drawing operation.
</p>
<p>
The value for each component is a fixed point number in the range
between 0 and <code class="literal">1</code>.0. If the values passed in are outside that
range, they will be clamped.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>red</code></em> :</span></p></td>
<td> value of the red channel, between 0 and <code class="literal">1</code>.0
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>green</code></em> :</span></p></td>
<td> value of the green channel, between 0 and <code class="literal">1</code>.0
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>blue</code></em> :</span></p></td>
<td> value of the blue channel, between 0 and <code class="literal">1</code>.0
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>alpha</code></em> :</span></p></td>
<td> value of the alpha channel, between 0 and <code class="literal">1</code>.0
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.0</p>
</div>
<hr>
<div class="refsect2" title="cogl_set_source_texture ()">
<a name="cogl-set-source-texture"></a><h3>cogl_set_source_texture ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_set_source_texture             (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> texture_handle);</pre>
<p>
This is a convenience function for creating a material with the first
layer set to <span class="type">texture_handle</span> and setting that material as the source with
cogl_set_source.
</p>
<p>
Note: There is no interaction between calls to cogl_set_source_color
and cogl_set_source_texture. If you need to blend a texture with a color then
you can create a simple material like this:
</p>
<pre class="programlisting">
material = cogl_material_new ();
cogl_material_set_color4ub (material, 0xff, 0x00, 0x00, 0x80);
cogl_material_set_layer (material, 0, tex_handle);
cogl_set_source (material);
</pre>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>texture_handle</code></em> :</span></p></td>
<td> The Cogl texture you want as your source
</td>
</tr></tbody>
</table></div>
<p class="since">Since 1.0</p>
</div>
<hr>
<div class="refsect2" title="enum CoglReadPixelsFlags">
<a name="CoglReadPixelsFlags"></a><h3>enum CoglReadPixelsFlags</h3>
<pre class="programlisting">typedef enum { /*&lt; prefix=COGL_READ_PIXELS &gt;*/
  COGL_READ_PIXELS_COLOR_BUFFER = 1L &lt;&lt; 0
} CoglReadPixelsFlags;
</pre>
<p>
Flags for <a class="link" href="cogl-General-API.html#cogl-read-pixels" title="cogl_read_pixels ()"><code class="function">cogl_read_pixels()</code></a></p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><a name="COGL-READ-PIXELS-COLOR-BUFFER:CAPS"></a><span class="term"><code class="literal">COGL_READ_PIXELS_COLOR_BUFFER</code></span></p></td>
<td> Read from the color buffer
</td>
</tr></tbody>
</table></div>
<p class="since">Since 1.0</p>
</div>
<hr>
<div class="refsect2" title="cogl_read_pixels ()">
<a name="cogl-read-pixels"></a><h3>cogl_read_pixels ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_read_pixels                    (<span class="returnvalue">int</span> x,
                                                         <span class="returnvalue">int</span> y,
                                                         <span class="returnvalue">int</span> width,
                                                         <span class="returnvalue">int</span> height,
                                                         <a class="link" href="cogl-General-API.html#CoglReadPixelsFlags" title="enum CoglReadPixelsFlags"><span class="returnvalue">CoglReadPixelsFlags</span></a> source,
                                                         <a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="returnvalue">CoglPixelFormat</span></a> format,
                                                         <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="returnvalue">guint8</span></a> *pixels);</pre>
<p>
This reads a rectangle of pixels from the current framebuffer where
position (0, 0) is the top left. The pixel at (x, y) is the first
read, and the data is returned with a rowstride of (width * 4).
</p>
<p>
Currently Cogl assumes that the framebuffer is in a premultiplied
format so if <em class="parameter"><code>format</code></em> is non-premultiplied it will convert it. To
read the pixel values without any conversion you should either
specify a format that doesn't use an alpha channel or use one of
the formats ending in PRE.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
<td> The window x position to start reading from
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
<td> The window y position to start reading from
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
<td> The width of the rectangle you want to read
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
<td> The height of the rectangle you want to read
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>source</code></em> :</span></p></td>
<td> Identifies which auxillary buffer you want to read
         (only COGL_READ_PIXELS_COLOR_BUFFER supported currently)
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
<td> The pixel format you want the result in
         (only COGL_PIXEL_FORMAT_RGBA_8888 supported currently)
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>pixels</code></em> :</span></p></td>
<td> The location to write the pixel data.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cogl_flush ()">
<a name="cogl-flush"></a><h3>cogl_flush ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_flush                          (void);</pre>
<p>
This function should only need to be called in exceptional circumstances.
</p>
<p>
As an optimization Cogl drawing functions may batch up primitives
internally, so if you are trying to use raw GL outside of Cogl you stand a
better chance of being successful if you ask Cogl to flush any batched
geometry before making your state changes.
</p>
<p>
It only ensure that the underlying driver is issued all the commands
necessary to draw the batched primitives. It provides no guarantees about
when the driver will complete the rendering.
</p>
<p>
This provides no guarantees about the GL state upon returning and to avoid
confusing Cogl you should aim to restore any changes you make before
resuming use of Cogl.
</p>
<p>
If you are making state changes with the intention of affecting Cogl drawing
primitives you are 100% on your own since you stand a good chance of
conflicting with Cogl internals. For example clutter-gst which currently
uses direct GL calls to bind ARBfp programs will very likely break when Cogl
starts to use ARBfb programs itself for the material API.</p>
<p class="since">Since 1.0</p>
</div>
<hr>
<div class="refsect2" title="cogl_begin_gl ()">
<a name="cogl-begin-gl"></a><h3>cogl_begin_gl ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_begin_gl                       (void);</pre>
<p>
We do not advise nor reliably support the interleaving of raw GL drawing and
Cogl drawing functions, but if you insist, <a class="link" href="cogl-General-API.html#cogl-begin-gl" title="cogl_begin_gl ()"><code class="function">cogl_begin_gl()</code></a> and <a class="link" href="cogl-General-API.html#cogl-end-gl" title="cogl_end_gl ()"><code class="function">cogl_end_gl()</code></a>
provide a simple mechanism that may at least give you a fighting chance of
succeeding.
</p>
<p>
Note: this doesn't help you modify the behaviour of Cogl drawing functions
through the modification of GL state; that will never be reliably supported,
but if you are trying to do something like:
</p>
<p>
</p>
<div class="informalexample"><pre class="programlisting">
{
   - setup some OpenGL state.
   - draw using OpenGL (e.g. glDrawArrays() )
   - reset modified OpenGL state.
   - continue using Cogl to draw
}
</pre></div>
<p>
</p>
<p>
You should surround blocks of drawing using raw GL with <a class="link" href="cogl-General-API.html#cogl-begin-gl" title="cogl_begin_gl ()"><code class="function">cogl_begin_gl()</code></a>
and <a class="link" href="cogl-General-API.html#cogl-end-gl" title="cogl_end_gl ()"><code class="function">cogl_end_gl()</code></a>:
</p>
<p>
</p>
<div class="informalexample"><pre class="programlisting">
{
   cogl_begin_gl ();
   - setup some OpenGL state.
   - draw using OpenGL (e.g. glDrawArrays() )
   - reset modified OpenGL state.
   cogl_end_gl ();
   - continue using Cogl to draw
}
</pre></div>
<p>
</p>
<p>
Don't ever try and do:
</p>
<p>
</p>
<div class="informalexample"><pre class="programlisting">
{
   - setup some OpenGL state.
   - use Cogl to draw
   - reset modified OpenGL state.
}
</pre></div>
<p>
</p>
<p>
When the internals of Cogl evolves, this is very liable to break.
</p>
<p>
This function will flush all batched primitives, and subsequently flush
all internal Cogl state to OpenGL as if it were going to draw something
itself.
</p>
<p>
The result is that the OpenGL modelview matrix will be setup; the state
corresponding to the current source material will be set up and other world
state such as backface culling, depth and fogging enabledness will be sent
to OpenGL.
</p>
<p>
</p>
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>No special material state is flushed, so if you want Cogl to setup a
simplified material state it is your responsibility to set a simple source
material before calling <a class="link" href="cogl-General-API.html#cogl-begin-gl" title="cogl_begin_gl ()"><code class="function">cogl_begin_gl()</code></a>. E.g. by calling
<a class="link" href="cogl-General-API.html#cogl-set-source-color4ub" title="cogl_set_source_color4ub ()"><code class="function">cogl_set_source_color4ub()</code></a>.</div>
<p>
</p>
<p>
</p>
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>It is your responsibility to restore any OpenGL state that you modify
to how it was after calling <a class="link" href="cogl-General-API.html#cogl-begin-gl" title="cogl_begin_gl ()"><code class="function">cogl_begin_gl()</code></a> if you don't do this then the
result of further Cogl calls is undefined.</div>
<p>
</p>
<p>
</p>
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>You can not nest begin/end blocks.</div>
<p>
</p>
<p>
Again we would like to stress, we do not advise the use of this API and if
possible we would prefer to improve Cogl than have developers require raw
OpenGL.</p>
<p class="since">Since 1.0</p>
</div>
<hr>
<div class="refsect2" title="cogl_end_gl ()">
<a name="cogl-end-gl"></a><h3>cogl_end_gl ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_end_gl                         (void);</pre>
<p>
This is the counterpart to <a class="link" href="cogl-General-API.html#cogl-begin-gl" title="cogl_begin_gl ()"><code class="function">cogl_begin_gl()</code></a> used to delimit blocks of drawing
code using raw OpenGL. Please refer to <a class="link" href="cogl-General-API.html#cogl-begin-gl" title="cogl_begin_gl ()"><code class="function">cogl_begin_gl()</code></a> for full details.</p>
<p class="since">Since 1.0</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.13</div>
</body>
</html>