summaryrefslogtreecommitdiff
path: root/docs/subset-A.html
blob: dac66a61bae3a4f4a891d3e20bf2f5052a4da48b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
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
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title>Mini GLX Specification</title>
</head>
<body>
<span style="font-style: italic;"></span><span
 style="font-weight: bold;"></span>
<h1>
<center>Mesa Subset Specification</center>
</h1>
<h2>
<center>
<h3>Tungsten Graphics, Inc.</h3>
<h3>February 26, 2003<br>
</h3>
</center>
</h2>
<p> Copyright &copy; 2002-2003 by <a
 href="http://www.tungstengraphics.com/">Tungsten Graphics, Inc.</a>,
Cedar Park, Texas. All Rights Reserved. <br>
<br>
Permission is granted to make and distribute verbatim copies of this
document provided the copyright notice and this permission notice are
preserved on all copies.<br>
</p>
<p> OpenGL is a trademark of <a href="http://www.sgi.com">Silicon
Graphics, Inc.</a>.</p>
<h1>1. Introduction</h1>
This document describes a subset of the Mesa implemented by Tungsten
Graphics, Inc. for embedded devices. &nbsp;Prior to reading this
document the reader should be familiar with the OpenGL 1.2.1
specification dated April 1, 1999 (available from <a
 href="http://www.opengl.org/developers/documentation/specs.html">http://www.opengl.org/developers/documentation/specs.html</a>.)
&nbsp;Experience with OpenGL programming is highly advisable.<a
 href="http://www.opengl.org/developers/documentation/specs.html"><br>
</a><br>
Tungsten Graphics, Inc. is working with industry standards
organizations +in an attempt to standardize this Mesa subset and any
other possible subsets +as a result of this work. <br>
<br>
Appendix A contains a list of issues of which some may not be resolved.<br>
<br>
To summarize, the following major features of Mesa are omitted from the
subset:<br>
<ul>
  <li>Vertex arrays</li>
  <li>Texture coordinate generation</li>
  <li>Lighting</li>
  <li>Point size</li>
  <li>Polygon stipple</li>
  <li>DrawPixels, CopyPixels, PixelZoom</li>
  <li>1-D and 3-D textures</li>
  <li>CopyTex[Sub]Image</li>
  <li>Fog</li>
  <li>Depth test</li>
  <li>Color Index mode</li>
  <li>Accumulation buffer</li>
  <li>Feedback mode</li>
  <li>Evaluators</li>
  <li>Push/Pop attributes</li>
  <li>Display lists<br>
  </li>
</ul>
<p>Further reductions are made at a lower level of detail.<br>
</p>
<p>Mesa function names are printed in <span style="font-weight: bold;">bold
face</span>. &nbsp;Function parameters are printed in <span
 style="font-style: italic;">italics</span>.<br>
</p>
<p>The Tungsten Graphics, Inc. Mesa subset library is hereafter
referred to as <span style="font-style: italic;">the subset.</span><br>
<br>
</p>
<h1>2. Primitive Specification</h1>
<h2>2.1 glBegin, glEnd and glVertex Commands</h2>
The basic rendering primitives are points, lines and triangles.
&nbsp;Quadrilaterals and polygons are composed of triangles.
&nbsp;Primitives are drawn with the <span style="font-weight: bold;">glBegin</span>
and <span style="font-weight: bold;">glEnd</span> commands and a subset
of the <span style="font-weight: bold;">glVertex</span> commands:<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glBegin</span>(GLenum<span
 style="font-style: italic;">mode</span>)<br>
void <span style="font-weight: bold;">glEnd</span>(void)<br>
<br>
void <span style="font-weight: bold;">glVertex2f</span>(GLfloat <span
 style="font-style: italic;">x</span>, GLfloat <span
 style="font-style: italic;">y</span>)<br>
void <span style="font-weight: bold;">glVertex2fv</span>(const GLfloat
*<span style="font-style: italic;">v</span>)<br>
void <span style="font-weight: bold;">glVertex3f</span>(GLfloat <span
 style="font-style: italic;">x</span>, GLfloat <span
 style="font-style: italic;">y</span>, GLfloat <span
 style="font-style: italic;">z</span>)<br>
void <span style="font-weight: bold;">glVertex3fv</span>(const GLfloat
*<span style="font-style: italic;">v</span>)<br>
</div>
<br>
The <span style="font-style: italic;">mode</span> parameter to <span
 style="font-weight: bold;">glBegin</span> may be one of the following<br>
<br>
<div style="margin-left: 40px;">GL_POINTS - a series of individual
points<br>
GL_LINES - a series of disjoint line segments<br>
GL_LINE_STRIP - series of connected line segments<br>
GL_LINE_LOOP - a closed loop of line segments<br>
GL_TRIANGLES - a series of individual triangles<br>
GL_TRIANGLE_STRIP - a connected strip of triangles<br>
GL_TRIANGLE_FAN - a sequence of triangles all sharing a common vertex<br>
GL_QUADS - a sequence of individual quadrilaterals<br>
GL_QUAD_STRIP - a connected strip of quadrilaterals<br>
GL_POLYGON - a closed, convex polygon<br>
<br>
</div>
<br>
The <span style="font-weight: bold;">glVertex</span> commands take two
or three floating point coordinates, or a pointer to an array of two or
three floating point coordinates. &nbsp;Vertices are actually 4-element
homogeneous coordinates. &nbsp;The fourth component, unspecified by the
subset's <span style="font-weight: bold;">glVertex</span> commands, is
one.<br>
<br>
<span style="font-weight: bold;"></span>
<h2>2.2 Other Per-vertex Commands<br>
</h2>
The <span style="font-weight: bold;">glColor</span> and <span
 style="font-weight: bold;">glTexCoord</span> commands may be used to
specify colors and texture coordinates for each vertex:<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glColor3f</span>(GLfloat<span
 style="font-style: italic;">red</span>, GLfloat <span
 style="font-style: italic;">green</span>, GLfloat <span
 style="font-style: italic;">blue</span>)<br>
void <span style="font-weight: bold;">glColor3fv</span>(const GLfloat *<span
 style="font-style: italic;">rgb</span>)<br>
void <span style="font-weight: bold;">glColor4f</span>(GLfloat <span
 style="font-style: italic;">red,</span> GLfloat <span
 style="font-style: italic;">green,</span> GLfloat <span
 style="font-style: italic;">blue,</span> GLfloat <span
 style="font-style: italic;">alpha</span>)<br>
void <span style="font-weight: bold;">glColor4fv</span>(const GLfloat *<span
 style="font-style: italic;">rgba</span>)<br>
void <span style="font-weight: bold;">glTexCoord2f</span>(GLfloat <span
 style="font-style: italic;">s</span>, GLfloat<span
 style="font-style: italic;"> t</span>)<br>
void <span style="font-weight: bold;">glTexCoord2fv</span>(const
GLfloat *<span style="font-style: italic;">c</span>)<br>
<br>
</div>
The <span style="font-weight: bold;">glColor</span> commands specify
the color and optionally, the alpha value, for subsequent vertices.
&nbsp;For the <span style="font-weight: bold;">glColor3</span> commands,
alpha is set to one.<br>
<br>
The <span style="font-weight: bold;">glTexCoord2</span> commands
specify the texture coordinate for subsequent vertices. &nbsp;Texture
coordinates are actually four-component coordinates: (s, t, r, q).
&nbsp;The <span style="font-weight: bold;">glTexCoord2</span> commands
set s and t explicitly. &nbsp;The r and q components are zero and one,
respectively.<br>
<br>
<span style="font-weight: bold;"></span>Only <span
 style="font-weight: bold;">glVertex, glColor</span> and <span
 style="font-weight: bold;">glTexCoord</span> commands are allowed
between <span style="font-weight: bold;">glBegin</span> and <span
 style="font-weight: bold;">glEnd.</span> &nbsp;Calling any other
command between <span style="font-weight: bold;">glBegin</span> and <span
 style="font-weight: bold;">glEnd</span> will result in the error
GL_INVALID_OPERATION.<br>
<br>
<h2>2.3 Unsupported Commands</h2>
None of the following commands related to primitive specification are
supported by the subset:<br>
<br>
<div style="margin-left: 40px;">Per-Vertex commands:<br>
</div>
<div style="margin-left: 40px;">
<div style="margin-left: 40px;"><span style="font-weight: bold;">glVertex2d,
glVertex2i, glVertex2s, glVertex3d, glVertex3i, glVertex3s, glVertex4d,
glVertex4i, glVertex4s, glVertex2dv, glVertex2iv, glVertex2sv,
glVertex3dv, glVertex3iv, glVertex3sv, glVertex4dv, glVertex4iv,
glVertex4sv,<br>
glNormal3b, glNormal3d, glNormal3f, glNormal3i, glNormal3s, </span><span
 style="font-weight: bold;">glNormal3bv, glNormal3dv, glNormal3fv,
glNormal3iv, glNormal3sv,<br>
glIndexd, glIndexf, glIndexi, glIndexs, glIndexub, glIndexdv,
glIndexfv, glIndexiv, glIndexsv, glIndexubv,<br>
glColor3b, glColor3d, glColor3i, glColor3s, glColor3ub, glColor3ui,
glColor3us, </span><span style="font-weight: bold;">glColor3bv,
glColor3dv, glColor3iv, glColor3sv, glColor3ubv, glColor3uiv,
glColor3usv,</span><span style="font-weight: bold;"> lColor4b,
glColor4d, glColor4i, glColor4s, glColor4ub, glColor4ui, glColor4us, </span><span
 style="font-weight: bold;">glColor4bv, glColor4dv, glColor4iv,
glColor4sv, glColor4ubv, glColor4uiv, glColor4usv,<br>
</span><span style="font-weight: bold;">glTexCoord1d, glTexCoord1f,
glTexCoord1i, glTexCoord1s, glTexCoord2d, glTexCoord2i, glTexCoord2s,
glTexCoord3d, glTexCoord3f, glTexCoord3i, glTexCoord3s, glTexCoord4d,
glTexCoord4f, glTexCoord4i, glTexCoord4s, glTexCoord1dv, glTexCoord1fv,
glTexCoord1iv, glTexCoord1sv, glTexCoord2dv, glTexCoord2iv,
glTexCoord2sv, glTexCoord3dv, glTexCoord3fv, glTexCoord3iv,
glTexCoord3sv, glTexCoord4dv, glTexCoord4fv, glTexCoord4iv,
glTexCoord4sv,<br>
glEdgeFlag, glEdgeFlagv</span><br style="font-weight: bold;">
<br>
</div>
Vertex array commands:<br>
<div style="margin-left: 40px;"><span style="font-weight: bold;">glVertexPointer,
glColorPointer, glIndexPointer, glTexCoordPointer, glEdgeFlagPointer,
glNormalPointer, glInterleavedArrays, glArrayElement, glDrawArrays,
glDrawElements, glDrawRangeElements, glEnableClientState,
glDisableClientState</span><br>
</div>
</div>
<div style="margin-left: 40px;"><br>
Rectangle commands:<br>
<div style="margin-left: 40px;"><span style="font-weight: bold;">glRects,
glRecti, glRectf, glRectd, glRectsv, glRectiv, glRectfv, glRectdv,<br>
<br>
</span></div>
</div>
<div style="margin-left: 40px;">Lighting commands:<br>
</div>
<div style="margin-left: 80px;"><span style="font-weight: bold;">glMaterialf,
glMateriali, glMaterialfv, glMaterialiv<br>
</span><br>
</div>
<div style="margin-left: 40px;"> Evaluator commands:<br>
<div style="margin-left: 40px;"><span style="font-weight: bold;">glEvalCoord1d,
glEvalCoord1f, glEvalCoord1dv, glEvalCoord1fv,&nbsp;</span><span
 style="font-weight: bold;">glEvalCoord2d, glEvalCoord2f,
glEvalCoord2dv, glEvalCoord2fv,<br>
</span><span style="font-weight: bold;">glEvalPoint1, glEvalPoint2</span><br>
<br>
</div>
</div>
<h1>3. Coordinate Transformation</h1>
<h2>3.1 Vertex Transformation</h2>
Vertex coordinates are transformed by the current modelview and
projection matrices then mapped to window coordinates as specified by
the viewport. &nbsp;The following coordinate transformation commands are
supported by the subset<br>
<br>
<div style="margin-left: 40px; font-weight: bold;">glMatrixMode<span
 style="font-weight: normal;">(GLenum <span style="font-style: italic;">mode</span>)</span><br>
glLoadIdentity<span style="font-weight: normal;">(void)</span><br>
glPushMatrix<span style="font-weight: normal;">(void)</span><br>
glPopMatrix<span style="font-weight: normal;">(void)</span><br>
glLoadMatrixf<span style="font-weight: normal;">(const GLfloat *<span
 style="font-style: italic;">m</span>)</span><br>
glMultMatrixf<span style="font-weight: normal;">(const GLfloat *<span
 style="font-style: italic;">m</span>)</span><br>
glRotatef<span style="font-weight: normal;">(GLfloat <span
 style="font-style: italic;">angle</span>, GLfloat <span
 style="font-style: italic;">x</span>, GLfloat <span
 style="font-style: italic;">y</span>, GLfloat <span
 style="font-style: italic;">z</span>)</span><br>
glTranslatef<span style="font-weight: normal;">(GLfloat <span
 style="font-style: italic;">x</span>, GLfloat <span
 style="font-style: italic;">y</span>, GLfloat <span
 style="font-style: italic;">z</span>)</span><br>
glScalef<span style="font-weight: normal;">(GLfloat <span
 style="font-style: italic;">x</span>, GLfloat <span
 style="font-style: italic;">y</span>, GLfloat <span
 style="font-style: italic;">z</span>)<br>
<span style="font-weight: bold;">glFrustum(</span>GLdouble <span
 style="font-style: italic;">left,</span> GLdouble <span
 style="font-style: italic;">right,</span> GLdouble <span
 style="font-style: italic;">bottom,</span> GLdouble <span
 style="font-style: italic;">top,</span> GLdouble <span
 style="font-style: italic;">near,</span> GLdouble <span
 style="font-style: italic;">far</span>)</span><br>
<span style="font-weight: normal;"><span style="font-weight: bold;">glOrtho(</span>GLdouble<span
 style="font-style: italic;"> left,</span> GLdouble <span
 style="font-style: italic;">right,</span> GLdouble <span
 style="font-style: italic;">bottom,</span> GLdouble <span
 style="font-style: italic;">top,</span> GLdouble <span
 style="font-style: italic;">near,</span> GLdouble <span
 style="font-style: italic;">far</span>)</span><br>
glViewport<span style="font-weight: normal;">(GLint <span
 style="font-style: italic;">x</span>, GLint <span
 style="font-style: italic;">y</span>, GLsize <span
 style="font-style: italic;">width,</span> GLsizei <span
 style="font-style: italic;">height</span>)</span><br>
</div>
<br>
The <span style="font-weight: bold;">glMatrixMode</span> command
specifies the <span style="font-style: italic;">current matrix.</span>
&nbsp;The mode parameter may be GL_MODELVIEW or GL_PROJECTION to specify
the modelview matrix or projection matrix. &nbsp;Subsequent matrix
commands will effect the current matrix. &nbsp;Also associated with the
modelview and projection matrices are a modelview matrix stack and
projection matrix stack.<br>
<br>
The <span style="font-weight: bold;">glLoadIdentity</span> command
replaces the current matrix with the identity matrix. &nbsp;The matrix
elements are specified in column-major order.<br>
<br>
The <span style="font-weight: bold;">glPushMatrix</span> command pushes
a copy of the current matrix onto either the modelview matrix stack or
the projection matrix stack. &nbsp;The <span style="font-weight: bold;">glPopMatrix</span>
command replaces the current matrix with a copy of the top matrix off
the modelview matrix stack or projection matrix stack, the pops the
stack. &nbsp;Matrix stacks are useful for traversing and rendering
hierarchical models.<br>
<br>
The <span style="font-weight: bold;">glMultMatrixf</span> command
post-multiplies the current matrix by the specified matrix. &nbsp;The
matrix elements are specified in column-major order.<br>
<br>
The <span style="font-weight: bold;">glRotatef</span> command
post-multiplies the current matrix by a rotation matrix defined by the
angle and rotation axis defined by x, y and z.<br>
<br>
The <span style="font-weight: bold;">glTranslatef</span> command
post-multiplies the current matrix by a translation matrix defined by
the <span style="font-style: italic;">x</span>, <span
 style="font-style: italic;">y</span> and <span
 style="font-style: italic;">z</span> translation parameters.<br>
<span style="font-weight: bold;"></span><br>
The <span style="font-weight: bold;">glScalef</span> command
post-multiplies the current matrix by a scaling matrix defined by the <span
 style="font-style: italic;">x</span>, <span
 style="font-style: italic;">y</span> and <span
 style="font-style: italic;">z</span> scale factors.<br>
<span style="font-weight: bold;"></span><br>
The <span style="font-weight: bold;">glFrustum</span> command
post-multiplies the current matrix by a perspective projection matrix.
&nbsp;The <span style="font-style: italic;">near</span> and <span
 style="font-style: italic;">far</span> values specify the position of
the hither and yon Z-axis clipping planes. &nbsp;The <span
 style="font-style: italic;">left, right, bottom</span> and <span
 style="font-style: italic;">top</span> parameters are the X and Y
extents at the near clipping plane. &nbsp;<span
 style="font-weight: bold;">glFrustum</span> is normally used to modify
the projection matrix.<br>
<br>
The <span style="font-weight: bold;">glOrtho</span> command
post-multiplies the current matrix by an orthographic projection matrix.
&nbsp;The <span style="font-style: italic;">near</span> and <span
 style="font-style: italic;">far</span> values specify the position of
the hither and yon Z-axis clipping planes. &nbsp;The <span
 style="font-style: italic;">left, right, bottom</span> and <span
 style="font-style: italic;">top</span> parameters specify the X and
Y-axis clipping planes. &nbsp;<span style="font-weight: bold;">glOrtho</span>
is normally used to modify the projection matrix.<br>
<br>
The <span style="font-weight: bold;">glViewport</span> command
specifies the mapping of coordinates from normalized device coordinates
to window coordinates. &nbsp;The <span style="font-style: italic;">x</span>
and <span style="font-style: italic;">y</span> parameters specify the
viewport's lower-left corner in the window and the <span
 style="font-style: italic;">width</span> and <span
 style="font-style: italic;">height</span> parameters specify the size
of the viewport. &nbsp;<span style="font-weight: bold;">glViewport</span>
does not effect the current matrix.<br>
<br>
A coordinate transformed to window coordinates is hereafter known as (x<sub>w</sub>,
y<sub>w</sub>, z<sub>w</sub>).<br>
<br>
<h2>3.2 Clipping</h2>
View-volume clipping automatically discards or trims primitives which
lie completely or partially outside of the view volume specified by <span
 style="font-weight: bold;">glFrustum</span> and <span
 style="font-weight: bold;">glOrtho</span>. &nbsp;Note that the <span
 style="font-weight: bold;">glViewport</span> command does not define a
clipping region.<br>
<br>
Clipping occurs in <span style="font-style: italic;">clip coordinate
space - </span>the coordinates produced after applying the projection
matrix.<br>
<br>
<h2>3.3 Current Raster Position</h2>
The current raster position specifies the location for drawing images
with <span style="font-weight: bold;">glBitmap.</span> &nbsp;The current
raster position is set with the commands:<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glRasterPos2f</span>(GLfloat<span
 style="font-style: italic;">x</span>, GLfloat <span
 style="font-style: italic;">y</span>)<br>
void <span style="font-weight: bold;">glRasterPos2fv</span>(const
GLfloat *<span style="font-style: italic;">v</span>)<br>
void <span style="font-weight: bold;">glRasterPos2i</span>(GLint <span
 style="font-style: italic;">x</span>, GLint <span
 style="font-style: italic;">y</span>)<br>
void <span style="font-weight: bold;">glRasterPos2iv</span>(const
GLint *<span style="font-style: italic;">v</span>)<br>
</div>
<br>
<span style="font-weight: bold;">glRasterPos</span> specifies a
4-component coordinate (x, y, 0, 1). &nbsp;The coordinate is processed
like a vertex; it is transformed by the modelview matrix, the projection
matrix and mapped to the viewport. &nbsp;The resulting window coordinate
is stored as the current raster position. &nbsp;The coordinate is
clipped-tested against the frustum like a vertex. &nbsp;If the
coordinate is clipped, then the current raster position becomes invalid
and subsequent <span style="font-weight: bold;">glBitmap</span> commands
have no effect.<br>
<br>
<span style="font-weight: bold;">glRasterPos</span> also updates the
current raster color and current raster texture coordinates. &nbsp;The
current raster color is updated (copied) from the current color (as
specified by <span style="font-weight: bold;">glColor</span>).
&nbsp;The current raster texture coordinate is updated (copied) from the
current texture coordinate (as specified by <span
 style="font-weight: bold;">glTexCoord</span>).<br>
<br>
<h2>3.4 Unsupported Commands</h2>
The following commands related to vertex transformation are not
supported by the subset:<br>
<br>
<div style="margin-left: 40px;">User-defined clip plane commands:<br>
<div style="margin-left: 40px;"><span style="font-weight: bold;">glClipPlane</span><br>
</div>
<span style="font-weight: bold;"></span></div>
<br>
<div style="margin-left: 40px;">Lighting and material commands:</div>
<div style="margin-left: 80px;"><span style="font-weight: bold;">glLightModeli,
glLightModelf,&nbsp;</span><span style="font-weight: bold;">glLightModeliv,
glLightModelfv,</span><span style="font-weight: bold;"> glLightf,
glLighti, glLightfv, glLightiv, glColorMaterial</span><br>
</div>
<br>
<div style="margin-left: 40px;">Automatic texture coordinate generation
commands:<br>
</div>
<div style="margin-left: 40px;">
<div style="margin-left: 40px;"><span style="font-weight: bold;">glTexGend,
glTexGenf, glTexGeni, </span><span style="font-weight: bold;">glTexGendv,
glTexGenfv, glTexGeniv, </span><br>
<br style="font-weight: bold;">
</div>
Double-valued commands:<br>
<div style="margin-left: 40px;"><span style="font-weight: bold;">glLoadMatrixd,
glMultMatrixd, glRotated, glTranslated, glScaled</span><br
 style="font-weight: bold;">
</div>
<br>
Depth Range command:<br>
<div style="margin-left: 40px;"><span style="font-weight: bold;">glDepthRange</span>
(the near value is always 0.0 and the far value is always 1.0)<br>
</div>
<br>
Extra RasterPos commands:<br>
<div style="margin-left: 40px;"><span style="font-weight: bold;">glRasterPos2d,
glRasterPos2s, glRasterPos3d, glRasterPos3f, glRasterPos3i,
glRasterPos3s, glRasterPos4d, glRasterPos4f, glRasterPos4i,
glRasterPos4s, glRasterPos2dv, glRasterPos2sv, glRasterPos3dv,
glRasterPos3fv, glRasterPos3iv, glRasterPos3sv, glRasterPos4dv,
glRasterPos4fv, glRasterPos4iv, glRasterPos4sv</span><br>
</div>
<br>
<br>
</div>
<h1>4. Rasterization</h1>
This section describes the commands and options for drawing points,
lines, triangles and bitmaps. &nbsp;<span style="font-style: italic;">Rasterization</span>
is the term for the process which produces fragments from the geometric
description of a primitive (a point, line, polygon or bitmap). &nbsp;For
example, given the two coordinates for the end-points of a line segment,
rasterization determines which pixels in the frame buffer are modified
to <span style="font-style: italic;">draw</span> the line. &nbsp;A
fragment is a tuple which consists of a window coordinate, colors and
texture coordinates. &nbsp;The fragments produced by rasterization are
subsequently processed by the per-fragment operations described later.<br>
<br>
<h2>4.1 Point Rasterization</h2>
Points are rendered with the command sequence <span
 style="font-weight: bold;">glBegin</span>(GL_POINTS), <span
 style="font-weight: bold;">glVertex</span>, ... <span
 style="font-weight: bold;">glEnd</span>. &nbsp;The window coordinate (x<sub>w</sub>,
y<sub>w</sub>, z<sub>w</sub>) is truncated to rasterize the point.
&nbsp;The truncated coordinate with its associated color and texture
coordinate is sent as a single fragment to the per-fragment processing
stages.<br>
<br>
The <span style="font-weight: bold;">glPointSize</span> command is not
supported; only 1-pixel points are supported.<br>
<br>
Point smoothing (antialiasing) is also not supported.<br>
<br>
<h2>4.2 Line Rasterization</h2>
Lines are rendered with the command sequence <span
 style="font-weight: bold;">glBegin</span>(<span
 style="font-style: italic;">mode</span>), <span
 style="font-weight: bold;">glVertex</span>, <span
 style="font-weight: bold;">glVertex</span>, ... <span
 style="font-weight: bold;">glEnd</span> where <span
 style="font-style: italic;">mode</span> is one of GL_LINES,
GL_LINE_STRIP or GL_LINE_LOOP. &nbsp;Lines are rasterized as described
in the OpenGL specification. &nbsp;Note that OpenGL specifies the <span
 style="font-style: italic;">half-open</span> convention for drawing
lines: the last fragment in a line segment is omitted so that endpoint
pixels shared by two line segments will only be drawn once instead of
twice.<br>
<br>
<h3>4.2.1 Line Width</h3>
The width of lines can be controlled by<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glLineWidth</span>(GLfloat<span
 style="font-style: italic;">width</span>)<br>
</div>
<br>
where <span style="font-style: italic;">width</span> is the line width
in pixels. &nbsp;The width defaults to 1.0. &nbsp;Attempting to set the
width to a value less than or equal to zero will raise the error
GL_INVALID_VALUE.<br>
<br>
<h3>4.2.2 Line Stipple<br>
</h3>
Lines may be stippled (i.e. dashed) with the command<br>
<br>
<div style="margin-left: 40px;"><span style="font-weight: bold;">glLineStipple</span>(GLint<span
 style="font-style: italic;">factor</span>, GLushort <span
 style="font-style: italic;">pattern</span>)<br>
</div>
<br>
<span style="font-style: italic;">pattern</span> describes an on/off
pattern for the fragments produced by rasterization and <span
 style="font-style: italic;">factor</span> specifies how many subsequent
fragments are kept or culled for each pattern bit. &nbsp;Line stippling
can be enabled or disabled by the commands <span
 style="font-weight: bold;">glEnable</span>(GL_LINE_STIPPLE) and <span
 style="font-weight: bold;">glDisable</span>(GL_LINE_STIPPLE).<br>
<br>
<h3>4.2.3 Line Antialiasing</h3>
Lines may be antialiased. &nbsp;For antialiased lines, each fragment
produced by rasterization is assigned a <span
 style="font-style: italic;">coverage value</span> which describes how
much of the fragment's area is considered to be <span
 style="font-style: italic;">inside</span> the line. &nbsp;Later, the
alpha value of each fragment is multiplied by the coverage value.
&nbsp;By blending the fragments into the frame buffer, the edges of
lines appear smoothed.<br>
<br>
Line antialiasing can be enabled or disabled with the commands <span
 style="font-weight: bold;">glEnable</span>(GL_LINE_SMOOTH) and <span
 style="font-weight: bold;">glDisable</span>(GL_LINE_SMOOTH).<br>
<br>
<h2>4.3 Polygon Rasterization</h2>
Polygons, quadrilaterals and triangles share the same polygon
rasterization options. <br>
<br>
Triangles are rendered by the command sequence <span
 style="font-weight: bold;">glBegin</span><span
 style="font-style: italic;"><span style="font-style: italic;">(mode</span></span>),<span
 style="font-weight: bold;">glVertex</span>, <span
 style="font-weight: bold;">glVertex</span>, ... <span
 style="font-weight: bold;">glEnd</span> where <span
 style="font-style: italic;">mode</span> may be one of GL_TRIANGLES,
GL_TRIANGLE_STRIP or GL_TRIANGLE_FAN.<span style="font-weight: bold;"></span>
&nbsp;For GL_TRIANGLES mode, the number of vertices should be a multiple
of three - extra vertices will be ignored. &nbsp;For GL_TRIANGLE_STRIP
and GL_TRIANGLE_FAN, at least three vertices should be specified.
&nbsp;If less than three are specified, nothing is drawn. &nbsp;<br>
<br>
Quadrilaterals are <span style="font-weight: bold;"></span>rendered by
the command sequence <span style="font-weight: bold;">glBegin</span>(<span
 style="font-style: italic;"><span style="font-style: italic;">mode</span></span>),<span
 style="font-weight: bold;">glVertex</span>, <span
 style="font-weight: bold;">glVertex</span>, ... <span
 style="font-weight: bold;">glEnd</span> where <span
 style="font-style: italic;">mode</span> may be one of GL_QUADS or
GL_QUAD_STRIP.<span style="font-weight: bold;"></span> &nbsp; For
GL_QUADS, the number of vertices should be a multiple of four - extra
vertices will be ignored. &nbsp;For GL_QUAD_STRIP, the number of
vertices should be even and at least four. &nbsp;Extra vertices (one)
will be ignored.<br>
<br>
Convex polygons are <span style="font-weight: bold;"></span>rendered
by the command sequence <span style="font-weight: bold;">glBegin</span><span
 style="font-style: italic;"><span style="font-style: italic;"></span></span>(GL_POLYGON),<span
 style="font-weight: bold;">glVertex</span>, <span
 style="font-weight: bold;">glVertex</span>, ... <span
 style="font-weight: bold;">glEnd</span>.<span
 style="font-style: italic;"></span><span style="font-weight: bold;"></span>
&nbsp;If less than three vertices are specified, nothing is drawn.<br>
<br>
<h3>4.3.1 Polygon Orientation</h3>
The <span style="font-style: italic;">winding order</span> of vertices
(clockwise or counter-clockwise) is significant. &nbsp;It is used to
determine the <span style="font-style: italic;">front-facing</span> or <span
 style="font-style: italic;">back-facing</span> orientation of polygons.
&nbsp;By default, a front-facing polygon's vertices are in
counter-clockwise order (in window coordinates). &nbsp;Figures 2.4 and
2.5 of the OpenGL 1.2.1 specification illustrate the winding order for
front-facing triangles and quadrilaterals, respectively.<br>
<br>
The command<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glFrontFace</span>(GLenum<span
 style="font-style: italic;"> mode</span>)<br>
</div>
<br>
specifies whether clockwise or counter-clockwise winding indicates a
front-facing polygon. &nbsp;If <span style="font-style: italic;">mode</span>
is GL_CW then polygons with clockwise winding are front-facing. &nbsp;If <span
 style="font-style: italic;">mode</span> is GL_CCW then polygons with
counter-clockwise winding are front-facing. &nbsp;The default value is
GL_CCW. &nbsp;If <span style="font-style: italic;">mode</span> is not
GL_CCW or GL_CW then the error GL_INVALID_ENUM will be raised.<span
 style="font-style: italic;"></span><span style="font-style: italic;"></span><br>
<br>
<h3>4.3.2 Polygon Culling</h3>
Polygons may be culled (discarded) depending on whether they are
front-facing or back-facing. &nbsp;The command<br>
<br>
<div style="margin-left: 40px;">void<span style="font-weight: bold;">
glCullFace</span>(GLenum <span style="font-style: italic;">mode</span>)<br>
</div>
<br>
specifies whether front-facing, back-facing or all polygons should be
culled. &nbsp;If <span style="font-style: italic;">mode</span> is
GL_FRONT then front-facing polygons will be culled. &nbsp;If <span
 style="font-style: italic;">mode</span> is GL_BACK then back-facing
polygons will be culled. Otherwise, if <span style="font-style: italic;">mode</span>
is GL_FRONT_AND_BACK then all polygons will be culled. &nbsp;Any other
value for <span style="font-style: italic;">mode</span> will raise the
error GL_INVALID_ENUM.<br>
<br>
Polygon culling is enabled and disabled with the commands <span
 style="font-weight: bold;">glEnable</span>(GL_CULL_FACE) and <span
 style="font-weight: bold;">glDisable</span>(GL_CULL_FACE),
respectively.<br>
<br>
<h3>4.3.3 Polygon Antialiasing</h3>
Polygons may be antialiased in order to smooth their edges.
&nbsp;Polygon antialiasing is enabled and disabled with the commands <span
 style="font-weight: bold;">glEnable</span>(GL_POLYGON_SMOOTH) and <span
 style="font-weight: bold;">glDisable</span>(GL_POLYGON_SMOOTH).<br>
<br>
When polygon antialiasing is enabled each fragment produced by polygon,
triangle and quadrilateral rasterization will be given a <span
 style="font-style: italic;">coverage</span> value which indicates how
much of the fragment is covered by the polygon. &nbsp;Fragments
completely inside the polygon have coverage 1.0. &nbsp;Fragments
completely outside the polygon have zero coverage (in theory).
&nbsp;Fragments which intersect the polygon's edge have a coverage value
in the range (0, 1).<br>
<br>
The fragment's alpha value is multiplied by the coverage value.
&nbsp;By enabling the appropriate blending mode, polygon edges will
appear smoothed.<br>
<br>
<h2>4.4 Shading</h2>
The command<br>
<br>
<div style="margin-left: 40px;"> void <span style="font-weight: bold;">glShadeModel</span>(GLenum<span
 style="font-style: italic;">mode</span>)<br>
</div>
<br>
determines whether colors are interpolated between vertices during
rasterization. &nbsp;If <span style="font-style: italic;">mode</span> is
GL_FLAT then vertex colors are not interpolated. &nbsp;The color used
for drawing lines, triangles and quadrilaterals is that of the last
vertex used to specify each primitive. &nbsp;For polygons, the color of
the first vertex specifies the color for the entire polygon. &nbsp;If <span
 style="font-style: italic;">mode</span> is GL_SMOOTH then vertex colors
are linearly interpolated to produce the fragment colors.<br>
<br>
<h2>4.5 Bitmap Rasterization</h2>
A bitmap is a monochromatic, binary image in which each image element
(or pixel) is represented by one bit. &nbsp;Fragments are only generated
for the bits (pixels) which are set.  &nbsp;Bitmaps are commonly used to
draw text (glyphs) and markers.<br>
<br>
A bitmap is drawn with the command<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glBitmap</span>(GLsizei<span
 style="font-style: italic;">width</span>, GLsizei <span
 style="font-style: italic;">height</span>, GLfloat <span
 style="font-style: italic;">xOrig</span>, GLfloat <span
 style="font-style: italic;">yOrig</span>, GLfloat <span
 style="font-style: italic;">xMove</span>, GLfloat <span
 style="font-style: italic;">yMove</span>, const &nbsp;GLubyte *<span
 style="font-style: italic;">image</span>)<br>
</div>
<br>
<span style="font-style: italic;">width </span>and <span
 style="font-style: italic;">height</span> specify the image size in
pixels. &nbsp;<span style="font-style: italic;">xOrig</span> and <span
 style="font-style: italic;">yOrig</span> specify the bitmap origin.
&nbsp;<span style="font-style: italic;">xMove</span> and <span
 style="font-style: italic;">yMove</span> are added to the current
raster position after the bitmap is rasterized. &nbsp;<span
 style="font-style: italic;">image</span> is a pointer to the bitmap
data.<br>
<br>
If the current raster position is not valid, <span
 style="font-weight: bold;">glBitmap</span> has no effect.<br>
<br>
<h3>4.5.1 Bitmap Unpacking</h3>
The first step in bitmap rendering is <span style="font-style: italic;">unpacking.
&nbsp;</span>Unpacking is the process of extracting image data from
client memory subject to byte swapping, non-default row strides, etc.
&nbsp;The unpacking parameters are specified with the command<br>
<br>
<div style="margin-left: 40px;">void<span style="font-weight: bold;">
glPixelStorei</span>(GLenum pname, GLint value)<br>
</div>
<span style="font-style: italic;"></span><br>
The following unpacking parameters may be set:<br>
<br>
<table cellpadding="2" cellspacing="2" border="1"
 style="text-align: left; width: 90%; margin-left: auto; margin-right: auto;">
  <tbody>
    <tr>
      <td style="vertical-align: top;">Parameter (<span
 style="font-style: italic;">pname</span>)<br>
      </td>
      <td style="vertical-align: top;">Value (<span
 style="font-style: italic;">value</span>)<br>
      </td>
      <td style="vertical-align: top;">Default<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_UNPACK_ROW_LENGTH<br>
      </td>
      <td style="vertical-align: top;">Width of the image in memory, in
pixels.<br>
      </td>
      <td style="vertical-align: top;">0<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_UNPACK_LSB_FIRST<br>
      </td>
      <td style="vertical-align: top;">GL_FALSE indicates that the most
significant bit is unpacked first from each byte. &nbsp;GL_TRUE
indicates that the least significant bit is unpacked first from each
byte. <br>
      </td>
      <td style="vertical-align: top;">GL_FALSE<br>
      </td>
    </tr>
  </tbody>
</table>
<br>
<br>
The GL_UNPACK_ROW_LENGTH specifies the stride (in pixels) for advancing
from one row of the image to the next.&nbsp; If it's zero, the <span
 style="font-style: italic;">width</span> parameter to <span
 style="font-weight: bold;">glBitmap</span> specifies the width of the
image in memory.<br>
<br>
GL_UNPACK_LSB_FIRST determines whether the least significant or most
significant bit in each byte is unpacked first. &nbsp;Unpacking occurs
in left to right order (in image space).<br>
<br>
The value of bit (i, j) of the image (where i is the image row and j is
the image column) is found as follows:<br>
<br>
<div style="margin-left: 40px;">rowLength = (GL_UNPACK_ROW_LENGTH != 0)
? GL_UNPACK_ROW_LENGTH : <span style="font-style: italic;">width</span>;<br>
<br>
byte = <span style="font-style: italic;">image</span>[((rowLength + 7)
/ 8) * i + j / 8];<br>
<br>
if (GL_UNPACK_LSB_FIRST != 0)<br>
&nbsp;&nbsp;&nbsp; bitMask = 1 &lt;&lt; (j % 8);<br>
else<br>
&nbsp;&nbsp;&nbsp; bitMask = 128 &gt;&gt; (j % 8);<br>
<br>
if (byte &amp; bitMask)<br>
&nbsp;&nbsp;&nbsp; bit = 1;<br>
else<br>
&nbsp;&nbsp;&nbsp; bit = 0;<br>
<br>
</div>
<span style="font-style: italic;"><span style="font-style: italic;"></span></span>
<h3>4.5.2 Rasterization</h3>
If the current raster position is (x<sub>rp</sub>, y<sub>rp</sub>, z<sub>rp</sub>,
w<sub>rp</sub>), then the bitmap is rasterized according to the
following algorithm:<br>
<br>
for (j = 0; j &lt; <span style="font-style: italic;">height</span>;
j++) {<br>
&nbsp;&nbsp;&nbsp; for (i = 0; i &lt; <span style="font-style: italic;">width</span>;
i++) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (bit(i,j)) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fragment.x =
floor(x<sub>rp</sub> - <span style="font-style: italic;">xOrig</span>)
+ i;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fragment.y =
floor(y<sub>rp</sub> - <span style="font-style: italic;">yOrig</span>)
+ j;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fragment.color
= GL_CURRENT_RASTER_COLOR;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
fragment.texture = GL_CURRENT_RASTER_TEXTURE_COORDS;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
ProcessFragment(fragment)<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br>
&nbsp;&nbsp;&nbsp; }<br>
}<br>
<br>
After the bitmap has been rendered the current raster position is
updated as follows:<br>
<br>
<div style="margin-left: 40px;">x<sub>rp</sub> = x<sub>rp</sub> + <span
 style="font-style: italic;">xMove</span><br>
y<sub>rp</sub> = y<sub>rp</sub> + <span style="font-style: italic;">yMove</span><br>
</div>
<br>
<h3>4.5.3 Per-fragment Operations</h3>
XXX supported? &nbsp;See issue in appendix A.<br>
<br>
<h2>4.6 Unsupported Commands</h2>
The following commands related to rasterization are not supported by
the subset.<br>
<br>
<div style="margin-left: 40px;">Point commands:<br>
<div style="margin-left: 40px;"><span style="font-weight: bold;">glPointSize</span><br>
</div>
<br>
Polygon commands:<br>
<div style="margin-left: 40px; font-weight: bold;">glPolygonStipple<br>
glPolygonOffset<br>
glPolygonMode<br>
<br>
</div>
</div>
<div style="margin-left: 40px;">Pixel storage commands:<br>
</div>
<div style="font-weight: bold; margin-left: 80px;">glPixelStoref<br>
</div>
<br>
<br>
<h1>5. Texture Mapping<br>
</h1>
There are four elements to texture mapping: texture coordinate
specification, texture image specification, texture sampling and texture
application.<br>
<br>
Texture mapping is enabled and disabled with the commands <span
 style="font-weight: bold;">glEnable</span>(GL_TEXTURE_2D) and <span
 style="font-weight: bold;">glDisable</span>(GL_TEXTURE_2D).<br>
<br>
<h2>5.1 Texture Image Specification</h2>
A texture image is specified with the command:<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glTexImage2D</span>(GLenum<span
 style="font-style: italic;"> target</span>, GLint <span
 style="font-style: italic;">level</span>, GLint <span
 style="font-style: italic;">internalFormat,</span> GLsizei <span
 style="font-style: italic;">width,</span> GLsizei <span
 style="font-style: italic;">height,</span> GLint <span
 style="font-style: italic;">border,</span> GLenum <span
 style="font-style: italic;">format,</span> GLenum <span
 style="font-style: italic;">type,</span> const GLvoid *<span
 style="font-style: italic;">pixels</span> )<br>
</div>
<br>
<span style="font-style: italic;">target</span> must be GL_TEXTURE_2D.
&nbsp;<span style="font-style: italic;">level </span>indicates the
mipmap level for mipmap textures. &nbsp;<span style="font-style: italic;">internalFormat</span>
is a hint to indicate the preferred internal storage format for the
texture. &nbsp;<span style="font-style: italic;">width</span> and <span
 style="font-style: italic;">height </span>indicate the image size in
pixels (or texels). &nbsp;<span style="font-style: italic;">border </span>must
be zero. &nbsp;<span style="font-style: italic;">format</span> and <span
 style="font-style: italic;">type</span> describe the pixel format and
data type for the incoming image. &nbsp;<span style="font-style: italic;">pixels</span>
points to the incoming texture image. &nbsp;These parameters are
described in more detail below.<br>
<br>
<h3>5.1.1 Texture Image Size and Mipmaps</h3>
<h3><span style="font-style: italic;"></span></h3>
Texture images must have dimensions (width and height) that are powers
of two. For example: 256 x 256, 32 x 1024, 1 x 8, etc. &nbsp;That is, it
must be the case that <span style="font-style: italic;">width </span>=
2<sup>n</sup> and <span style="font-style: italic;">height</span> = 2<sup>m</sup>
for some positive integers n and m.<br>
<br>
Mipmapping is a method of antialiasing or filtering textures to improve
their appearance. &nbsp;A mipmap is a set of images consisting of a base
image and a set of filtered, reduced-resolution images. &nbsp;If the
base image (<span style="font-style: italic;">level</span>=0) is of
width 2<sup>n</sup> and height 2<sup>m</sup> then the level 1 image must
be of width 2<sup>n-1</sup> and height 2<sup>m-1</sup>. &nbsp;Each mipmap
level is half the width and height of the previous level, or at least
one. &nbsp;The last mipmap level has a width and height of one.<br>
<br>
The following is an example of a mipmap's image levels:<br>
<br>
<table cellpadding="2" cellspacing="2" border="1"
 style="text-align: left; width: 50%; margin-left: auto; margin-right: auto;">
  <tbody>
    <tr>
      <td style="vertical-align: top;">mipmap level<br>
      </td>
      <td style="vertical-align: top;">width<br>
      </td>
      <td style="vertical-align: top;">height<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">0<br>
      </td>
      <td style="vertical-align: top;">256<br>
      </td>
      <td style="vertical-align: top;">64<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">128<br>
      </td>
      <td style="vertical-align: top;">32<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">2<br>
      </td>
      <td style="vertical-align: top;">64<br>
      </td>
      <td style="vertical-align: top;">16<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">3<br>
      </td>
      <td style="vertical-align: top;">32<br>
      </td>
      <td style="vertical-align: top;">8<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">4<br>
      </td>
      <td style="vertical-align: top;">16<br>
      </td>
      <td style="vertical-align: top;">4<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">5<br>
      </td>
      <td style="vertical-align: top;">8<br>
      </td>
      <td style="vertical-align: top;">2<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">6<br>
      </td>
      <td style="vertical-align: top;">4<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">7<br>
      </td>
      <td style="vertical-align: top;">2<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">8<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
    </tr>
  </tbody>
</table>
<br>
If the <span style="font-style: italic;">width</span> or <span
 style="font-style: italic;">height</span> parameters are not powers of
two, the error GL_INVALID_VALUE is raised. &nbsp;If the image levels in
a mipmap do not satisfy the restrictions listed above the texture is
considered to be <span style="font-style: italic;">inconsistent</span>
and the system will behave as if the texturing is disabled.<br>
<br>
<h3>5.1.2 Texture Image Formats and Unpacking</h3>
The <span style="font-weight: bold;">glTexImage2D</span> command's <span
 style="font-style: italic;"><span style="font-weight: bold;"></span></span><span
 style="font-style: italic;">format</span> and <span
 style="font-style: italic;">type</span> parameters describe the format
of the incoming texture image.&nbsp; Accepted values for <span
 style="font-style: italic;">format</span> are GL_INTENSITY, GL_RGB and
GL_RGBA. &nbsp;The <span style="font-style: italic;">type</span>
parameter must be GL_UNSIGNED_BYTE. &nbsp;Pixel component values are
thus in the range 0 through 255.<br>
<br>
If <span style="font-style: italic;">format</span> is GL_INTENSITY then
the image has one byte per pixel which specifies the pixel's red, green,
blue and alpha values.<span style="font-style: italic;"></span><br>
<br>
If <span style="font-style: italic;">format</span> is GL_RGB then the
image has three bytes per pixel which specify the pixel's red, green and
blue values (in that order). &nbsp;The alpha value defaults to 255.<br>
<br>
If <span style="font-style: italic;">format</span> is GL_RGBA then the
image has four bytes per pixel which specify the pixel's red, green,
blue and alpha values (in that order).<br>
<br>
The command<br>
<br>
<div style="margin-left: 40px;">void<span style="font-weight: bold;">
glPixelStorei</span>(GLenum <span style="font-style: italic;">pname</span>,
GLint <span style="font-style: italic;">value</span>)<br>
</div>
<br>
controls the unpacking of texture image data from client memory. &nbsp;<span
 style="font-style: italic;">pname</span> may be GL_UNPACK_ROW_LENGTH to
indicate the stride, in pixels, between subsequent rows of the image in
client memory. &nbsp;If GL_UNPACK_ROW_LENGTH is zero (the default) then
the <span style="font-style: italic;">width</span> parameter to <span
 style="font-weight: bold;">glTexImage2D </span>determines the stride.<span
 style="font-style: italic;"></span><br>
<br>
<h3>5.1.3 Internal Texture Format</h3>
<span style="font-weight: bold;">glTexImage2D<span
 style="font-style: italic;"> </span></span>converts the incoming
texture image to one of the supported internal texture formats.<br>
<br>
The <span style="font-style: italic;">internalFormat</span> parameter
indicates the desired internal format for the texture and may be either
GL_INTENSITY8, GL_RGB5 or GL_RGBA8.<br>
<br>
If <span style="font-style: italic;">internalFormat</span> is
GL_INTENSITY8 then the texture has one byte per texel (texture element)
which indicates the texel's intensity (or brightness). &nbsp;The
intensity is obtained from the incoming image's red channel.<br>
<br>
If <span style="font-style: italic;">internalFormat</span> is GL_RGB5
then the texture is stored with two bytes per texel: &nbsp;5 bits per
red value, 5 bits per green value and 5 bits per blue value.<br>
<br>
If <span style="font-style: italic;">internalFormat </span>is
GL_RGBA8 then the texture is stored with four bytes per texel: &nbsp;8
bits for each of the red, green, &nbsp;blue and alpha values.<br>
<br>
The internal format is also significant to texture application (see
section 5.4).<br>
<br>
<h2>5.2 Texture Coordinates</h2>
Texture coordinates control the mapping from local polygon space to
texture image space. &nbsp;Texture coordinates are set for each vertex
with the <span style="font-weight: bold;">glTexCoord</span> commands.
&nbsp;During line and polygon rasterization the vertex's texture
coordinates are interpolated across the primitive to produce a texture
coordinate for each fragment. &nbsp;The fragment texture coordinates are
used to sample the current texture image.<br>
<br>
Texture coordinates are normally in the range [0, 1]. &nbsp;Values
outside that range are processed according to the <span
 style="font-style: italic;">texture wrap mode</span>. &nbsp;The
texture wrap mode is set with the command<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glTexParameteri</span>(GLenum<span
 style="font-style: italic;"> target</span>, GLenum <span
 style="font-style: italic;">pname</span>, GLint <span
 style="font-style: italic;">value</span>)<br>
<br>
</div>
<span style="font-style: italic;">target</span> must be GL_TEXTURE_2D.
&nbsp;If <span style="font-style: italic;">pname</span> is
GL_TEXTURE_WRAP_S or GL_TEXTURE_WRAP_T then <span
 style="font-style: italic;">value</span> must be either
GL_CLAMP_TO_EDGE or GL_REPEAT.<br>
<br>
For GL_CLAMP_TO_EDGE, texture coordinates are effectively clamped to
the interval [0, 1].<br>
<br>
For GL_REPEAT, the integer part of texture coordinates is ignored; only
the fractional part of the texture coordinates is used. &nbsp;This
allows texture images to repeated or tiled across an object.<br>
<br>
<h2>5.3 Texture Sampling</h2>
Texture sampling is the process of using texture coordinates to extract
a color from the texture image. &nbsp;Multiple, weighted samples may be
taken from the texture and combined during the filtering step.<br>
<br>
During texture coordinate interpolation a <span
 style="font-style: italic;">level of detail</span> value (lambda) is
computed for each fragment. &nbsp;For a mipmapped texture, lambda
determines which level (or levels) of the mipmap will be sampled to
obtain the texture color.<br>
<br>
If lambda indicates that multiple texels map to a single screen pixel,
then the texture <span style="font-style: italic;">minification</span>
filter will be used. &nbsp;Otherwise, if lambda indicates that a single
texel maps to multiple screen pixels, then the texture <span
 style="font-style: italic;">magnification</span> filter will be used.<br>
<span style="font-weight: bold;"></span><span
 style="font-style: italic;"></span><br>
<h3>5.3.1 Texture Minification</h3>
The texture minification filter is set with the <span
 style="font-weight: bold;">glTexParameteri </span><span
 style="font-style: italic;"></span><span style="font-weight: bold;"></span><span
 style="font-style: italic;"></span> command by setting <span
 style="font-style: italic;">target</span> to GL_TEXTURE_2D, setting <span
 style="font-style: italic;">pname</span> to GL_TEXTURE_MIN_FILTER and
setting <span style="font-style: italic;">value</span> to GL_NEAREST,
GL_LINEAR, GL_NEAREST_MIPMAP_NEAREST,&nbsp;
GL_NEAREST_MIPMAP_LINEAR,&nbsp; &nbsp;GL_LINEAR_MIPMAP_NEAREST or
GL_LINEAR_MIPMAP_LINEAR.<br>
<br>
GL_NEAREST samples the texel nearest the texture coordinate in the
level 0 texture image.<br>
<br>
GL_LINEAR samples the four texels around the texture coordinate in the
level 0 texture image. &nbsp;The four texels are linearly weighted to
compute the final texel value.<br>
<br>
GL_NEAREST_MIPMAP_NEAREST samples the texel nearest the texture
coordinate in the level N texture image. &nbsp;N is the level of detail
and is computed by the partial derivatives of the texture coordinates
with respect to the window coordinates.<br>
<br>
GL_NEAREST_MIPMAP_LINEAR samples two texels nearest the texture
coordinates in the level N and N+1 texture images. &nbsp;The two texels
are linearly weighted to compute the final texel value. &nbsp;N is the
level of detail and is computed by the partial derivatives of the
texture coordinates with respect to the window coordinates.<br>
<br>
GL_LINEAR_MIPMAP_NEAREST samples four texels around the texture
coordinate in the level N texture image. &nbsp;The four texels are
linearly weighted to compute the final texel value. &nbsp;N is the level
of detail and is computed by the partial derivatives of the texture
coordinates with respect to the window coordinates.<br>
<br>
GL_LINEAR_MIPMAP_LINEAR samples four texels around the texture
coordinate in the level N texture image and four texels around the
texture coordinate in the level N+1 texture image. &nbsp;The eight
texels are linearly weighted to compute the final texel value. &nbsp;N
is the level of detail and is computed by the partial derivatives of the
texture coordinates with respect to the window coordinates.<br>
<br>
Filter modes other than GL_LINEAR and GL_NEAREST requires that the
texture have a complete set of mipmaps. &nbsp;If the mipmap is
incomplete, it is as if texturing is disabled.<br>
&nbsp;<br>
<h3>5.3.2 Texture Magnification</h3>
The texture magnification filter is set with the <span
 style="font-weight: bold;">glTexParameteri </span><span
 style="font-style: italic;"></span><span style="font-weight: bold;"></span>command
by setting <span style="font-style: italic;">target</span> to
GL_TEXTURE_2D, setting <span style="font-style: italic;">pname</span> to
GL_TEXTURE_MAG_FILTER and setting <span style="font-style: italic;">value</span>
to GL_NEAREST or GL_LINEAR.<br>
<br>
GL_NEAREST samples the texel nearest the texture coordinate in the
level 0 texture image.<br>
<br>
GL_LINEAR samples the four texels around the texture coordinate in the
level 0 texture image. &nbsp;The four texels are linearly weighted to
compute the final texel value.<br>
<br>
<h2>5.4 Texture Application</h2>
The sampled texture value is combined with the incoming fragment color
to produce a new fragment color. &nbsp;The fragment and texture colors
are combined according to the texture environment mode and the current
texture's base internal format. &nbsp;The texture environment mode is
set with the command<br>
<br>
<div style="margin-left: 40px;">void<span style="font-weight: bold;">
glTexEnvi</span>(GLenum <span style="font-style: italic;">target</span>,
GLenum <span style="font-style: italic;">pname</span>, GLint <span
 style="font-style: italic;">value</span>)<br>
</div>
<br>
<span style="font-style: italic;">target</span> must be GL_TEXTURE_ENV.
&nbsp;If <span style="font-style: italic;">pname</span> is
GL_TEXTURE_ENV_MODE then <span style="font-style: italic;">value</span>
must be one of GL_REPLACE, GL_MODULATE, GL_DECAL, or GL_BLEND.<br>
<br>
There is also a <span style="font-style: italic;">texture environment
color</span> that can factor into texture application. &nbsp;The texture
environment color can be set with the command<br>
<br>
<div style="margin-left: 40px;">void<span style="font-weight: bold;">
glTexEnvfv</span>(GLenum <span style="font-style: italic;">target</span>,
GLenum <span style="font-style: italic;">pname</span>, const GLfloat *<span
 style="font-style: italic;">value</span>)<br>
</div>
<span style="font-style: italic;"></span><br>
<span style="font-style: italic;">target</span> must be GL_TEXTURE_ENV.
&nbsp;If <span style="font-style: italic;">pname</span> is
GL_TEXTURE_ENV_COLOR then <span style="font-style: italic;">value </span>must
point to an array of four values which specify the red, green, blue,
and alpha values of the texture environment color. &nbsp;The values are
clamped to the range [0, 1]. &nbsp;The default color is (0, 0, 0, 0).<br>
<span style="font-style: italic;"></span><br>
The following table describes the arithmetic used for each combination
of environment mode and base internal format. &nbsp;(Rf, Gf, Bf, Af) is
the incoming fragment color. &nbsp;(Rt, Gt, Bt, At) is the sampled
texture color. &nbsp;Lt is the sampled texture luminance. &nbsp;<span
 style="font-style: italic;"></span>'It' is the sampled texture
intensity. &nbsp;(Rc, Gc, Bc, Ac) is the texture environment color.
&nbsp;(Rv, Gv, Bv, Av) is the resulting value.<br>
<br>
<br>
<table cellpadding="2" cellspacing="2" border="1"
 style="text-align: left; width: 90%; margin-left: auto; margin-right: auto;">
  <tbody>
    <tr>
      <td style="vertical-align: top;">Base Internal Format<br>
      </td>
      <td style="vertical-align: top;">GL_REPLACE<br>
      </td>
      <td style="vertical-align: top;">GL_MODULATE<br>
      </td>
      <td style="vertical-align: top;">GL_DECAL<br>
      </td>
      <td style="vertical-align: top;">GL_BLEND<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_INTENSITY<br>
      </td>
      <td style="vertical-align: top;">Rv = It<br>
Gv = It<br>
Bv = It<br>
Bf = It<br>
      </td>
      <td style="vertical-align: top;">Rv = Rf * It<br>
Gv = Gf * It<br>
Bv = Bf * It<br>
Av = Af * It</td>
      <td style="vertical-align: top;">undefined<br>
      </td>
      <td style="vertical-align: top;">Rv = Rf*(1-It) + Rc*It<br>
Gv = Gf*(1-It) + Gc*It<br>
Bv = Bf*(1-It) + Bc*It<br>
Av = Af*(1-It) + Ac*It</td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_RGB<br>
      </td>
      <td style="vertical-align: top;">Rv = Rt<br>
Gv = Gt<br>
Bv = Bt<br>
Av = Af<br>
      </td>
      <td style="vertical-align: top;">Rv = Rf * Rt<br>
Gv = Gf * Gt<br>
Bv = Bf * Bt<br>
Av = Af<br>
      </td>
      <td style="vertical-align: top;">Rv = Rt<br>
Gv = Gt<br>
Bv = Bt<br>
Av = Af</td>
      <td style="vertical-align: top;">Rv = Rf*(1-Rt) + Rc*Rt<br>
Gv = Gf*(1-Gt) + Gc*Gt<br>
Bv = Bf*(1-Bt) + Bc*Bt<br>
Av = Af</td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_RGBA<br>
      </td>
      <td style="vertical-align: top;">Rv = Rt<br>
Gv = Gt<br>
Bv = Bt<br>
Av = At<br>
      </td>
      <td style="vertical-align: top;">Rv = Rf * Rt<br>
Gv = Gf * Gt<br>
Bv = Bf * Bt<br>
Av = Af * At</td>
      <td style="vertical-align: top;">Rv = Rf*(1-At) + Rt*At<br>
Gv = Gf*(1-At) + Gt*At<br>
Bv = Bf*(1-At) + Bt*At<br>
Av = Af<br>
      </td>
      <td style="vertical-align: top;">Rv = Rf*(1-Rt) + Rc*Rt<br>
Gv = Gf*(1-Gt) + Gc*Gt<br>
Bv = Bf*(1-Bt) + Bc*Bt<br>
Av = Af*At</td>
    </tr>
  </tbody>
</table>
<br>
<br>
<br>
<h2>5.5 Texture Objects</h2>
Texture objects encapsulate a set of texture images (mipmap) and
related state into a named object. &nbsp;This facilitates use of
multiple textures in an application. &nbsp;Texture objects are named
with GLuints (unsigned integers). &nbsp;There is a default texture
object with the name/identifier zero which can never be deleted.<br>
<br>
<h3>5.5.1 Creating Texture Objects</h3>
A texture object is created by binding a new GLuint identifier to the
GL_TEXTURE_2D target with the command:<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glBindTexture</span>(GLenum<span
 style="font-style: italic;"> target</span>, GLuint <span
 style="font-style: italic;">textureID</span>)<br>
</div>
<br>
<span style="font-style: italic;">target</span> must be GL_TEXTURE_2D.
&nbsp;<span style="font-style: italic;">textureID</span> may be any
unsigned integer. &nbsp;If <span style="font-style: italic;">textureID</span>
does not name an existing texture object, a new texture object with that
ID will be created, initialized to the default state. &nbsp;Whether the
ID is new or existed previously, that named texture object is bound as
the <span style="font-style: italic;">current texture object</span>.
&nbsp;Subsequent <span style="font-weight: bold;">glTexParameter </span>and<span
 style="font-weight: bold;">glTexImage2D<span
 style="font-style: italic;"> </span></span>calls will effect the
current texture object.<br>
<span style="font-style: italic;"></span><span
 style="font-weight: bold;"><span style="font-style: italic;"> </span></span><br>
<h3>5.5.2 Deleting Texture Objects</h3>
One or more texture objects may be deleted with the command:<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glDeleteTextures</span>(GLsizei<span
 style="font-style: italic;">n</span>, const GLuint *<span
 style="font-style: italic;">textureIDs</span>)<br>
</div>
<br>
<span style="font-style: italic;">textureIDs</span> is an array of <span
 style="font-style: italic;">n</span> texture IDs. &nbsp;The named
texture objects will be deleted. &nbsp;If the current texture object is
deleted the default texture object (number 0) will be bound as the
current texture object.<br>
<br>
<h3>5.5.3 Allocating Texture Object Identifiers</h3>
A list of new, unused texture IDs can be obtained by calling the command<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glGenTextures</span>(GLsizei<span
 style="font-style: italic;"> n</span>, GLuint *<span
 style="font-style: italic;">textureIDs</span>)<br>
</div>
<br>
An array of <span style="font-style: italic;">n</span> unused texture
IDs will be returned in the <span style="font-style: italic;">textureIDs</span>
array.<br>
<br>
<br>
<h1>6. Per-fragment Operations</h1>
The fragments produced by rasterization are subjected to a number of
operations which either modify the fragment or test the fragment
(discarding the fragment if the test fails.) &nbsp;This chapter
describes the per-fragment operations. &nbsp;They are presented in the
order in which they're performed. &nbsp;If a fragment fails a test it is
discarded and not subjected to subsequent tests or modifications.<br>
<br>
<h2>6.1 Scissor Test</h2>
The scissor test limits rendering to a 2-D rectangular region of the
framebuffer. &nbsp;The command<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glScissor</span>(GLint<span
 style="font-style: italic;">x</span>, GLint <span
 style="font-style: italic;">y</span>, GLsizei <span
 style="font-style: italic;">width</span>, GLsizei<span
 style="font-style: italic;"> height</span>)<br>
</div>
<br>
defines a clipping region with the lower-left corner at (<span
 style="font-style: italic;">x, y</span>) and the given <span
 style="font-style: italic;">width</span> and <span
 style="font-style: italic;">height</span>. &nbsp;The scissor test is
enabled and disabled with the command <span style="font-weight: bold;">glEnable</span>(GL_SCISSOR_TEST)
and <span style="font-weight: bold;">glDisable</span>(GL_SCISSOR_TEST).<br>
<br>
If the incoming fragment's position is (x<sub>f</sub>, y<sub>f</sub>)
then the fragment will pass the test if <span
 style="font-style: italic;">x</span> &lt;= x<sub>f</sub> &lt; <span
 style="font-style: italic;">x</span> + <span
 style="font-style: italic;">width</span> and <span
 style="font-style: italic;">y</span> &lt;= y<sub>f</sub> &lt; <span
 style="font-style: italic;">y</span> + <span
 style="font-style: italic;">height. &nbsp;</span>Otherwise, the
fragment is discarded.<br>
<br>
If <span style="font-style: italic;">width</span> or <span
 style="font-style: italic;">height</span> is less than zero the error
GL_INVALID_VALUE is raised. &nbsp;The default scissor rectangle bounds
are (0, 0, w, h) where w is the initial window width and h is the
initial window height. &nbsp;The scissor test is disabled by default.<br>
<br>
<h2>6.2 Alpha Test</h2>
The alpha test compares the fragment's alpha value against a reference
value and discards the fragment if the comparison fails. &nbsp;The test
is specified by the command<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glAlphaFunc</span>(GLenum<span
 style="font-style: italic;">mode</span>, GLclampf <span
 style="font-style: italic;">reference</span>)<br>
</div>
<br>
<span style="font-style: italic;">mode</span> specifies an inequality
and <span style="font-style: italic;">reference</span> specifies a value
to compare against. &nbsp;The following table lists all possible
modes&nbsp;<span style="font-style: italic;"></span>and the
corresponding test:<br>
<br>
<table cellpadding="2" cellspacing="2" border="1"
 style="text-align: left; width: 50%; margin-left: auto; margin-right: auto;">
  <tbody>
    <tr>
      <td style="vertical-align: top;">Comparison mode<br>
      </td>
      <td style="vertical-align: top;">The test passes if<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_LESS<br>
      </td>
      <td style="vertical-align: top;">alpha &lt; <span
 style="font-style: italic;">reference</span><br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_LEQUAL<br>
      </td>
      <td style="vertical-align: top;">alpha &lt;= <span
 style="font-style: italic;">reference</span></td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_GREATER<br>
      </td>
      <td style="vertical-align: top;">alpha &gt; <span
 style="font-style: italic;">reference</span></td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_GEQUAL<br>
      </td>
      <td style="vertical-align: top;">alpha &gt;= <span
 style="font-style: italic;">reference</span></td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_EQUAL<br>
      </td>
      <td style="vertical-align: top;">alpha == <span
 style="font-style: italic;">reference</span></td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_NOTEQUAL<br>
      </td>
      <td style="vertical-align: top;">alpha != <span
 style="font-style: italic;">reference</span></td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_NEVER<br>
      </td>
      <td style="vertical-align: top;">never pass<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_ALWAYS<br>
      </td>
      <td style="vertical-align: top;">always passes<br>
      </td>
    </tr>
  </tbody>
</table>
<br>
The <span style="font-style: italic;">reference</span> parameter is
clamped to the range [0, 1].<br>
<br>
The alpha test is enabled and disabled with the commands <span
 style="font-weight: bold;">glEnable</span>(GL_ALPHA_TEST) and <span
 style="font-weight: bold;">glDisable</span>(GL_ALPHA_TEST).<br>
<br>
The default mode is GL_ALWAYS and the default reference value is 0.<br>
<br>
<h2>6.3 Stencil Test</h2>
The stencil buffer stores an N-bit integer value for each pixel in the
frame buffer. &nbsp;The stencil test compares the stencil buffer value
at the fragment's position to a reference value and possibly discards
the fragment based on the outcome. &nbsp;Furthermore, the stencil buffer
value may be updated or modified depending on the outcome. &nbsp;If
there is no stencil buffer the stencil test is bypassed.<br>
<br>
Stenciling is controlled by the commands<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glStencilFunc</span>(GLenum<span
 style="font-style: italic;">func</span>, GLint <span
 style="font-style: italic;">ref</span>, GLuint <span
 style="font-style: italic;">mask</span>)<br>
void <span style="font-weight: bold;">glStencilOp</span>(GLenum <span
 style="font-style: italic;">stencilFail</span>, GLenum <span
 style="font-style: italic;">depthTestFail</span>, GLenum <span
 style="font-style: italic;">depthTestPass</span>)<br>
</div>
<br>
The <span style="font-weight: bold;">glStencilFunc<span
 style="font-style: italic;"> </span></span>command controls the
stencil test while <span style="font-weight: bold;">glStencilOp</span>
command controls the how the stencil buffer is updated/modified after
the test.<br>
<br>
<span style="font-style: italic;">ref</span> is clamped to the range [0,
2<sup>N</sup>-1] where N is the number of bits per stencil value in the
stencil buffer.<span style="font-style: italic;"></span><br>
<br>
The following table lists all possible values for the <span
 style="font-style: italic;">func</span> parameter and when the stencil
test will pass. &nbsp;Both the stencil buffer value and the stencil
reference value are bit-wise ANDed with the <span
 style="font-style: italic;">mask</span> parameter before the test.<br>
<br>
<span style="font-style: italic;"></span><span
 style="font-style: italic;"></span><span style="font-style: italic;"></span>
<table
 style="text-align: left; margin-left: auto; margin-right: auto; width: 70%;"
 border="1" cellspacing="2" cellpadding="2">
  <tbody>
    <tr>
      <td style="vertical-align: top;">Stencil <span
 style="font-style: italic;">func</span> value<br>
      </td>
      <td style="vertical-align: top;">Stencil test passes if<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_LESS<br>
      </td>
      <td style="vertical-align: top;"><span style="font-style: italic;">(ref</span>&amp;<span
 style="font-style: italic;">mask)</span> &lt; (stencil buffer value
&amp; <span style="font-style: italic;">mask)</span><br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_LEQUAL<br>
      </td>
      <td style="vertical-align: top;"><span style="font-style: italic;">(ref</span>
&amp; <span style="font-style: italic;">mask) </span>&lt;= (stencil
buffer value &amp; <span style="font-style: italic;">mask)</span></td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_GREATER<br>
      </td>
      <td style="vertical-align: top;"><span style="font-style: italic;">(ref</span>
&amp; <span style="font-style: italic;">mask) </span>&gt; (stencil
buffer value &amp; <span style="font-style: italic;">mask)</span></td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_GEQUAL<br>
      </td>
      <td style="vertical-align: top;"><span style="font-style: italic;">(ref</span>
&amp; <span style="font-style: italic;">mask) </span>&gt;= (stencil
buffer value &amp; <span style="font-style: italic;">mask)</span></td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_EQUAL<br>
      </td>
      <td style="vertical-align: top;"><span style="font-style: italic;">(ref</span>
&amp; <span style="font-style: italic;">mask) </span>== (stencil
buffer value &amp; <span style="font-style: italic;">mask)</span></td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_NOTEQUAL<br>
      </td>
      <td style="vertical-align: top;"><span style="font-style: italic;">(ref</span>
&amp; <span style="font-style: italic;">mask) </span>!= (stencil
buffer value &amp; <span style="font-style: italic;">mask)</span></td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_NEVER<br>
      </td>
      <td style="vertical-align: top;">never passes<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_ALWAYS<br>
      </td>
      <td style="vertical-align: top;">always passes<br>
      </td>
    </tr>
  </tbody>
</table>
<br>
<span style="font-style: italic;"></span><br>
If the stencil test passes, the fragment is passed to the next
per-fragment operation. &nbsp;Otherwise, if the stencil test fails, the
value in the stencil buffer is updated according to the value of the <span
 style="font-style: italic;">stencilFail</span> parameter to <span
 style="font-weight: bold;">glStencilOp</span>.<br>
<br>
<table cellpadding="2" cellspacing="2" border="1"
 style="text-align: left; width: 70%; margin-left: auto; margin-right: auto;">
  <tbody>
    <tr>
      <td style="vertical-align: top;"><span style="font-style: italic;">stencilFail</span>
value<br>
      </td>
      <td style="vertical-align: top;">New stencil buffer value<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_KEEP<br>
      </td>
      <td style="vertical-align: top;">originalValue<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_ZERO<br>
      </td>
      <td style="vertical-align: top;">0<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_INVERT<br>
      </td>
      <td style="vertical-align: top;">BitWiseInvert(originalValue)
i.e. ~originalValue<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_REPLACE<br>
      </td>
      <td style="vertical-align: top;"><span style="font-style: italic;">ref</span><br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_INCR<br>
      </td>
      <td style="vertical-align: top;">originalValue + 1, clamped to
[0, 2<sup>N</sup>-1]</td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_DECR<br>
      </td>
      <td style="vertical-align: top;">originalValue - 1, clamped to
[0, 2<sup>N</sup>-1]</td>
    </tr>
  </tbody>
</table>
<span style="font-style: italic;"></span><span
 style="font-style: italic;"></span><br>
<br>
The <span style="font-style: italic;">depthTestFail</span> and <span
 style="font-style: italic;">depthTestPass</span> parameters to <span
 style="font-weight: bold;">glStencilOp</span> are ignored. &nbsp;Values
for <span style="font-style: italic;">func</span> and <span
 style="font-style: italic;">stencilFail</span> other than those listed
in the table will cause the error GL_INVALID_ENUM to be raised.<br>
<br>
The stencil test is enabled and disabled with the commands <span
 style="font-weight: bold;">glEnable</span>(GL_STENCIL_TEST) and <span
 style="font-weight: bold;">glDisable</span>(GL_STENCIL_TEST).<br>
<br>
The default stencil function is GL_ALWAYS. &nbsp;The default stencil
reference value is 0. &nbsp;The default stencil mask is ~0. &nbsp;The
default stencil fail operation is GL_KEEP.<br>
<br>
Values written into the stencil buffer are masked with the command<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glStencilMask</span>(GLuint<span
 style="font-style: italic;">mask</span>)<br>
</div>
<br>
Only the bits which are set in <span style="font-style: italic;">mask</span>
will be modified in the stencil buffer when written to. &nbsp;If each
stencil buffer value has N bits, only the least significant N bits of <span
 style="font-style: italic;">mask</span> are relevant. &nbsp;The default
stencil mask is ~0.<br>
<br>
<h2>6.4 Blending and Logicop</h2>
Blending or a logic operation combines the incoming fragment color with
the destination frame buffer color according to a blending equation or
bit-wise Boolean logical operation.<br>
<br>
Blending is enabled and disabled with the commands <span
 style="font-weight: bold;">glEnable</span>(GL_BLEND) and <span
 style="font-weight: bold;">glDisable</span>(GL_BLEND).<br>
<br>
The logic operation is enabled and disabled with the commands <span
 style="font-weight: bold;">glEnable</span>(GL_LOGIC_OP) and <span
 style="font-weight: bold;">glDisable</span>(GL_LOGIC_OP).<br>
<br>
If both blending and the logic operation are enabled, the logic
operation has higher priority; blending is bypassed.<br>
<br>
<h3>6.4.1 Logic Op</h3>
The command<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glLogicop</span>(GLenum<span
 style="font-style: italic;">mode</span>)<br>
<br>
</div>
Specifies the Boolean logic operation for combining the incoming
fragment color with the destination frame buffer color. &nbsp;Both the
incoming fragment color and destination frame buffer colors are
interpreted as four-tuples of unsigned integer color components in the
range [0, 2<sup>N</sup>-1] where N is the number of bits per color
channel. &nbsp;N may not be the same for all color channels.<br>
<br>
The following table lists all values for <span
 style="font-style: italic;">mode</span> and the boolean arithmetic used
to combine the incoming fragment color value (src)<span
 style="font-style: italic;"></span><span style="font-style: italic;"></span><span
 style="font-style: italic;"></span><span style="font-style: italic;"></span><span
 style="font-style: italic;"></span> with the destination framebuffer
color value (dst). &nbsp;Standard ANSI C operators used.<br>
<br>
<table cellpadding="2" cellspacing="2" border="1"
 style="text-align: left; width: 50%; margin-left: auto; margin-right: auto;">
  <tbody>
    <tr>
      <td style="vertical-align: top;">LogicOp <span
 style="font-style: italic;">mode</span><br>
      </td>
      <td style="vertical-align: top;">Resulting channel value<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_CLEAR<br>
      </td>
      <td style="vertical-align: top;">0<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_SET<br>
      </td>
      <td style="vertical-align: top;">~0<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_COPY<br>
      </td>
      <td style="vertical-align: top;">src<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_COPY_INVERTED<br>
      </td>
      <td style="vertical-align: top;">~s<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_NOOP<br>
      </td>
      <td style="vertical-align: top;">dst<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_INVERT<br>
      </td>
      <td style="vertical-align: top;">~dst<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_AND<br>
      </td>
      <td style="vertical-align: top;">src &amp; dst<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_NAND<br>
      </td>
      <td style="vertical-align: top;">~(src &amp; dst)<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_AND_REVERSE<br>
      </td>
      <td style="vertical-align: top;">src &amp; ~dst<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_AND_INVERTED<br>
      </td>
      <td style="vertical-align: top;">~src &amp; dst<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_OR<br>
      </td>
      <td style="vertical-align: top;">src | dst<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_NOR<br>
      </td>
      <td style="vertical-align: top;">~(src | dst)<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_OR_REVERSE<br>
      </td>
      <td style="vertical-align: top;">src | ~dst<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_OR_INVERTED<br>
      </td>
      <td style="vertical-align: top;">~src | dst<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_XOR<br>
      </td>
      <td style="vertical-align: top;">src ^ dst<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_EQUIV<br>
      </td>
      <td style="vertical-align: top;">~(src ^ dst)<br>
      </td>
    </tr>
  </tbody>
</table>
<br>
The fragment's color is replaced by the result of the logic operation.<br>
<br>
Specifying any value for <span style="font-style: italic;">mode</span>
other than those listed in the above table will cause the error
GL_INVALID_ENUM to be raised.<br>
<br>
The default value for <span style="font-style: italic;">mode</span> is
GL_COPY. &nbsp;The logic operation is disabled by default.<br>
<br>
<h3>6.4.2 Blending</h3>
The command<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glBlendFunc</span>(GLenum<span
 style="font-style: italic;">srcTerm</span>, GLenum <span
 style="font-style: italic;">dstTerm</span>)<br>
</div>
<br>
specifies the terms of the blending equation. &nbsp;If Cf = (Rf, Gf,
Bf, Af) is the incoming fragment color and Cb = (Rb, Gb, Bb, Ab) is the
frame buffer color, then the resulting color Cv = (Rv, Gv, Bv, Av) is
computed by:<br>
<br>
<div style="margin-left: 40px;">Cv = Cf * <span
 style="font-style: italic;">srcTerm</span> + Cb * <span
 style="font-style: italic;">dstTerm</span><br>
<span style="font-style: italic;"></span></div>
<span style="font-style: italic;"> </span><br>
All possible values for <span style="font-style: italic;">srcTerm</span>
and the corresponding arithmetic term are listed in the following table:<br>
<br>
<table cellpadding="2" cellspacing="2" border="1"
 style="text-align: left; width: 70%; margin-left: auto; margin-right: auto;">
  <tbody>
    <tr>
      <td style="vertical-align: top;"><span style="font-style: italic;">srcTerm</span><br>
      </td>
      <td style="vertical-align: top;"><span style="font-style: italic;">srcTerm</span>Arithmetic<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_ZERO<br>
      </td>
      <td style="vertical-align: top;">(0, 0, 0, 0)<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_ONE<br>
      </td>
      <td style="vertical-align: top;">(1, 1, 1, 1)<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_DST_COLOR<br>
      </td>
      <td style="vertical-align: top;">(Rb, Gb, Bb, Ab)<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_ONE_MINUS_DST_COLOR<br>
      </td>
      <td style="vertical-align: top;">(1-Rb, 1-Gb, 1-Bb, 1-Ab)<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_SRC_ALPHA<br>
      </td>
      <td style="vertical-align: top;">(Af, Af, Af, AF)<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_ONE_MINUS_SRC_ALPHA<br>
      </td>
      <td style="vertical-align: top;">(1-Af, 1-Af, 1-Af, 1-Af)<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_DST_ALPHA<br>
      </td>
      <td style="vertical-align: top;">(Ab, Ab, Ab, Ab)<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_ONE_MINUS_DST_ALPHA<br>
      </td>
      <td style="vertical-align: top;">(1-Ab, 1-Ab, 1-Ab, 1-Ab)<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_SRC_ALPHA_SATURATE<br>
      </td>
      <td style="vertical-align: top;">(m, m, m, 1) where m = MIN(Af,
1-Ab)<br>
      </td>
    </tr>
  </tbody>
</table>
<br>
All possible values for <span style="font-style: italic;">srcTerm</span>
and the corresponding arithmetic term are listed in the following table:<br>
<br>
<table cellpadding="2" cellspacing="2" border="1"
 style="text-align: left; width: 70%; margin-left: auto; margin-right: auto;">
  <tbody>
    <tr>
      <td style="vertical-align: top;"><span style="font-style: italic;">dstTerm</span><br>
      </td>
      <td style="vertical-align: top;"><span style="font-style: italic;">dstTerm</span>Arithmetic<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_ZERO<br>
      </td>
      <td style="vertical-align: top;">(0, 0, 0, 0)<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_ONE<br>
      </td>
      <td style="vertical-align: top;">(1, 1, 1, 1)<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_SRC_COLOR<br>
      </td>
      <td style="vertical-align: top;">(Rf, Gf, Bf, Af)<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_ONE_MINUS_SRC_COLOR<br>
      </td>
      <td style="vertical-align: top;">(1-Rf, 1-Gf, 1-Bf, 1-Af)<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_SRC_ALPHA<br>
      </td>
      <td style="vertical-align: top;">(Af, Af, Af, AF)<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_ONE_MINUS_SRC_ALPHA<br>
      </td>
      <td style="vertical-align: top;">(1-Af, 1-Af, 1-Af, 1-Af)<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_DST_ALPHA<br>
      </td>
      <td style="vertical-align: top;">(Ab, Ab, Ab, Ab)<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_ONE_MINUS_DST_ALPHA<br>
      </td>
      <td style="vertical-align: top;">(1-Ab, 1-Ab, 1-Ab, 1-Ab)<br>
      </td>
    </tr>
  </tbody>
</table>
<br>
The fragment's color is replaced by the result of the blending equation.<br>
<br>
Values for <span style="font-style: italic;">srcTerm</span> and <span
 style="font-style: italic;">dstTerm</span> other than those listed in
the table will cause the error GL_INVALID_ENUM to be raised.<br>
<br>
The default value for <span style="font-style: italic;">srcTerm</span>
is GL_ONE. &nbsp;The default value for <span style="font-style: italic;">dstTerm</span>
is GL_ZERO. &nbsp;Blending is disabled by default.<br>
<br>
<h2>6.5 Color Mask</h2>
The final fragment color is written into the current color buffer at
the end of the per-fragment operations. &nbsp;Normally, all color
channels in the frame buffer are replaced with the final fragment color.
&nbsp;However, the command<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glColorMask</span>(GLboolean<span
 style="font-style: italic;">redMask</span>, GLboolean <span
 style="font-style: italic;">greenMask</span>, GLboolean <span
 style="font-style: italic;">blueMask</span>, GLboolean <span
 style="font-style: italic;">alphaMask</span>)<br>
</div>
<br>
allows selective writing to individual color channels. &nbsp;If <span
 style="font-style: italic;">redMask</span> is GL_TRUE then writing to
the red color channel is enabled, otherwise it's disabled.
&nbsp;Similarly, the green, blue and alpha channels can also be masked.<br>
<br>
Initially all four mask values are GL_TRUE.<br>
<br>
Color masking is not enabled/disabled with the <span
 style="font-weight: bold;">glEnable</span>/<span
 style="font-weight: bold;">glDisable</span> commands.<br>
<br>
<h1>7. Frame Buffer Operations</h1>
The frame buffer is considered to be a two-dimensional array of pixels.
&nbsp;The frame buffer is also organized into layers or logical buffers.
&nbsp;There may be a front color buffer, back color buffer and stencil
buffer. &nbsp;A double-buffered frame buffer has both a front color
buffer and back color buffer. &nbsp;A single-buffered framebuffer only
has a front color buffer. &nbsp;Each pixel in a color buffer has a red,
green and blue value and an optional alpha value.<br>
<br>
<h2>7.1 Clearing Buffers</h2>
Buffers are cleared (set to uniform values) with the command<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glClear</span>(GLbitfield<span
 style="font-style: italic;">buffers</span>)<br>
</div>
<br>
<span style="font-style: italic;">buffers</span> is a bitmask for which
the value may be the bitwise-OR of the values GL_COLOR_BUFFER_BIT and
GL_STENCIL_BUFFER_BIT. &nbsp;If the GL_COLOR_BUFFER_BIT bit is
specified, the current color buffer will be cleared. &nbsp;If the
GL_STENCIL_BUFFER_BIT bit is specified, the stencil buffer will be
cleared.<br>
<br>
The current color buffer is specified with the command<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glDrawBuffer</span>(GLenum<span
 style="font-style: italic;"> buffer</span>)<br>
</div>
<br>
<span style="font-style: italic;">buffer</span> may be either GL_FRONT,
GL_BACK or GL_NONE. &nbsp;GL_FRONT indicates that the front color buffer
will be modified by <span style="font-weight: bold;">glClear</span> and
any drawing command. &nbsp;GL_BACK indicates that the back color buffer
will be modified by <span style="font-weight: bold;">glClear</span> and
any drawing command. &nbsp;GL_NONE indicates that neither color buffer
will be modified by <span style="font-weight: bold;">glClear</span> or
any drawing command. &nbsp;GL_BACK is only valid for double-buffered
frame buffers.<br>
<br>
The current scissor rectangle, set by the <span
 style="font-weight: bold;">glScissor</span> command, effects <span
 style="font-weight: bold;">glClear</span><span
 style="font-style: italic;">,</span><span style="font-style: italic;"> </span>limiting
the clear to the scissor rectangle, if it's enabled. &nbsp;Furthermore, <span
 style="font-weight: bold;"></span>only the color channels enabled by <span
 style="font-weight: bold;">glColorMask</span> will be effected by <span
 style="font-weight: bold;">glClear</span>(GL_COLOR_BUFFER_BIT).
&nbsp;Likewise, only the stencil bits enabled by <span
 style="font-weight: bold;">glStencilMask</span> will be effected by <span
 style="font-weight: bold;">glClear</span>(GL_STENCIL_BUFFER_BIT).<br>
<br>
The current clear color is set with the command<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glClearColor</span>(GLclampf<span
 style="font-style: italic;">red</span>, GLclampf <span
 style="font-style: italic;">green</span>, GLclampf <span
 style="font-style: italic;">blue</span>, GLclampf <span
 style="font-style: italic;">alpha</span>)<br>
</div>
<br>
Subsequent calls to <span style="font-weight: bold;">glClear</span>
will use the color (<span style="font-style: italic;">red, green, blue,
alpha</span>) to clear the front or back color buffers.<br>
<span style="font-style: italic;"></span><br>
The current stencil clear value is set with the command<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glClearStencil</span>(GLint<span
 style="font-style: italic;">clearValue</span>)<br>
</div>
<br>
If the stencil buffer is N bits deep, the least significant N bits of <span
 style="font-style: italic;">clearValue</span> will be used to clear the
stencil buffer.<br>
<br>
<br>
<h1>8. Other Features</h1>
<h2>8.1 Frame Buffer Readback</h2>
A rectangular region of pixels can be read from the frame buffer and
placed in client memory with the command<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glReadPixels</span>(GLint<span
 style="font-style: italic;">x</span>, GLint <span
 style="font-style: italic;">y</span>, GLsizei <span
 style="font-style: italic;">width</span>, GLsizei <span
 style="font-style: italic;">height</span>, GLenum <span
 style="font-style: italic;">format</span>, GLenum <span
 style="font-style: italic;">type</span>, GLvoid *<span
 style="font-style: italic;">data</span>)<br>
</div>
<br>
<span style="font-style: italic;">x</span> and <span
 style="font-style: italic;">y</span> specify the coordinate of the
lower-left corner of the region to read and <span
 style="font-style: italic;">width</span> and <span
 style="font-style: italic;">height</span> specify the size of the
rectangular region to read. &nbsp;<span style="font-style: italic;">format</span>
specifies the format of image data and must be either GL_RGB or
GL_RGBA.&nbsp; <span style="font-style: italic;">type</span> specify the
data type of the image data and must be either GL_UNSIGNED_BYTE or
GL_FLOAT. &nbsp;Other values for <span style="font-style: italic;">format</span>
or <span style="font-style: italic;">type</span> will cause the error
GL_INVALID_ENUM to be raised.<br>
<br>
The framebuffer may contain 3-component colors (red, green, blue) or
4-component colors (red, green, blue, alpha). &nbsp;If an alpha channel
is not present, alpha values default to 1.0.<br>
<br>
The frame buffer color components (red, green, blue, alpha) are either
converted to 8-bit unsigned integers in the range[0, 255] if <span
 style="font-style: italic;">type </span>is GL_UNSIGNED_BYTE or
converted to floating point values in the range [0, 1] if <span
 style="font-style: italic;">type</span> is GL_FLOAT. &nbsp;The (red,
green, blue, alpha) tuples are then stored as GL_RGB triplets (by
dropping the alpha component) or GL_RGBA quadruples in client memory.<br>
<br>
Image data is <span style="font-style: italic;">packed</span> into
client memory according to the pixel packing parameters which are set by
the command<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glPixelStorei</span>(GLenum<span
 style="font-style: italic;"> pname</span>, GLint <span
 style="font-style: italic;">value</span>)<br>
</div>
<br>
<span style="font-style: italic;">pname</span> must be
GL_PACK_ROW_LENGTH. &nbsp;<span style="font-style: italic;">value</span>
indicates the stride (in pixels) between subsequent rows in the
destination image. &nbsp;If GL_PACK_ROW_LENGTH is zero (the default)
then the <span style="font-style: italic;">width</span> parameter to <span
 style="font-weight: bold;">glReadPixels</span> indicates the row stride.<br>
<br>
Pixel readback takes place as follows:<br>
<br>
<div style="margin-left: 40px;">if (GL_PACK_ROW_LENGTH == 0)<br>
&nbsp;&nbsp;&nbsp; rowLength = <span style="font-style: italic;">width</span>;<br>
else<br>
&nbsp;&nbsp;&nbsp; rowLength = GL_PACK_ROW_LENGTH<br>
<br>
if (<span style="font-style: italic;">format</span> == GL_RGB) {<br>
&nbsp;&nbsp;&nbsp; for (i = 0; i &lt; <span style="font-style: italic;">height</span>;
i++) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for (j = 0; j &lt; <span
 style="font-style: italic;">width</span>; j++) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; k = (i *
rowLength + j) * 3;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span
 style="font-style: italic;">data</span>[k+0] = FrameBuffer(<span
 style="font-style: italic;">x</span> + j, <span
 style="font-style: italic;">y</span> + i).red;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; <span
 style="font-style: italic;">data</span>[k+1] = FrameBuffer(<span
 style="font-style: italic;">x</span> + j, <span
 style="font-style: italic;">y</span> + i).green;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span
 style="font-style: italic;">data</span>[k+2] = FrameBuffer(<span
 style="font-style: italic;">x</span> + j, <span
 style="font-style: italic;">y</span> + i).blue;<span
 style="font-style: italic;"></span><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; }<br>
}<br>
else {<br>
&nbsp;&nbsp;&nbsp; for (i = 0; i &lt; <span style="font-style: italic;">height</span>;
i++) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for (j = 0; j &lt; <span
 style="font-style: italic;">width</span>; j++) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; k = (i *
rowLength + j) * 4;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span
 style="font-style: italic;">data</span>[k+0] = FrameBuffer(<span
 style="font-style: italic;">x</span> + j, <span
 style="font-style: italic;">y</span> + i).red;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; <span
 style="font-style: italic;">data</span>[k+1] = FrameBuffer(<span
 style="font-style: italic;">x</span> + j, <span
 style="font-style: italic;">y</span> + i).green;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span
 style="font-style: italic;">data</span>[k+2] = FrameBuffer(<span
 style="font-style: italic;">x</span> + j, <span
 style="font-style: italic;">y</span> + i).blue;<span
 style="font-style: italic;"></span><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span
 style="font-style: italic;">data</span>[k+3] = FrameBuffer(<span
 style="font-style: italic;">x</span> + j, <span
 style="font-style: italic;">y</span> + i).alpha;<span
 style="font-style: italic;"></span><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; }<br>
}<br>
</div>
<br>
The function FrameBuffer(<span style="font-style: italic;">c, r</span>)
returns the pixel in the frame buffer at column <span
 style="font-style: italic;">c</span> of row <span
 style="font-style: italic;">r. &nbsp;</span><span
 style="font-style: italic;">data</span> is considered to be either a
GLubyte pointer or a GLfloat pointer, depending on the <span
 style="font-style: italic;">type</span> parameter. &nbsp;Similarly, the
FrameBuffer function returns either GLubyte values in the range [0, 255]
or GLfloat values in the range [0,1], depending on the <span
 style="font-style: italic;">type</span> parameter.<br>
<br>
Pixels may be read from either the front or back color buffer.
&nbsp;The command<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glReadBuffer</span>(GLenum<span
 style="font-style: italic;">buffer</span>)<br>
</div>
<br>
specifies the source for reading images with <span
 style="font-weight: bold;">glReadPixels</span>. &nbsp;If <span
 style="font-style: italic;">buffer</span> is GL_FRONT then front color
buffer is the source. &nbsp;If <span style="font-style: italic;">buffer</span>
is GL_BACK then the back color buffer is the source. &nbsp;It is illegal
to specify GL_BACK when the color buffer is not double buffered.
&nbsp;Any invalid value for <span style="font-style: italic;">buffer</span>
will raise the error GL_INVALID_ENUM.<br>
<br>
The default read source is GL_BACK if the frame buffer is double
buffered. &nbsp;Otherwise, the default read source is GL_FRONT.<br>
<br>
<h2>8.2 Selection Mode</h2>
Selection mode is typically used to implement <span
 style="font-style: italic;">picking</span>: determining which
primitive(s) are present at particular window positions. &nbsp;The
command<br>
<br>
<div style="margin-left: 40px;">GLint <span style="font-weight: bold;">glRenderMode</span>(GLenum<span
 style="font-style: italic;">mode</span>)<br>
</div>
<br>
is used to enable selection mode. &nbsp;If <span
 style="font-style: italic;">mode</span> is GL_SELECTION the graphics
library is put into selection mode. &nbsp;If <span
 style="font-style: italic;">mode</span> is GL_RENDER the graphic
library is put into normal rendering mode. &nbsp;Any other value for <span
 style="font-style: italic;">mode</span> will raise the error
GL_INVALID_ENUM.<br>
<br>
When in selection mode rendering commands will not effect the
framebuffer. &nbsp;Instead, a record of the primitives that would have
been drawn is placed in the <span style="font-style: italic;">selection</span> <span
 style="font-style: italic;">buffer</span>. &nbsp;The selection buffer
is specified with the command<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glSelectionBuffer</span>(GLsizei<span
 style="font-style: italic;">n</span>, GLuint *<span
 style="font-style: italic;">buffer</span>)<br>
</div>
<span style="font-style: italic;"></span><span
 style="font-style: italic;"><br>
buffer</span> is an array of <span style="font-style: italic;">n</span>
unsigned integers. &nbsp;No more than <span style="font-style: italic;">n</span>
values will be placed in the buffer.<br>
<br>
The <span style="font-style: italic;">name stack</span> is a stack
(LIFO) of unsigned integer names. &nbsp;The following commands
manipulate the name stack:<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glInitNames</span>(void)<br>
void <span style="font-weight: bold;">glPushName</span>(GLuint <span
 style="font-style: italic;">name</span>)<br>
void <span style="font-weight: bold;">glPopName</span>(void)<br>
void <span style="font-weight: bold;">glLoadName</span>(GLuint <span
 style="font-style: italic;">name</span>)<br>
</div>
<br>
<span style="font-weight: bold;">glInitNames</span> resets the name
stack to an empty state. &nbsp;<span style="font-weight: bold;">glPushName<span
 style="font-style: italic;"> </span></span>pushes the given <span
 style="font-style: italic;">name</span> value onto the stack. &nbsp;<span
 style="font-weight: bold;">glPopName</span> pops the top name from the
stack. &nbsp;<span style="font-weight: bold;">glLoadName<span
 style="font-style: italic;"> </span></span>replaces the top value on
the stack with the specified <span style="font-style: italic;">name</span>.
&nbsp;Stack underflow and overflow conditions cause the errors
GL_STACK_OVERFLOW and GL_STACK_UNDERFLOW to be raised.<br>
<br>
While in selection mode, primitives (points, lines, polygons) are
transformed and clip-tested normally. &nbsp;Primitives which aren't
discarded by clipping cause the <span style="font-style: italic;">hit</span> <span
 style="font-style: italic;">data</span> to be updated. &nbsp;The hit
data consists of three pieces of information: a hit flag, a minimum Z
value and a maximum Z value. &nbsp;First, the hit flag is set.
&nbsp;Then, for each of the primitive's vertices, the vertex Z value is
compared to the minimum and maximum Z values. &nbsp;The minimum Z value
is updated if the vertex's Z value is less than the minimum Z value.
&nbsp;The maximum Z value is updated if the vertex's Z value is greater
than the maximum Z value.<br>
<br>
When any of <span style="font-weight: bold;">glInitNames</span><span
 style="font-style: italic;"><span style="font-style: italic;">, </span></span><span
 style="font-weight: bold;">glPushName</span>, <span
 style="font-weight: bold;">glPopName</span>, <span
 style="font-weight: bold;">glLoadName</span> or <span
 style="font-weight: bold;">glRenderMode</span> are called and the hit
flag is set, a <span style="font-style: italic;">hit record</span> is
written to the selection buffer.<br>
<br>
A hit record consists of a sequence of unsigned integers. &nbsp;The
first value is the size of the name stack. &nbsp;The second value is the
minimum Z value multiplied by 2<sup>32</sup>-1. &nbsp;The third value is
the maximum Z value multiplied by 2<sup>32</sup>-1. &nbsp;The remaining
values are the values in the name stack, in bottom to top order.
&nbsp;The hit flag is cleared after a hit record is written to the
selection buffer. &nbsp;Hit records are places sequentially into the
selection buffer until it is full or selection mode is terminated.<br>
<br>
Selection mode is terminated by calling <span
 style="font-weight: bold;">glRenderMode</span>(GL_RENDER). &nbsp; The
return value of <span style="font-weight: bold;">glRenderMode</span>
will be -1 if the selection buffer overflowed. &nbsp;Otherwise, the
return value will indicate the number of values written into the
selection buffer.<br>
<br>
<h2>8.3 Synchronization</h2>
The command<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glFlush</span>(void)<br>
</div>
<br>
makes the graphics library to flush all pending graphics commands.
&nbsp;The command<br>
<div style="margin-left: 40px;"><br>
void <span style="font-weight: bold;">glFinish</span>(void)<br>
</div>
<br>
makes the graphics library flush the command queue and wait until those
commands are completed. &nbsp;<span style="font-weight: bold;">glFlush</span>
will not return until all previous graphics commands have been fully
completed.<br>
<br>
These commands are typically used to force completion of rendering to
the front color buffer. &nbsp;Otherwise, rendering to the front color
buffer may not appear. &nbsp;The <span style="font-style: italic;">swapbuffers</span>
command (part of the window system binding library) does an implicit
flush before swapping the front and back color buffers. &nbsp;The <span
 style="font-weight: bold;">glReadPixels</span> command also does an
implicit flush before reading pixel data from the frame buffer.<br>
<br>
<h1>9. State Queries</h1>
The current value of nearly all library state variables can be queried.
&nbsp;This chapter describes the commands used for querying the value of
state variables.<br>
<br>
<h2>9.1 General State Queries</h2>
The command<br>
<br>
<div style="margin-left: 40px;">void <span style="font-weight: bold;">glGetFloatv</span>(GLenum<span
 style="font-style: italic;">pname</span>, GLfloat *<span
 style="font-style: italic;">values</span>)<br>
</div>
<br>
returns the value(s) of the state variable specified by <span
 style="font-style: italic;">pname</span>. &nbsp;The following table
lists all accepted values for <span style="font-style: italic;">pname</span>
and a description of the value(s). &nbsp;Specifying any other value for <span
 style="font-style: italic;">pname</span> causes the error
GL_INVALID_ENUM to be raised.<br>
<br>
<table cellpadding="2" cellspacing="2" border="1"
 style="text-align: left; width: 90%; margin-left: auto; margin-right: auto;">
  <tbody>
    <tr>
      <td style="vertical-align: top;">Variable (<span
 style="font-style: italic;">pname)</span><br>
      </td>
      <td style="vertical-align: top;">Number of values<br>
      </td>
      <td style="vertical-align: top;">Value(s) Description<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_ALPHA_BITS<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Number of bits per alpha value
in the frame buffer.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_ALPHA_TEST<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Zero if the alpha test is
disabled.<br>
One if the alpha test is enabled.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_ALPHA_TEST_FUNC<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">The alpha test function.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_BLEND<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Zero if blending is disabled.<br>
One if blending is enabled.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_BLEND_DST<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Blend destination function/term.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_BLEND_SRC<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Blend source function/term.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_BLUE_BITS<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Number of bits per blue value in
the frame buffer.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_COLOR_CLEAR_VALUE<br>
      </td>
      <td style="vertical-align: top;">4<br>
      </td>
      <td style="vertical-align: top;">Clear color (red, green, blue,
alpha).<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_COLOR_WRITE_MASK<br>
      </td>
      <td style="vertical-align: top;">4<br>
      </td>
      <td style="vertical-align: top;">Color buffer writemask (red,
green, blue, alpha).<br>
Zero if writing is disabled.<br>
One if writing is enabled.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_CULL_FACE<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Zero if polygon culling is
disabled.<br>
One if polygon culling is enabled.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_CULL_FACE_MODE<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Polygon cull mode: GL_FRONT,
GL_BACK or GL_FRONT_AND_BACK.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_CURRENT_COLOR<br>
      </td>
      <td style="vertical-align: top;">4<br>
      </td>
      <td style="vertical-align: top;">Current color (red, green, blue,
alpha).<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_CURRENT_RASTER_COLOR<br>
      </td>
      <td style="vertical-align: top;">4<br>
      </td>
      <td style="vertical-align: top;">Current raster position color
(red, green, blue, alpha).<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_CURRENT_RASTER_TEXTURE_COORDS<br>
      </td>
      <td style="vertical-align: top;">4<br>
      </td>
      <td style="vertical-align: top;">Current raster position texture
coordinates (s, t, r, q).<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_CURRENT_RASTER_POSITION<br>
      </td>
      <td style="vertical-align: top;">4<br>
      </td>
      <td style="vertical-align: top;">Current raster position (x, y,
z, w).<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_CURRENT_POSITION_VALID<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Zero if current raster position
is invalid.<br>
One if current raster position is valid.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_CURRENT_TEXTURE_COORDS<br>
      </td>
      <td style="vertical-align: top;">4<br>
      </td>
      <td style="vertical-align: top;">Current texture coordinates (s,
t, r, q)<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_DOUBLEBUFFER<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Zero if color buffer is
single-buffered.<br>
One if color buffer is double-buffered.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_DRAW_BUFFER<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Current color draw buffer:
GL_FRONT or GL_BACK.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_FRONT_FACE</td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Polygon front-face winding:
GL_CW or GL_CCW.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_GREEN_BITS<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Number of bits per green value
in the frame buffer.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_LINE_SMOOTH<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Zero if line smoothing is
disabled.<br>
One if line smoothing is enabled.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_LINE_STIPPLE<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Zero if line stippling is
disabled.<br>
One if line stippling is enabled.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_LINE_STIPPLE_PATTERN<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Line stipple pattern.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_LINE_STIPPLE_REPEAT<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Line stipple repeat factor.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_LINE_WIDTH<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Line width in pixels.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_LINE_WIDTH_GRANULARITY<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Aliased line width granularity.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_LINE_WIDTH_RANGE<br>
      </td>
      <td style="vertical-align: top;">2<br>
      </td>
      <td style="vertical-align: top;">Minimum and maximum aliased line
widths.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_ALIASED_LINE_WIDTH_RANGE<br>
      </td>
      <td style="vertical-align: top;">2<br>
      </td>
      <td style="vertical-align: top;">Minimum and maximum antialiased
line widths.</td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_COLOR_LOGIC_OP<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Zero if logicop is disabled.<br>
One if logicop is enabled.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_LOGIC_OP_MODE<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Logicop function.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_MATRIX_MODE<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Matrix mode: GL_MODELVIEW or
GL_PROJECTION.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_MAX_MODELVIEW_STACK_DEPTH<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Maximum size of the modelview
matrix stack.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_MAX_NAME_STACK_DEPTH<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Maximum size of the selection
name stack.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_MAX_PROJECTION_STACK_DEPTH<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Maximum size of the projection
matrix stack.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_MAX_TEXTURE_SIZE<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Maximum 2D texture image width
and height.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_MAX_VIEWPORT_DIMS<br>
      </td>
      <td style="vertical-align: top;">2</td>
      <td style="vertical-align: top;">Maximum viewport width and
height in pixels.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_MODELVIEW_MATRIX<br>
      </td>
      <td style="vertical-align: top;">16<br>
      </td>
      <td style="vertical-align: top;">Current/top modelview matrix
values.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_MODELVIEW_MATRIX_STACK_DEPTH<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Current size of the modelview
matrix stack.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_NAME_STACK_DEPTH<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Current size of the selection
name stack.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_PACK_ROW_LENGTH<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Pixel packing row length.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_POLYGON_SMOOTH<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Zero if polygon smoothing is
disabled.<br>
One if polygon smoothing is enabled.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_PROJECTION_MATRIX<br>
      </td>
      <td style="vertical-align: top;">16<br>
      </td>
      <td style="vertical-align: top;">Current/top projection matrix
values.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_PROJECTION_STACK_DEPTH<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Current size of projection
matrix stack.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_READ_BUFFER<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Current read buffer: GL_FRONT or
GL_BACK.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_RED_BITS<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Number of bits per red value in
the frame buffer.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_RENDER_MODE<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Current rendering mode:
GL_RENDER or GL_SELECTION.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_RGBA_MODE<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Always one.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_SCISSOR_BOX<br>
      </td>
      <td style="vertical-align: top;">4<br>
      </td>
      <td style="vertical-align: top;">Scissor box (x, y, width,
height).<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_SCISSOR_TEST<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Zero if scissor test is disabled.<br>
One if scissor test is enabled.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_SELECTION_BUFFER_SIZE<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Size of selection buffer.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_SHADE_MODEL<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Shade model: GL_FLAT or
GL_SMOOTH.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_STENCIL_BITS<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Number of bits per stencil value
in the frame buffer.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_STENCIL_CLEAR_VALUE<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Stencil buffer clear value.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_STENCIL_FAIL<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Stencil fail operation.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_STENCIL_FUNC<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Stencil function.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_STENCIL_REF<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Stencil reference value.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_STENCIL_TEST<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Zero if stencil test is disabled.<br>
One if stencil test is enabled.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_STENCIL_VALUE_MASK<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Stencil mask value.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_STENCIL_WRITE_MASK<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Stencil buffer write mask.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_TEXTURE_2D<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Zero if 2D texture mapping is
disabled.<br>
One if 2D texture mapping is enabled.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_TEXTURE_BINDING_2D</td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Name of currently bound 2D
texture object.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_TEXTURE_ENV_COLOR<br>
      </td>
      <td style="vertical-align: top;">4<br>
      </td>
      <td style="vertical-align: top;">Texture environment color (red,
green, blue, alpha).<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_TEXTURE_ENV_MODE<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Texture environment mode.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_UNPACK_ROW_LENGTH<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Pixel unpacking row length.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_UNPACK_LSB_FIRST<br>
      </td>
      <td style="vertical-align: top;">1<br>
      </td>
      <td style="vertical-align: top;">Zero if most significant bit is
unpacked first for bitmaps.<br>
One if least significant bit is unpacked first for bitmaps.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_VIEWPORT<br>
      </td>
      <td style="vertical-align: top;">4<br>
      </td>
      <td style="vertical-align: top;">Current viewport (x, y, width,
height).<br>
      </td>
    </tr>
  </tbody>
</table>
<br>
<br>
<h2>9.2 String Queries</h2>
The command<br>
<br>
<div style="margin-left: 40px;">const GLubyte *<span
 style="font-weight: bold;">glGetString</span>(GLenum <span
 style="font-style: italic;">name</span>)<br>
</div>
<br>
is used to query string-valued values. &nbsp;The legal values for <span
 style="font-style: italic;">name</span> are described in the following
table:<br>
<br>
<table cellpadding="2" cellspacing="2" border="1"
 style="text-align: left; width: 80%; margin-left: auto; margin-right: auto;">
  <tbody>
    <tr>
      <td style="vertical-align: top;"><span style="font-style: italic;">name</span><br>
      </td>
      <td style="vertical-align: top;">Return value<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_VERSION<br>
      </td>
      <td style="vertical-align: top;">The library version, such as
"1.2".<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_RENDERER<br>
      </td>
      <td style="vertical-align: top;">The renderer, such as "Mesa DRI
Radeon".<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_VENDOR<br>
      </td>
      <td style="vertical-align: top;">The vendor of this
implementation, such as "Tungsten Graphics, Inc."<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_EXTENSIONS<br>
      </td>
      <td style="vertical-align: top;">A white-space separated list of
the supported extensions. </td>
    </tr>
  </tbody>
</table>
<br>
<h2>9.3 Error Queries</h2>
The command<br>
<br>
<div style="margin-left: 40px;">GLenum <span style="font-weight: bold;">glGetError</span>(void)<br>
</div>
<br>
returns the current error code. &nbsp;The current error code will be
set by a GL command when an error condition has been detected. &nbsp;If
the current error code is already set, subsequent errors will not be
recorded. &nbsp;The error code is reset/cleared to GL_NO_ERROR when <span
 style="font-weight: bold;">glGetError</span> returns. &nbsp;The
following error codes are possible:<br>
<br>
<table cellpadding="2" cellspacing="2" border="1"
 style="text-align: left; width: 80%; margin-left: auto; margin-right: auto;">
  <tbody>
    <tr>
      <td style="vertical-align: top;">Error code<br>
      </td>
      <td style="vertical-align: top;">Meaning<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_NO_ERROR<br>
      </td>
      <td style="vertical-align: top;">No error has been recorded.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_INVALID_ENUM<br>
      </td>
      <td style="vertical-align: top;">An enum parameter had an invalid
value.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_INVALID_VALUE<br>
      </td>
      <td style="vertical-align: top;">A numeric parameter had an
invalid value.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_INVALID_OPERATION<br>
      </td>
      <td style="vertical-align: top;">A function was called when not
legal to do so.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_STACK_OVERFLOW<br>
      </td>
      <td style="vertical-align: top;">The current transformation
matrix stack is full.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_STACK_UNDERFLOW<br>
      </td>
      <td style="vertical-align: top;">The current transformation
matrix stack is empty.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">GL_OUT_OF_MEMORY<br>
      </td>
      <td style="vertical-align: top;">The system ran out of dynamic
memory.<br>
      </td>
    </tr>
  </tbody>
</table>
<br>
<br>
<h1>10. Unsupported Features</h1>
This section lists other features and functions which are not supported
and not previously discussed.<br>
<br>
<h2>10.1 Feedback Mode</h2>
Feedback mode and the following related functions are not supported.<br>
<br>
<div style="margin-left: 40px;"><span style="font-weight: bold;">glFeedbackBuffer</span><br>
<span style="font-weight: bold;">glPassThrough</span><br>
</div>
<br>
<h2>10.2 1D and 3D Textures<br>
</h2>
Only 2D texture images are supported. &nbsp;The following functions
used to specify 1D and 3D texture images are not supported:<br>
<br>
<div style="margin-left: 40px;"><span style="font-weight: bold;">glTexImage1D</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glTexImage3D</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glTexSubImage1D</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;"> glTexSubImage3D</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glCopyTexImage1D</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;"> glCopyTexSubImage1D</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;"> glCopyTexSubImage3D</span><br>
</div>
<br>
<h2>10.3 Alternate Texture Image Commands<br>
</h2>
Texture images may only be specified with <span
 style="font-weight: bold;">glTexImage2D</span>. &nbsp;The following
alternate texture image commands are not supported:<br>
<br>
<div style="margin-left: 40px; font-weight: bold;">glTexSubImage2D<br>
glCopyTexImage2D<br>
glCopyTexSubImage2D<br>
</div>
<br>
<h2>10.4 Proxy Textures</h2>
Proxy textures are not supported and the GL_PROXY_TEXTURE_2D token is
not supported by any function.<br>
<br>
<br>
<h2>10.5 Other Texture Commands</h2>
The following commands related to texture mapping are not supported by
the subset:<br>
<br>
<div style="margin-left: 40px; font-weight: bold;"> glPrioritizeTextures<br>
glAreTexturesResident<br>
glIsTexture<br>
glTexEnviv<br>
glTexEnvf<br>
glTexParameterf<br>
glTexParameteriv<br>
glTexParameterfv<br>
</div>
<br>
<br>
<h2>10.6 Copy and Draw Pixels<br>
</h2>
The following commands are not supported:<br>
<br>
<div style="margin-left: 40px;"><span style="font-weight: bold;">glDrawPixels<br>
glCopyPixels<br>
glPixelZoom<br>
<br>
</span></div>
<h2>10.7 Color Index Mode<br>
</h2>
Color index mode and the following related commands are not supported:<br>
<br>
<span style="font-weight: bold;"></span>
<div style="margin-left: 40px;"><span style="font-weight: bold;">glIndexub<br>
</span><span style="font-weight: bold;">glIndexi</span><br>
<span style="font-weight: bold;">glIndexs<br>
glIndexf<br>
glIndexd<br>
</span><span style="font-weight: bold;">glIndexubv<br>
</span><span style="font-weight: bold;">glIndexiv</span><br>
<span style="font-weight: bold;">glIndexsv<br>
glIndexfv<br>
glIndexdv</span><span style="font-weight: bold;"><br>
glIndexMask<br>
</span><span style="font-weight: bold;">glClearIndex<br>
glIndexPointer</span><br style="font-weight: bold;">
<br>
</div>
<h2>10.8 Pixel Transfer Operations</h2>
The pixel transfer operations (scale, bias, look-up table, etc) are not
supported and the following commands are omitted:<br>
<br style="font-weight: bold;">
<div style="margin-left: 40px;"><span style="font-weight: bold;">glPixelTransferf</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glPixelTransferi</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glPixelMapfv</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glPixelMapuiv</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glPixelMapusv</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glGetPixelMapfv</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glGetPixelMapuiv</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glGetPixelMapusv</span><br>
</div>
<br>
<h2>10.9 Hints</h2>
Hints and the following related command is not supported:<br>
<br>
<div style="margin-left: 40px;"><span style="font-weight: bold;">glHint<br>
</span><br>
</div>
<h2>10.10 State Query Commands<br>
</h2>
The following state query commands are not supported:<br>
<br>
<div style="margin-left: 40px; font-weight: bold;">glGetBooleanv<br>
glGetIntegerv<br>
glGetDoublev<br>
glGetPointerv<br>
glGetTexEnvi<br>
glGetTexEnvf<br>
glGetTexParameteriv<br>
glGetTexParameterfv<br>
glGetTexLevelParameteriv<br>
glGetTexLevelParameterfv<br>
glGetTexImage<br>
glGetClipPlane<br>
</div>
<br>
<h2>10.11 Attribute Stacks</h2>
State attribute stacks and the following related commands are not
supported:<br>
<br>
<div style="margin-left: 40px;"><span style="font-weight: bold;">glPushAttrib</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glPopAtttrib</span><br>
<br style="font-weight: bold;">
</div>
<h2>10.12 Double-Valued Functions</h2>
All functions which take double-precision floating point values, but
for which there is an equivalent single-precision valued function, are
omitted. &nbsp;This includes, but is not limited to:<br>
<br>
<div style="margin-left: 40px;"><span style="font-weight: bold;">glVertex2d</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glVertex2dv</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glVertex3d</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;"> glVertex3dv</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glVertex4d</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;"> glVertex4dv</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glColor3d</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glColor3d</span><span
 style="font-weight: bold;">v</span><br style="font-weight: bold;">
<span style="font-weight: bold;">glColor4d</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;"> glColor4dv</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glTexCoord1d</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glTexCoord1d</span><span
 style="font-weight: bold;">v</span><br style="font-weight: bold;">
<span style="font-weight: bold;">glTexCoord2d</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;"> glTexCoord2dv</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glTexCoord3d</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;"> glTexCoord3dv</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glTexCoord4d</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;"> glTexCoord4dv</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glRasterPos2d</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;"> glRasterPos2dv</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glRasterPos3d</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;"> glRasterPos3dv</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glRasterPos4d</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;"> glRasterPos4dv</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glLoadMatrixd</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glMultMatrixd</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glScaled</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glRotated</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glTranslated<br>
glRectd<br>
glRectdv<br>
</span> <span style="font-weight: bold;"><br>
</span> </div>
<h2>10.13 Evaluators</h2>
Evaluators and the following related commands are not supported:<br>
<br>
<div style="margin-left: 40px;"><span style="font-weight: bold;">glMap1f</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glMap2d</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glMap2f</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glGetMapdv</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glGetMapfv</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glGetMapiv</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glEvalCoord1d</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glEvalCoord1f</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glEvalCoord1dv</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glEvalCoord1fv</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glEvalCoord2d</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glEvalCoord2f</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glEvalCoord2dv</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glEvalCoord2fv</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glMapGrid1d</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glMapGrid1f</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glMapGrid2d</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glMapGrid2f</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glEvalPoint1</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glEvalPoint2</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glEvalMesh1</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glEvalMesh2</span><br
 style="font-weight: bold;">
</div>
<br>
<h2>10.14 Display Lists</h2>
Display lists and the following related commands are not supported:<br>
<br>
<div style="margin-left: 40px; font-weight: bold;">glIsList<br>
glDeleteLists<br>
glGenLists<br>
glNewList<br>
glEndList<br>
glCallList<br>
glCallLists<br>
glListBase<br>
</div>
<br>
<h2>10.15 Accumulation Buffer</h2>
The accumulation buffer and the following related commands are not
supported:<br>
<br style="font-weight: bold;">
<div style="margin-left: 40px;"><span style="font-weight: bold;">glAccum</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glClearAccum</span><br>
</div>
<br>
<h2>10.16 Fog</h2>
Fog and the following related commands are not supported:<br>
<br>
<div style="margin-left: 40px; font-weight: bold;"> glFogi<br>
glFogf<br>
glFogiv<br>
glFogfv<br>
</div>
<br>
<h2>10.17 Depth Test</h2>
Depth testing and the following related commands are not supported:<br>
<br>
<div style="margin-left: 40px;"><span style="font-weight: bold;">glDepthFunc</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glDepthMask</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glDepthRange</span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">glClearDepth</span><br>
</div>
<br>
<h2>10.18 Imaging Subset</h2>
The OpenGL imaging subset (which implements features such as
convolution, histogram, min/max recording, color matrix and color
tables) is not supported.<br>
<br>
<br>
<h1>Appendix A: Issues</h1>
This appendix lists documentation and subset issues with their current
status. &nbsp;For items which are still open, the documentation (above)
follows the recommended solution.<br>
<br>
<h2>A.1 Vertex Arrays</h2>
Should vertex arrays be supported? &nbsp;Is there a performance
advantage?<br>
<br>
RESOLUTION: No, there isn't enough of a performance advantage to
justify them.<br>
<br>
<h2>A.2 Polygon Antialiasing and Edge Flags</h2>
Should edge flags be supported for antialiasing?<br>
<br>
Edge flags don't effect antialiasing, at least not normally. &nbsp;A
number of approaches to antialiasing have been summarized in email.<br>
<br>
RECOMMENDATION: don't support edge flags. &nbsp;They don't effect
polygon antialiasing.<br>
<br>
RESOLUTION: closed, as of 26 Feb 2003.<br>
<br>
<h2>A.3 glRasterPos vs. glWindowPos</h2>
Should glRasterPos and/or glWindowPos commands be supported?<br>
<br>
RESOLUTION: Closed: implement glRasterPos commands, but not glWindowPos
commands.<br>
<br>
<h2>A.4 GL_IBM_rasterpos_clip extension</h2>
Should the GL_IBM_rasterpos_clip extension be implemented?<br>
<br>
RESOLUTION: &nbsp;No. &nbsp;It's not required.<br>
<br>
<h2>A.5 Image Formats and Types</h2>
Which image formats and types should be supported for <span
 style="font-weight: bold;">glTexImage2D</span> and <span
 style="font-weight: bold;">glReadPixels</span>?<br>
<br>
OpenGL specifies a <span style="font-weight: bold;">large</span>
variety of image formats and data types. &nbsp;Only a few are commonly
used.<br>
<br>
RECOMMENDATION: &nbsp;we propose a subset:<br>
<br>
For <span style="font-weight: bold;">glTexImage2D</span> only allow <span
 style="font-style: italic;">type</span>=GL_UNSIGNED_BYTE and <span
 style="font-style: italic;">format</span>=GL_RGBA, GL_RGB,
GL_INTENSITY. &nbsp; Only allow <span style="font-style: italic;">internalFormat</span>
to be GL_RGBA, GL_RGB or GL_INTENSITY as well.&nbsp; Basically, only
support image formats/types that are directly supported by the Radeon
hardware. &nbsp;This will allow <span style="font-weight: bold;">glTexImage2D</span>
to basically just use <span style="font-weight: bold;">memcpy</span> to
copy texture images.<br>
<br>
For <span style="font-weight: bold;">glReadPixels</span>, only allow <span
 style="font-style: italic;">type</span> = GL_UNSIGNED_BYTE or GL_FLOAT.
&nbsp;Only allow <span style="font-style: italic;">format</span> =
GL_RGB or GL_RGBA. &nbsp;This is just enough to support the OpenGL
conformance tests.<br>
<br>
RESOLUTION: open<br>
<br>
<h2>A.6 Texture Environment Modes</h2>
Which texture environment modes should be supported? &nbsp;OpenGL 1.2
has GL_REPLACE, GL_MODULATE, GL_DECAL and GL_BLEND. &nbsp;GL_DECAL isn't
defined for all base internal texture formats. &nbsp;GL_ADD is another
useful mode. &nbsp;Perhaps drop GL_DECAL mode and add GL_ADD mode.<br>
<br>
RECOMMENDATION: implement the standard modes GL_REPLACE, GL_MODULATE,
GL_DECAL and GL_BLEND.<br>
<br>
RESOLUTION: open<br>
<br>
<h2>A.7 Truncated Mipmaps and LOD Control</h2>
Should we support the GL_TEXTURE_BASE_LEVEL, GL_TEXTURE_MAX_LEVEL,
GL_TEXTURE_MIN_LOD and GL_TEXTURE_MAX_LOD texture parameters?<br>
<br>
RECOMMENDATION: &nbsp;We propose omitting these features at this time,
in the interest of simplifying the driver.<br>
<br>
RESOLUTION: open<br>
<br>
<h2>A.8 Texture Priorities and Residency</h2>
Should the subset support texture priorities via <span
 style="font-weight: bold;">glPrioritizeTextures</span> and the <span
 style="font-weight: bold;">glAreTexturesResident</span> command?<br>
<br>
RECOMMENDATION: &nbsp;Few applications use these features and
functions. &nbsp;We propose omitting them to simplify the driver.<br>
<br>
RESOLUTION: open<br>
<br>
<h2>A.9 Pixel Pack/Unpack Alignment Control</h2>
Should we support the GL_PACK_ALIGNMENT and GL_UNPACK_ALIGNMENT options?<br>
<br>
These are used to align pixel data addresses to 1, 2 and 4-byte
multiples for <span style="font-weight: bold;">glBitmap, glTexImage2D</span>
and <span style="font-weight: bold;">glReadPixels</span>. &nbsp;These
aren't strictly needed since the user can provide a 1, 2 or 4-byte
aligned address and appropriate GL_PACK_ROW_LENGTH or
GL_UNPACK_ROW_LENGTH values instead.<br>
<br>
RECOMMENDATION: &nbsp;We recommend omitting them to simplify the driver.<br>
<br>
RESOLUTION: open<br>
<br>
<h2>A.10 Pixel Pack/Unpack Skip Rows/Pixels Control</h2>
Should we support the GL_UNPACK_SKIP_PIXELS, GL_UNPACK_SKIP_ROWS,
GL_PACK_SKIP_PIXELS and GL_PACK_SKIP_ROWS options for pixel
unpacking/packing?<br>
<br>
These options aren't really needed since the user can adjust the start
address and GL_PACK/UNPACK_ROW_LENGTH parameters to achieve the same
effect.<br>
<br>
RECOMMENDATION: &nbsp;omit these parameters.<br>
<br>
RESOLUTION: open<br>
<br>
<h2>A.11 Texture State Queries</h2>
Should we support the command <span style="font-weight: bold;">glGetTexEnvi/fv,
glGetTexParameteri/fv</span> and <span style="font-weight: bold;">glGetTexLevelParameteri/fv</span>?<br>
<br>
RECOMMENDATION: &nbsp;No.&nbsp;They're seldom needed and their
implementation is several hundred lines of code in length.<br>
<br>
RESOLUTION: &nbsp;open<br>
<br>
<h2>A.12 glGetIntegerv, glGetBooleanv and glGetDoublev</h2>
Should we support the commands <span style="font-weight: bold;">glGetIntegerv,
glGetBooleanv </span>and <span style="font-weight: bold;">glGetDoublev</span>
in addition to <span style="font-weight: bold;">glGetFloatv</span>?<br>
<br>
RECOMMENDATION: &nbsp;Omit the boolean, integer and double-valued
functions. All state values which can be queried by these commands can
be expressed as floating point values and queried with <span
 style="font-weight: bold;">glGetFloatv</span>. &nbsp;The
implementation of the other three commands involves many lines of code.<br>
<br>
RESOLUTION: &nbsp;open<br>
<br>
<h2>A.13 glBitmap and Per-Fragment Operations</h2>
Should bitmaps rendered with <span style="font-weight: bold;">glBitmap</span>
be subjected to the per-fragment operations?<br>
<br>
If bitmaps are implemented with points it will be easy to implement the
per-fragment operations. &nbsp;Otherwise, it could be difficult.<br>
<br>
RECOMMENDATION: &nbsp;Implement glBitmap by drawing points/pixels with
the hardware. &nbsp;This will make supporting the per-fragments
trivially easy. &nbsp;Also, it makes portrait-mode display relatively
easy.<br>
<br>
RESOLUTION: &nbsp;open<br>
<br>
<h2>A.14 Reduced gl.h Header File</h2>
Should we produce a reduced gl.h header file which only defines the
tokens and functions which are implemented by the subset?<br>
<br>
RECOMMENDATION: yes. &nbsp;It would be a useful reference to
programmers to quickly determine which functions and tokens are
supported.<br>
<br>
RESOLUTION: open<br>
<br>
<h2>A.15 glPolygonMode</h2>
Is <span style="font-weight: bold;">glPolygonMode</span> needed?<br>
<br>
RECOMMENDATION: No. &nbsp;Omit it.<br>
<br>
RESOLUTION: closed, as of 26 Feb 2003<br>
<br>
<br>
<p> </p>
</body>
</html>