aboutsummaryrefslogtreecommitdiff
path: root/code/pnd/qgl.h
blob: f4c3371eedc7f64e12cb459d622e10b352712dfd (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
/**** This file is autogenerated.  Run GenerateQGL.pl to update it ****/

#ifdef QGL_LOG_GL_CALLS
extern unsigned int QGLLogGLCalls;
extern FILE *QGLDebugFile(void);
#endif

extern void QGLCheckError(const char *message);
extern unsigned int QGLBeginStarted;

// This has to be done to avoid infinite recursion between our glGetError wrapper and QGLCheckError()
static inline GLenum _glGetError(void) {
    return glGetError();
}

// void glAlphaFunc (GLenum func, GLclampf ref);
static inline void qglAlphaFunc(GLenum func, GLclampf ref)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glAlphaFunc(func=%lu, ref=%f)\n", func, ref);
#endif
    glAlphaFunc(func, ref);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glAlphaFunc");
#endif
}

// void glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
static inline void qglClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glClearColor(red=%f, green=%f, blue=%f, alpha=%f)\n", red, green, blue, alpha);
#endif
    glClearColor(red, green, blue, alpha);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glClearColor");
#endif
}

// void glClearDepthf (GLclampf depth);
static inline void qglClearDepthf(GLclampf depth)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glClearDepthf(depth=%f)\n", depth);
#endif
    glClearDepthf(depth);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glClearDepthf");
#endif
}

// void glClipPlanef (GLenum plane, const GLfloat *equation);
static inline void qglClipPlanef(GLenum plane, const GLfloat *equation)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glClipPlanef(plane=%lu, equation=%p)\n", plane, equation);
#endif
    glClipPlanef(plane, equation);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glClipPlanef");
#endif
}

// void glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
// void glDepthRangef (GLclampf zNear, GLclampf zFar);
static inline void qglDepthRangef(GLclampf zNear, GLclampf zFar)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glDepthRangef(zNear=%f, zFar=%f)\n", zNear, zFar);
#endif
    glDepthRangef(zNear, zFar);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glDepthRangef");
#endif
}

// void glFogf (GLenum pname, GLfloat param);
static inline void qglFogf(GLenum pname, GLfloat param)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glFogf(pname=%lu, param=%f)\n", pname, param);
#endif
    glFogf(pname, param);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glFogf");
#endif
}

// void glFogfv (GLenum pname, const GLfloat *params);
static inline void qglFogfv(GLenum pname, const GLfloat *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glFogfv(pname=%lu, params=%p)\n", pname, params);
#endif
    glFogfv(pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glFogfv");
#endif
}

// void glFrustumf (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
static inline void qglFrustumf(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glFrustumf(left=%f, right=%f, bottom=%f, top=%f, zNear=%f, zFar=%f)\n", left, right, bottom, top, zNear, zFar);
#endif
    glFrustumf(left, right, bottom, top, zNear, zFar);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glFrustumf");
#endif
}

// void glGetClipPlanef (GLenum pname, GLfloat eqn[4]);
static inline void qglGetClipPlanef(GLenum pname, GLfloat eqn[4])
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glGetClipPlanef(pname=%lu, eqn=%f)\n", pname, eqn);
#endif
    glGetClipPlanef(pname, eqn);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glGetClipPlanef");
#endif
}

// void glGetFloatv (GLenum pname, GLfloat *params);
static inline void qglGetFloatv(GLenum pname, GLfloat *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glGetFloatv(pname=%lu, params=%p)\n", pname, params);
#endif
    glGetFloatv(pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glGetFloatv");
#endif
}

// void glGetLightfv (GLenum light, GLenum pname, GLfloat *params);
static inline void qglGetLightfv(GLenum light, GLenum pname, GLfloat *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glGetLightfv(light=%lu, pname=%lu, params=%p)\n", light, pname, params);
#endif
    glGetLightfv(light, pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glGetLightfv");
#endif
}

// void glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params);
static inline void qglGetMaterialfv(GLenum face, GLenum pname, GLfloat *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glGetMaterialfv(face=%lu, pname=%lu, params=%p)\n", face, pname, params);
#endif
    glGetMaterialfv(face, pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glGetMaterialfv");
#endif
}

// void glGetTexEnvfv (GLenum env, GLenum pname, GLfloat *params);
static inline void qglGetTexEnvfv(GLenum env, GLenum pname, GLfloat *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glGetTexEnvfv(env=%lu, pname=%lu, params=%p)\n", env, pname, params);
#endif
    glGetTexEnvfv(env, pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glGetTexEnvfv");
#endif
}

// void glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
static inline void qglGetTexParameterfv(GLenum target, GLenum pname, GLfloat *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glGetTexParameterfv(target=%lu, pname=%lu, params=%p)\n", target, pname, params);
#endif
    glGetTexParameterfv(target, pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glGetTexParameterfv");
#endif
}

// void glLightModelf (GLenum pname, GLfloat param);
static inline void qglLightModelf(GLenum pname, GLfloat param)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glLightModelf(pname=%lu, param=%f)\n", pname, param);
#endif
    glLightModelf(pname, param);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glLightModelf");
#endif
}

// void glLightModelfv (GLenum pname, const GLfloat *params);
static inline void qglLightModelfv(GLenum pname, const GLfloat *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glLightModelfv(pname=%lu, params=%p)\n", pname, params);
#endif
    glLightModelfv(pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glLightModelfv");
#endif
}

// void glLightf (GLenum light, GLenum pname, GLfloat param);
static inline void qglLightf(GLenum light, GLenum pname, GLfloat param)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glLightf(light=%lu, pname=%lu, param=%f)\n", light, pname, param);
#endif
    glLightf(light, pname, param);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glLightf");
#endif
}

// void glLightfv (GLenum light, GLenum pname, const GLfloat *params);
static inline void qglLightfv(GLenum light, GLenum pname, const GLfloat *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glLightfv(light=%lu, pname=%lu, params=%p)\n", light, pname, params);
#endif
    glLightfv(light, pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glLightfv");
#endif
}

// void glLineWidth (GLfloat width);
static inline void qglLineWidth(GLfloat width)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glLineWidth(width=%f)\n", width);
#endif
    glLineWidth(width);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glLineWidth");
#endif
}

// void glLoadMatrixf (const GLfloat *m);
static inline void qglLoadMatrixf(const GLfloat *m)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glLoadMatrixf(m=%p)\n", m);
#endif
    glLoadMatrixf(m);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glLoadMatrixf");
#endif
}

// void glMaterialf (GLenum face, GLenum pname, GLfloat param);
static inline void qglMaterialf(GLenum face, GLenum pname, GLfloat param)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glMaterialf(face=%lu, pname=%lu, param=%f)\n", face, pname, param);
#endif
    glMaterialf(face, pname, param);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glMaterialf");
#endif
}

// void glMaterialfv (GLenum face, GLenum pname, const GLfloat *params);
static inline void qglMaterialfv(GLenum face, GLenum pname, const GLfloat *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glMaterialfv(face=%lu, pname=%lu, params=%p)\n", face, pname, params);
#endif
    glMaterialfv(face, pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glMaterialfv");
#endif
}

// void glMultMatrixf (const GLfloat *m);
static inline void qglMultMatrixf(const GLfloat *m)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glMultMatrixf(m=%p)\n", m);
#endif
    glMultMatrixf(m);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glMultMatrixf");
#endif
}

// void glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
static inline void qglMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glMultiTexCoord4f(target=%lu, s=%f, t=%f, r=%f, q=%f)\n", target, s, t, r, q);
#endif
    glMultiTexCoord4f(target, s, t, r, q);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glMultiTexCoord4f");
#endif
}

// void glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz);
static inline void qglNormal3f(GLfloat nx, GLfloat ny, GLfloat nz)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glNormal3f(nx=%f, ny=%f, nz=%f)\n", nx, ny, nz);
#endif
    glNormal3f(nx, ny, nz);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glNormal3f");
#endif
}

// void glOrthof (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
static inline void qglOrthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glOrthof(left=%f, right=%f, bottom=%f, top=%f, zNear=%f, zFar=%f)\n", left, right, bottom, top, zNear, zFar);
#endif
    glOrthof(left, right, bottom, top, zNear, zFar);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glOrthof");
#endif
}

// void glPointParameterf (GLenum pname, GLfloat param);
static inline void qglPointParameterf(GLenum pname, GLfloat param)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glPointParameterf(pname=%lu, param=%f)\n", pname, param);
#endif
    glPointParameterf(pname, param);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glPointParameterf");
#endif
}

// void glPointParameterfv (GLenum pname, const GLfloat *params);
static inline void qglPointParameterfv(GLenum pname, const GLfloat *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glPointParameterfv(pname=%lu, params=%p)\n", pname, params);
#endif
    glPointParameterfv(pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glPointParameterfv");
#endif
}

// void glPointSize (GLfloat size);
static inline void qglPointSize(GLfloat size)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glPointSize(size=%f)\n", size);
#endif
    glPointSize(size);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glPointSize");
#endif
}

// void glPolygonOffset (GLfloat factor, GLfloat units);
static inline void qglPolygonOffset(GLfloat factor, GLfloat units)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glPolygonOffset(factor=%f, units=%f)\n", factor, units);
#endif
    glPolygonOffset(factor, units);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glPolygonOffset");
#endif
}

// void glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
static inline void qglRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glRotatef(angle=%f, x=%f, y=%f, z=%f)\n", angle, x, y, z);
#endif
    glRotatef(angle, x, y, z);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glRotatef");
#endif
}

// void glScalef (GLfloat x, GLfloat y, GLfloat z);
static inline void qglScalef(GLfloat x, GLfloat y, GLfloat z)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glScalef(x=%f, y=%f, z=%f)\n", x, y, z);
#endif
    glScalef(x, y, z);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glScalef");
#endif
}

// void glTexEnvf (GLenum target, GLenum pname, GLfloat param);
static inline void qglTexEnvf(GLenum target, GLenum pname, GLfloat param)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glTexEnvf(target=%lu, pname=%lu, param=%f)\n", target, pname, param);
#endif
    glTexEnvf(target, pname, param);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glTexEnvf");
#endif
}

// void glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params);
static inline void qglTexEnvfv(GLenum target, GLenum pname, const GLfloat *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glTexEnvfv(target=%lu, pname=%lu, params=%p)\n", target, pname, params);
#endif
    glTexEnvfv(target, pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glTexEnvfv");
#endif
}

// void glTexParameterf (GLenum target, GLenum pname, GLfloat param);
static inline void qglTexParameterf(GLenum target, GLenum pname, GLfloat param)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glTexParameterf(target=%lu, pname=%lu, param=%f)\n", target, pname, param);
#endif
    glTexParameterf(target, pname, param);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glTexParameterf");
#endif
}

// void glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
static inline void qglTexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glTexParameterfv(target=%lu, pname=%lu, params=%p)\n", target, pname, params);
#endif
    glTexParameterfv(target, pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glTexParameterfv");
#endif
}

// void glTranslatef (GLfloat x, GLfloat y, GLfloat z);
static inline void qglTranslatef(GLfloat x, GLfloat y, GLfloat z)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glTranslatef(x=%f, y=%f, z=%f)\n", x, y, z);
#endif
    glTranslatef(x, y, z);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glTranslatef");
#endif
}

// void glActiveTexture (GLenum texture);
static inline void qglActiveTexture(GLenum texture)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glActiveTexture(texture=%lu)\n", texture);
#endif
    glActiveTexture(texture);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glActiveTexture");
#endif
}

// void glAlphaFuncx (GLenum func, GLclampx ref);
static inline void qglAlphaFuncx(GLenum func, GLclampx ref)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glAlphaFuncx(func=%lu, ref=%ld)\n", func, ref);
#endif
    glAlphaFuncx(func, ref);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glAlphaFuncx");
#endif
}

// void glBindBuffer (GLenum target, GLuint buffer);
static inline void qglBindBuffer(GLenum target, GLuint buffer)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glBindBuffer(target=%lu, buffer=%lu)\n", target, buffer);
#endif
    glBindBuffer(target, buffer);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glBindBuffer");
#endif
}

// void glBindTexture (GLenum target, GLuint texture);
static inline void qglBindTexture(GLenum target, GLuint texture)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glBindTexture(target=%lu, texture=%lu)\n", target, texture);
#endif
    glBindTexture(target, texture);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glBindTexture");
#endif
}

// void glBlendFunc (GLenum sfactor, GLenum dfactor);
static inline void qglBlendFunc(GLenum sfactor, GLenum dfactor)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glBlendFunc(sfactor=%lu, dfactor=%lu)\n", sfactor, dfactor);
#endif
    glBlendFunc(sfactor, dfactor);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glBlendFunc");
#endif
}

// void glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
static inline void qglBufferData(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glBufferData(target=%lu, size=%ld, data=%p, usage=%lu)\n", target, size, data, usage);
#endif
    glBufferData(target, size, data, usage);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glBufferData");
#endif
}

// void glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
static inline void qglBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glBufferSubData(target=%lu, offset=%ld, size=%ld, data=%p)\n", target, offset, size, data);
#endif
    glBufferSubData(target, offset, size, data);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glBufferSubData");
#endif
}

// void glClear (GLbitfield mask);
static inline void qglClear(GLbitfield mask)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glClear(mask=%lu)\n", mask);
#endif
    glClear(mask);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glClear");
#endif
}

// void glClearColorx (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
static inline void qglClearColorx(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glClearColorx(red=%ld, green=%ld, blue=%ld, alpha=%ld)\n", red, green, blue, alpha);
#endif
    glClearColorx(red, green, blue, alpha);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glClearColorx");
#endif
}

// void glClearDepthx (GLclampx depth);
static inline void qglClearDepthx(GLclampx depth)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glClearDepthx(depth=%ld)\n", depth);
#endif
    glClearDepthx(depth);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glClearDepthx");
#endif
}

// void glClearStencil (GLint s);
static inline void qglClearStencil(GLint s)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glClearStencil(s=%ld)\n", s);
#endif
    glClearStencil(s);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glClearStencil");
#endif
}

// void glClientActiveTexture (GLenum texture);
static inline void qglClientActiveTexture(GLenum texture)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glClientActiveTexture(texture=%lu)\n", texture);
#endif
    glClientActiveTexture(texture);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glClientActiveTexture");
#endif
}

// void glClipPlanex (GLenum plane, const GLfixed *equation);
static inline void qglClipPlanex(GLenum plane, const GLfixed *equation)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glClipPlanex(plane=%lu, equation=%p)\n", plane, equation);
#endif
    glClipPlanex(plane, equation);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glClipPlanex");
#endif
}

// void glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
static inline void qglColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glColor4ub(red=%u, green=%u, blue=%u, alpha=%u)\n", red, green, blue, alpha);
#endif
    glColor4ub(red, green, blue, alpha);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glColor4ub");
#endif
}

// void glColor4x (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
static inline void qglColor4x(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glColor4x(red=%ld, green=%ld, blue=%ld, alpha=%ld)\n", red, green, blue, alpha);
#endif
    glColor4x(red, green, blue, alpha);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glColor4x");
#endif
}

// void glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
static inline void qglColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glColorMask(red=%u, green=%u, blue=%u, alpha=%u)\n", red, green, blue, alpha);
#endif
    glColorMask(red, green, blue, alpha);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glColorMask");
#endif
}

// void glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
static inline void qglColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glColorPointer(size=%ld, type=%lu, stride=%ld, pointer=%p)\n", size, type, stride, pointer);
#endif
    glColorPointer(size, type, stride, pointer);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glColorPointer");
#endif
}

// void glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
static inline void qglCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glCompressedTexImage2D(target=%lu, level=%ld, internalformat=%lu, width=%ld, height=%ld, border=%ld, imageSize=%ld, data=%p)\n", target, level, internalformat, width, height, border, imageSize, data);
#endif
    glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glCompressedTexImage2D");
#endif
}

// void glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
static inline void qglCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glCompressedTexSubImage2D(target=%lu, level=%ld, xoffset=%ld, yoffset=%ld, width=%ld, height=%ld, format=%lu, imageSize=%ld, data=%p)\n", target, level, xoffset, yoffset, width, height, format, imageSize, data);
#endif
    glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glCompressedTexSubImage2D");
#endif
}

// void glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
static inline void qglCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glCopyTexImage2D(target=%lu, level=%ld, internalformat=%lu, x=%ld, y=%ld, width=%ld, height=%ld, border=%ld)\n", target, level, internalformat, x, y, width, height, border);
#endif
    glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glCopyTexImage2D");
#endif
}

// void glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
static inline void qglCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glCopyTexSubImage2D(target=%lu, level=%ld, xoffset=%ld, yoffset=%ld, x=%ld, y=%ld, width=%ld, height=%ld)\n", target, level, xoffset, yoffset, x, y, width, height);
#endif
    glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glCopyTexSubImage2D");
#endif
}

// void glCullFace (GLenum mode);
static inline void qglCullFace(GLenum mode)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glCullFace(mode=%lu)\n", mode);
#endif
    glCullFace(mode);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glCullFace");
#endif
}

// void glDeleteBuffers (GLsizei n, const GLuint *buffers);
static inline void qglDeleteBuffers(GLsizei n, const GLuint *buffers)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glDeleteBuffers(n=%ld, buffers=%p)\n", n, buffers);
#endif
    glDeleteBuffers(n, buffers);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glDeleteBuffers");
#endif
}

// void glDeleteTextures (GLsizei n, const GLuint *textures);
static inline void qglDeleteTextures(GLsizei n, const GLuint *textures)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glDeleteTextures(n=%ld, textures=%p)\n", n, textures);
#endif
    glDeleteTextures(n, textures);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glDeleteTextures");
#endif
}

// void glDepthFunc (GLenum func);
static inline void qglDepthFunc(GLenum func)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glDepthFunc(func=%lu)\n", func);
#endif
    glDepthFunc(func);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glDepthFunc");
#endif
}

// void glDepthMask (GLboolean flag);
static inline void qglDepthMask(GLboolean flag)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glDepthMask(flag=%u)\n", flag);
#endif
    glDepthMask(flag);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glDepthMask");
#endif
}

// void glDepthRangex (GLclampx zNear, GLclampx zFar);
static inline void qglDepthRangex(GLclampx zNear, GLclampx zFar)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glDepthRangex(zNear=%ld, zFar=%ld)\n", zNear, zFar);
#endif
    glDepthRangex(zNear, zFar);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glDepthRangex");
#endif
}

// void glDisable (GLenum cap);
static inline void qglDisable(GLenum cap)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glDisable(cap=%lu)\n", cap);
#endif
    glDisable(cap);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glDisable");
#endif
}

// void glDisableClientState (GLenum array);
static inline void qglDisableClientState(GLenum array)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glDisableClientState(array=%lu)\n", array);
#endif
    glDisableClientState(array);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glDisableClientState");
#endif
}

// void glDrawArrays (GLenum mode, GLint first, GLsizei count);
static inline void qglDrawArrays(GLenum mode, GLint first, GLsizei count)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glDrawArrays(mode=%lu, first=%ld, count=%ld)\n", mode, first, count);
#endif
    glDrawArrays(mode, first, count);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glDrawArrays");
#endif
}

// void glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
static inline void qglDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glDrawElements(mode=%lu, count=%ld, type=%lu, indices=%p)\n", mode, count, type, indices);
#endif
    glDrawElements(mode, count, type, indices);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glDrawElements");
#endif
}

// void glEnable (GLenum cap);
static inline void qglEnable(GLenum cap)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glEnable(cap=%lu)\n", cap);
#endif
    glEnable(cap);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glEnable");
#endif
}

// void glEnableClientState (GLenum array);
static inline void qglEnableClientState(GLenum array)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glEnableClientState(array=%lu)\n", array);
#endif
    glEnableClientState(array);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glEnableClientState");
#endif
}

// void glFinish (void);
static inline void qglFinish(void)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glFinish(void)\n");
#endif
    glFinish();
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glFinish");
#endif
}

// void glFlush (void);
static inline void qglFlush(void)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glFlush(void)\n");
#endif
    glFlush();
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glFlush");
#endif
}

// void glFogx (GLenum pname, GLfixed param);
static inline void qglFogx(GLenum pname, GLfixed param)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glFogx(pname=%lu, param=%ld)\n", pname, param);
#endif
    glFogx(pname, param);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glFogx");
#endif
}

// void glFogxv (GLenum pname, const GLfixed *params);
static inline void qglFogxv(GLenum pname, const GLfixed *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glFogxv(pname=%lu, params=%p)\n", pname, params);
#endif
    glFogxv(pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glFogxv");
#endif
}

// void glFrontFace (GLenum mode);
static inline void qglFrontFace(GLenum mode)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glFrontFace(mode=%lu)\n", mode);
#endif
    glFrontFace(mode);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glFrontFace");
#endif
}

// void glFrustumx (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
static inline void qglFrustumx(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glFrustumx(left=%ld, right=%ld, bottom=%ld, top=%ld, zNear=%ld, zFar=%ld)\n", left, right, bottom, top, zNear, zFar);
#endif
    glFrustumx(left, right, bottom, top, zNear, zFar);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glFrustumx");
#endif
}

// void glGetBooleanv (GLenum pname, GLboolean *params);
static inline void qglGetBooleanv(GLenum pname, GLboolean *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glGetBooleanv(pname=%lu, params=%p)\n", pname, params);
#endif
    glGetBooleanv(pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glGetBooleanv");
#endif
}

// void glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
static inline void qglGetBufferParameteriv(GLenum target, GLenum pname, GLint *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glGetBufferParameteriv(target=%lu, pname=%lu, params=%p)\n", target, pname, params);
#endif
    glGetBufferParameteriv(target, pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glGetBufferParameteriv");
#endif
}

// void glGetClipPlanex (GLenum pname, GLfixed eqn[4]);
static inline void qglGetClipPlanex(GLenum pname, GLfixed eqn[4])
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glGetClipPlanex(pname=%lu, eqn=%ld)\n", pname, eqn);
#endif
    glGetClipPlanex(pname, eqn);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glGetClipPlanex");
#endif
}

// void glGenBuffers (GLsizei n, GLuint *buffers);
static inline void qglGenBuffers(GLsizei n, GLuint *buffers)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glGenBuffers(n=%ld, buffers=%p)\n", n, buffers);
#endif
    glGenBuffers(n, buffers);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glGenBuffers");
#endif
}

// void glGenTextures (GLsizei n, GLuint *textures);
static inline void qglGenTextures(GLsizei n, GLuint *textures)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glGenTextures(n=%ld, textures=%p)\n", n, textures);
#endif
    glGenTextures(n, textures);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glGenTextures");
#endif
}

// GLenum glGetError (void);
static inline GLenum qglGetError(void)
{
    GLenum returnValue;
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glGetError(void)\n");
#endif
    returnValue = glGetError();
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glGetError");
#endif
    return returnValue;
}

// void glGetFixedv (GLenum pname, GLfixed *params);
static inline void qglGetFixedv(GLenum pname, GLfixed *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glGetFixedv(pname=%lu, params=%p)\n", pname, params);
#endif
    glGetFixedv(pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glGetFixedv");
#endif
}

// void glGetIntegerv (GLenum pname, GLint *params);
static inline void qglGetIntegerv(GLenum pname, GLint *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glGetIntegerv(pname=%lu, params=%p)\n", pname, params);
#endif
    glGetIntegerv(pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glGetIntegerv");
#endif
}

// void glGetLightxv (GLenum light, GLenum pname, GLfixed *params);
static inline void qglGetLightxv(GLenum light, GLenum pname, GLfixed *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glGetLightxv(light=%lu, pname=%lu, params=%p)\n", light, pname, params);
#endif
    glGetLightxv(light, pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glGetLightxv");
#endif
}

// void glGetMaterialxv (GLenum face, GLenum pname, GLfixed *params);
static inline void qglGetMaterialxv(GLenum face, GLenum pname, GLfixed *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glGetMaterialxv(face=%lu, pname=%lu, params=%p)\n", face, pname, params);
#endif
    glGetMaterialxv(face, pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glGetMaterialxv");
#endif
}

// void glGetPointerv (GLenum pname, void **params);
static inline void qglGetPointerv(GLenum pname, void **params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glGetPointerv(pname=%lu, params=%p)\n", pname, params);
#endif
    glGetPointerv(pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glGetPointerv");
#endif
}

// const GLubyte * glGetString (GLenum name);
static inline const GLubyte * qglGetString(GLenum name)
{
    const GLubyte * returnValue;
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glGetString(name=%lu)\n", name);
#endif
    returnValue = glGetString(name);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glGetString");
#endif
    return returnValue;
}

// void glGetTexEnviv (GLenum env, GLenum pname, GLint *params);
static inline void qglGetTexEnviv(GLenum env, GLenum pname, GLint *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glGetTexEnviv(env=%lu, pname=%lu, params=%p)\n", env, pname, params);
#endif
    glGetTexEnviv(env, pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glGetTexEnviv");
#endif
}

// void glGetTexEnvxv (GLenum env, GLenum pname, GLfixed *params);
static inline void qglGetTexEnvxv(GLenum env, GLenum pname, GLfixed *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glGetTexEnvxv(env=%lu, pname=%lu, params=%p)\n", env, pname, params);
#endif
    glGetTexEnvxv(env, pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glGetTexEnvxv");
#endif
}

// void glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
static inline void qglGetTexParameteriv(GLenum target, GLenum pname, GLint *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glGetTexParameteriv(target=%lu, pname=%lu, params=%p)\n", target, pname, params);
#endif
    glGetTexParameteriv(target, pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glGetTexParameteriv");
#endif
}

// void glGetTexParameterxv (GLenum target, GLenum pname, GLfixed *params);
static inline void qglGetTexParameterxv(GLenum target, GLenum pname, GLfixed *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glGetTexParameterxv(target=%lu, pname=%lu, params=%p)\n", target, pname, params);
#endif
    glGetTexParameterxv(target, pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glGetTexParameterxv");
#endif
}

// void glHint (GLenum target, GLenum mode);
static inline void qglHint(GLenum target, GLenum mode)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glHint(target=%lu, mode=%lu)\n", target, mode);
#endif
    glHint(target, mode);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glHint");
#endif
}

// GLboolean glIsBuffer (GLuint buffer);
static inline GLboolean qglIsBuffer(GLuint buffer)
{
    GLboolean returnValue;
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glIsBuffer(buffer=%lu)\n", buffer);
#endif
    returnValue = glIsBuffer(buffer);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glIsBuffer");
#endif
    return returnValue;
}

// GLboolean glIsEnabled (GLenum cap);
static inline GLboolean qglIsEnabled(GLenum cap)
{
    GLboolean returnValue;
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glIsEnabled(cap=%lu)\n", cap);
#endif
    returnValue = glIsEnabled(cap);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glIsEnabled");
#endif
    return returnValue;
}

// GLboolean glIsTexture (GLuint texture);
static inline GLboolean qglIsTexture(GLuint texture)
{
    GLboolean returnValue;
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glIsTexture(texture=%lu)\n", texture);
#endif
    returnValue = glIsTexture(texture);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glIsTexture");
#endif
    return returnValue;
}

// void glLightModelx (GLenum pname, GLfixed param);
static inline void qglLightModelx(GLenum pname, GLfixed param)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glLightModelx(pname=%lu, param=%ld)\n", pname, param);
#endif
    glLightModelx(pname, param);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glLightModelx");
#endif
}

// void glLightModelxv (GLenum pname, const GLfixed *params);
static inline void qglLightModelxv(GLenum pname, const GLfixed *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glLightModelxv(pname=%lu, params=%p)\n", pname, params);
#endif
    glLightModelxv(pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glLightModelxv");
#endif
}

// void glLightx (GLenum light, GLenum pname, GLfixed param);
static inline void qglLightx(GLenum light, GLenum pname, GLfixed param)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glLightx(light=%lu, pname=%lu, param=%ld)\n", light, pname, param);
#endif
    glLightx(light, pname, param);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glLightx");
#endif
}

// void glLightxv (GLenum light, GLenum pname, const GLfixed *params);
static inline void qglLightxv(GLenum light, GLenum pname, const GLfixed *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glLightxv(light=%lu, pname=%lu, params=%p)\n", light, pname, params);
#endif
    glLightxv(light, pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glLightxv");
#endif
}

// void glLineWidthx (GLfixed width);
static inline void qglLineWidthx(GLfixed width)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glLineWidthx(width=%ld)\n", width);
#endif
    glLineWidthx(width);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glLineWidthx");
#endif
}

// void glLoadIdentity (void);
static inline void qglLoadIdentity(void)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glLoadIdentity(void)\n");
#endif
    glLoadIdentity();
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glLoadIdentity");
#endif
}

// void glLoadMatrixx (const GLfixed *m);
static inline void qglLoadMatrixx(const GLfixed *m)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glLoadMatrixx(m=%p)\n", m);
#endif
    glLoadMatrixx(m);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glLoadMatrixx");
#endif
}

// void glLogicOp (GLenum opcode);
static inline void qglLogicOp(GLenum opcode)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glLogicOp(opcode=%lu)\n", opcode);
#endif
    glLogicOp(opcode);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glLogicOp");
#endif
}

// void glMaterialx (GLenum face, GLenum pname, GLfixed param);
static inline void qglMaterialx(GLenum face, GLenum pname, GLfixed param)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glMaterialx(face=%lu, pname=%lu, param=%ld)\n", face, pname, param);
#endif
    glMaterialx(face, pname, param);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glMaterialx");
#endif
}

// void glMaterialxv (GLenum face, GLenum pname, const GLfixed *params);
static inline void qglMaterialxv(GLenum face, GLenum pname, const GLfixed *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glMaterialxv(face=%lu, pname=%lu, params=%p)\n", face, pname, params);
#endif
    glMaterialxv(face, pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glMaterialxv");
#endif
}

// void glMatrixMode (GLenum mode);
static inline void qglMatrixMode(GLenum mode)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glMatrixMode(mode=%lu)\n", mode);
#endif
    glMatrixMode(mode);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glMatrixMode");
#endif
}

// void glMultMatrixx (const GLfixed *m);
static inline void qglMultMatrixx(const GLfixed *m)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glMultMatrixx(m=%p)\n", m);
#endif
    glMultMatrixx(m);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glMultMatrixx");
#endif
}

// void glMultiTexCoord4x (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
static inline void qglMultiTexCoord4x(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glMultiTexCoord4x(target=%lu, s=%ld, t=%ld, r=%ld, q=%ld)\n", target, s, t, r, q);
#endif
    glMultiTexCoord4x(target, s, t, r, q);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glMultiTexCoord4x");
#endif
}

// void glNormal3x (GLfixed nx, GLfixed ny, GLfixed nz);
static inline void qglNormal3x(GLfixed nx, GLfixed ny, GLfixed nz)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glNormal3x(nx=%ld, ny=%ld, nz=%ld)\n", nx, ny, nz);
#endif
    glNormal3x(nx, ny, nz);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glNormal3x");
#endif
}

// void glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
static inline void qglNormalPointer(GLenum type, GLsizei stride, const GLvoid *pointer)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glNormalPointer(type=%lu, stride=%ld, pointer=%p)\n", type, stride, pointer);
#endif
    glNormalPointer(type, stride, pointer);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glNormalPointer");
#endif
}

// void glOrthox (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
static inline void qglOrthox(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glOrthox(left=%ld, right=%ld, bottom=%ld, top=%ld, zNear=%ld, zFar=%ld)\n", left, right, bottom, top, zNear, zFar);
#endif
    glOrthox(left, right, bottom, top, zNear, zFar);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glOrthox");
#endif
}

// void glPixelStorei (GLenum pname, GLint param);
static inline void qglPixelStorei(GLenum pname, GLint param)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glPixelStorei(pname=%lu, param=%ld)\n", pname, param);
#endif
    glPixelStorei(pname, param);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glPixelStorei");
#endif
}

// void glPointParameterx (GLenum pname, GLfixed param);
static inline void qglPointParameterx(GLenum pname, GLfixed param)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glPointParameterx(pname=%lu, param=%ld)\n", pname, param);
#endif
    glPointParameterx(pname, param);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glPointParameterx");
#endif
}

// void glPointParameterxv (GLenum pname, const GLfixed *params);
static inline void qglPointParameterxv(GLenum pname, const GLfixed *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glPointParameterxv(pname=%lu, params=%p)\n", pname, params);
#endif
    glPointParameterxv(pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glPointParameterxv");
#endif
}

// void glPointSizex (GLfixed size);
static inline void qglPointSizex(GLfixed size)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glPointSizex(size=%ld)\n", size);
#endif
    glPointSizex(size);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glPointSizex");
#endif
}

// void glPolygonOffsetx (GLfixed factor, GLfixed units);
static inline void qglPolygonOffsetx(GLfixed factor, GLfixed units)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glPolygonOffsetx(factor=%ld, units=%ld)\n", factor, units);
#endif
    glPolygonOffsetx(factor, units);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glPolygonOffsetx");
#endif
}

// void glPopMatrix (void);
static inline void qglPopMatrix(void)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glPopMatrix(void)\n");
#endif
    glPopMatrix();
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glPopMatrix");
#endif
}

// void glPushMatrix (void);
static inline void qglPushMatrix(void)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glPushMatrix(void)\n");
#endif
    glPushMatrix();
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glPushMatrix");
#endif
}

// void glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
static inline void qglReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glReadPixels(x=%ld, y=%ld, width=%ld, height=%ld, format=%lu, type=%lu, pixels=%p)\n", x, y, width, height, format, type, pixels);
#endif
    glReadPixels(x, y, width, height, format, type, pixels);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glReadPixels");
#endif
}

// void glRotatex (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
static inline void qglRotatex(GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glRotatex(angle=%ld, x=%ld, y=%ld, z=%ld)\n", angle, x, y, z);
#endif
    glRotatex(angle, x, y, z);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glRotatex");
#endif
}

// void glSampleCoverage (GLclampf value, GLboolean invert);
static inline void qglSampleCoverage(GLclampf value, GLboolean invert)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glSampleCoverage(value=%f, invert=%u)\n", value, invert);
#endif
    glSampleCoverage(value, invert);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glSampleCoverage");
#endif
}

// void glSampleCoveragex (GLclampx value, GLboolean invert);
static inline void qglSampleCoveragex(GLclampx value, GLboolean invert)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glSampleCoveragex(value=%ld, invert=%u)\n", value, invert);
#endif
    glSampleCoveragex(value, invert);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glSampleCoveragex");
#endif
}

// void glScalex (GLfixed x, GLfixed y, GLfixed z);
static inline void qglScalex(GLfixed x, GLfixed y, GLfixed z)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glScalex(x=%ld, y=%ld, z=%ld)\n", x, y, z);
#endif
    glScalex(x, y, z);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glScalex");
#endif
}

// void glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
static inline void qglScissor(GLint x, GLint y, GLsizei width, GLsizei height)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glScissor(x=%ld, y=%ld, width=%ld, height=%ld)\n", x, y, width, height);
#endif
    glScissor(x, y, width, height);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glScissor");
#endif
}

// void glShadeModel (GLenum mode);
static inline void qglShadeModel(GLenum mode)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glShadeModel(mode=%lu)\n", mode);
#endif
    glShadeModel(mode);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glShadeModel");
#endif
}

// void glStencilFunc (GLenum func, GLint ref, GLuint mask);
static inline void qglStencilFunc(GLenum func, GLint ref, GLuint mask)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glStencilFunc(func=%lu, ref=%ld, mask=%lu)\n", func, ref, mask);
#endif
    glStencilFunc(func, ref, mask);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glStencilFunc");
#endif
}

// void glStencilMask (GLuint mask);
static inline void qglStencilMask(GLuint mask)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glStencilMask(mask=%lu)\n", mask);
#endif
    glStencilMask(mask);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glStencilMask");
#endif
}

// void glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
static inline void qglStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glStencilOp(fail=%lu, zfail=%lu, zpass=%lu)\n", fail, zfail, zpass);
#endif
    glStencilOp(fail, zfail, zpass);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glStencilOp");
#endif
}

// void glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
static inline void qglTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glTexCoordPointer(size=%ld, type=%lu, stride=%ld, pointer=%p)\n", size, type, stride, pointer);
#endif
    glTexCoordPointer(size, type, stride, pointer);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glTexCoordPointer");
#endif
}

// void glTexEnvi (GLenum target, GLenum pname, GLint param);
static inline void qglTexEnvi(GLenum target, GLenum pname, GLint param)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glTexEnvi(target=%lu, pname=%lu, param=%ld)\n", target, pname, param);
#endif
    glTexEnvi(target, pname, param);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glTexEnvi");
#endif
}

// void glTexEnvx (GLenum target, GLenum pname, GLfixed param);
static inline void qglTexEnvx(GLenum target, GLenum pname, GLfixed param)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glTexEnvx(target=%lu, pname=%lu, param=%ld)\n", target, pname, param);
#endif
    glTexEnvx(target, pname, param);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glTexEnvx");
#endif
}

// void glTexEnviv (GLenum target, GLenum pname, const GLint *params);
static inline void qglTexEnviv(GLenum target, GLenum pname, const GLint *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glTexEnviv(target=%lu, pname=%lu, params=%p)\n", target, pname, params);
#endif
    glTexEnviv(target, pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glTexEnviv");
#endif
}

// void glTexEnvxv (GLenum target, GLenum pname, const GLfixed *params);
static inline void qglTexEnvxv(GLenum target, GLenum pname, const GLfixed *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glTexEnvxv(target=%lu, pname=%lu, params=%p)\n", target, pname, params);
#endif
    glTexEnvxv(target, pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glTexEnvxv");
#endif
}

// void glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
static inline void qglTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glTexImage2D(target=%lu, level=%ld, internalformat=%ld, width=%ld, height=%ld, border=%ld, format=%lu, type=%lu, pixels=%p)\n", target, level, internalformat, width, height, border, format, type, pixels);
#endif
    glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glTexImage2D");
#endif
}

// void glTexParameteri (GLenum target, GLenum pname, GLint param);
static inline void qglTexParameteri(GLenum target, GLenum pname, GLint param)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glTexParameteri(target=%lu, pname=%lu, param=%ld)\n", target, pname, param);
#endif
    glTexParameteri(target, pname, param);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glTexParameteri");
#endif
}

// void glTexParameterx (GLenum target, GLenum pname, GLfixed param);
static inline void qglTexParameterx(GLenum target, GLenum pname, GLfixed param)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glTexParameterx(target=%lu, pname=%lu, param=%ld)\n", target, pname, param);
#endif
    glTexParameterx(target, pname, param);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glTexParameterx");
#endif
}

// void glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
static inline void qglTexParameteriv(GLenum target, GLenum pname, const GLint *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glTexParameteriv(target=%lu, pname=%lu, params=%p)\n", target, pname, params);
#endif
    glTexParameteriv(target, pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glTexParameteriv");
#endif
}

// void glTexParameterxv (GLenum target, GLenum pname, const GLfixed *params);
static inline void qglTexParameterxv(GLenum target, GLenum pname, const GLfixed *params)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glTexParameterxv(target=%lu, pname=%lu, params=%p)\n", target, pname, params);
#endif
    glTexParameterxv(target, pname, params);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glTexParameterxv");
#endif
}

// void glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
static inline void qglTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glTexSubImage2D(target=%lu, level=%ld, xoffset=%ld, yoffset=%ld, width=%ld, height=%ld, format=%lu, type=%lu, pixels=%p)\n", target, level, xoffset, yoffset, width, height, format, type, pixels);
#endif
    glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glTexSubImage2D");
#endif
}

// void glTranslatex (GLfixed x, GLfixed y, GLfixed z);
static inline void qglTranslatex(GLfixed x, GLfixed y, GLfixed z)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glTranslatex(x=%ld, y=%ld, z=%ld)\n", x, y, z);
#endif
    glTranslatex(x, y, z);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glTranslatex");
#endif
}

// void glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
static inline void qglVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glVertexPointer(size=%ld, type=%lu, stride=%ld, pointer=%p)\n", size, type, stride, pointer);
#endif
    glVertexPointer(size, type, stride, pointer);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glVertexPointer");
#endif
}

// void glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
static inline void qglViewport(GLint x, GLint y, GLsizei width, GLsizei height)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glViewport(x=%ld, y=%ld, width=%ld, height=%ld)\n", x, y, width, height);
#endif
    glViewport(x, y, width, height);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glViewport");
#endif
}

// void glPointSizePointerOES (GLenum type, GLsizei stride, const GLvoid *pointer);
static inline void qglPointSizePointerOES(GLenum type, GLsizei stride, const GLvoid *pointer)
{
#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)
    if (QGLLogGLCalls)
        fprintf(QGLDebugFile(), "glPointSizePointerOES(type=%lu, stride=%ld, pointer=%p)\n", type, stride, pointer);
#endif
    glPointSizePointerOES(type, stride, pointer);
#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)
    if (!QGLBeginStarted)
        QGLCheckError("glPointSizePointerOES");
#endif
}

// Prevent calls to the 'normal' GL functions
#define glAlphaFunc CALL_THE_QGL_VERSION_OF_glAlphaFunc
#define glClearColor CALL_THE_QGL_VERSION_OF_glClearColor
#define glClearDepthf CALL_THE_QGL_VERSION_OF_glClearDepthf
#define glClipPlanef CALL_THE_QGL_VERSION_OF_glClipPlanef
#define glDepthRangef CALL_THE_QGL_VERSION_OF_glDepthRangef
#define glFogf CALL_THE_QGL_VERSION_OF_glFogf
#define glFogfv CALL_THE_QGL_VERSION_OF_glFogfv
#define glFrustumf CALL_THE_QGL_VERSION_OF_glFrustumf
#define glGetClipPlanef CALL_THE_QGL_VERSION_OF_glGetClipPlanef
#define glGetFloatv CALL_THE_QGL_VERSION_OF_glGetFloatv
#define glGetLightfv CALL_THE_QGL_VERSION_OF_glGetLightfv
#define glGetMaterialfv CALL_THE_QGL_VERSION_OF_glGetMaterialfv
#define glGetTexEnvfv CALL_THE_QGL_VERSION_OF_glGetTexEnvfv
#define glGetTexParameterfv CALL_THE_QGL_VERSION_OF_glGetTexParameterfv
#define glLightModelf CALL_THE_QGL_VERSION_OF_glLightModelf
#define glLightModelfv CALL_THE_QGL_VERSION_OF_glLightModelfv
#define glLightf CALL_THE_QGL_VERSION_OF_glLightf
#define glLightfv CALL_THE_QGL_VERSION_OF_glLightfv
#define glLineWidth CALL_THE_QGL_VERSION_OF_glLineWidth
#define glLoadMatrixf CALL_THE_QGL_VERSION_OF_glLoadMatrixf
#define glMaterialf CALL_THE_QGL_VERSION_OF_glMaterialf
#define glMaterialfv CALL_THE_QGL_VERSION_OF_glMaterialfv
#define glMultMatrixf CALL_THE_QGL_VERSION_OF_glMultMatrixf
#define glMultiTexCoord4f CALL_THE_QGL_VERSION_OF_glMultiTexCoord4f
#define glNormal3f CALL_THE_QGL_VERSION_OF_glNormal3f
#define glOrthof CALL_THE_QGL_VERSION_OF_glOrthof
#define glPointParameterf CALL_THE_QGL_VERSION_OF_glPointParameterf
#define glPointParameterfv CALL_THE_QGL_VERSION_OF_glPointParameterfv
#define glPointSize CALL_THE_QGL_VERSION_OF_glPointSize
#define glPolygonOffset CALL_THE_QGL_VERSION_OF_glPolygonOffset
#define glRotatef CALL_THE_QGL_VERSION_OF_glRotatef
#define glScalef CALL_THE_QGL_VERSION_OF_glScalef
#define glTexEnvf CALL_THE_QGL_VERSION_OF_glTexEnvf
#define glTexEnvfv CALL_THE_QGL_VERSION_OF_glTexEnvfv
#define glTexParameterf CALL_THE_QGL_VERSION_OF_glTexParameterf
#define glTexParameterfv CALL_THE_QGL_VERSION_OF_glTexParameterfv
#define glTranslatef CALL_THE_QGL_VERSION_OF_glTranslatef
#define glActiveTexture CALL_THE_QGL_VERSION_OF_glActiveTexture
#define glAlphaFuncx CALL_THE_QGL_VERSION_OF_glAlphaFuncx
#define glBindBuffer CALL_THE_QGL_VERSION_OF_glBindBuffer
#define glBindTexture CALL_THE_QGL_VERSION_OF_glBindTexture
#define glBlendFunc CALL_THE_QGL_VERSION_OF_glBlendFunc
#define glBufferData CALL_THE_QGL_VERSION_OF_glBufferData
#define glBufferSubData CALL_THE_QGL_VERSION_OF_glBufferSubData
#define glClear CALL_THE_QGL_VERSION_OF_glClear
#define glClearColorx CALL_THE_QGL_VERSION_OF_glClearColorx
#define glClearDepthx CALL_THE_QGL_VERSION_OF_glClearDepthx
#define glClearStencil CALL_THE_QGL_VERSION_OF_glClearStencil
#define glClientActiveTexture CALL_THE_QGL_VERSION_OF_glClientActiveTexture
#define glClipPlanex CALL_THE_QGL_VERSION_OF_glClipPlanex
#define glColor4ub CALL_THE_QGL_VERSION_OF_glColor4ub
#define glColor4x CALL_THE_QGL_VERSION_OF_glColor4x
#define glColorMask CALL_THE_QGL_VERSION_OF_glColorMask
#define glColorPointer CALL_THE_QGL_VERSION_OF_glColorPointer
#define glCompressedTexImage2D CALL_THE_QGL_VERSION_OF_glCompressedTexImage2D
#define glCompressedTexSubImage2D CALL_THE_QGL_VERSION_OF_glCompressedTexSubImage2D
#define glCopyTexImage2D CALL_THE_QGL_VERSION_OF_glCopyTexImage2D
#define glCopyTexSubImage2D CALL_THE_QGL_VERSION_OF_glCopyTexSubImage2D
#define glCullFace CALL_THE_QGL_VERSION_OF_glCullFace
#define glDeleteBuffers CALL_THE_QGL_VERSION_OF_glDeleteBuffers
#define glDeleteTextures CALL_THE_QGL_VERSION_OF_glDeleteTextures
#define glDepthFunc CALL_THE_QGL_VERSION_OF_glDepthFunc
#define glDepthMask CALL_THE_QGL_VERSION_OF_glDepthMask
#define glDepthRangex CALL_THE_QGL_VERSION_OF_glDepthRangex
#define glDisable CALL_THE_QGL_VERSION_OF_glDisable
#define glDisableClientState CALL_THE_QGL_VERSION_OF_glDisableClientState
#define glDrawArrays CALL_THE_QGL_VERSION_OF_glDrawArrays
#define glDrawElements CALL_THE_QGL_VERSION_OF_glDrawElements
#define glEnable CALL_THE_QGL_VERSION_OF_glEnable
#define glEnableClientState CALL_THE_QGL_VERSION_OF_glEnableClientState
#define glFinish CALL_THE_QGL_VERSION_OF_glFinish
#define glFlush CALL_THE_QGL_VERSION_OF_glFlush
#define glFogx CALL_THE_QGL_VERSION_OF_glFogx
#define glFogxv CALL_THE_QGL_VERSION_OF_glFogxv
#define glFrontFace CALL_THE_QGL_VERSION_OF_glFrontFace
#define glFrustumx CALL_THE_QGL_VERSION_OF_glFrustumx
#define glGetBooleanv CALL_THE_QGL_VERSION_OF_glGetBooleanv
#define glGetBufferParameteriv CALL_THE_QGL_VERSION_OF_glGetBufferParameteriv
#define glGetClipPlanex CALL_THE_QGL_VERSION_OF_glGetClipPlanex
#define glGenBuffers CALL_THE_QGL_VERSION_OF_glGenBuffers
#define glGenTextures CALL_THE_QGL_VERSION_OF_glGenTextures
#define glGetError CALL_THE_QGL_VERSION_OF_glGetError
#define glGetFixedv CALL_THE_QGL_VERSION_OF_glGetFixedv
#define glGetIntegerv CALL_THE_QGL_VERSION_OF_glGetIntegerv
#define glGetLightxv CALL_THE_QGL_VERSION_OF_glGetLightxv
#define glGetMaterialxv CALL_THE_QGL_VERSION_OF_glGetMaterialxv
#define glGetPointerv CALL_THE_QGL_VERSION_OF_glGetPointerv
#define glGetString CALL_THE_QGL_VERSION_OF_glGetString
#define glGetTexEnviv CALL_THE_QGL_VERSION_OF_glGetTexEnviv
#define glGetTexEnvxv CALL_THE_QGL_VERSION_OF_glGetTexEnvxv
#define glGetTexParameteriv CALL_THE_QGL_VERSION_OF_glGetTexParameteriv
#define glGetTexParameterxv CALL_THE_QGL_VERSION_OF_glGetTexParameterxv
#define glHint CALL_THE_QGL_VERSION_OF_glHint
#define glIsBuffer CALL_THE_QGL_VERSION_OF_glIsBuffer
#define glIsEnabled CALL_THE_QGL_VERSION_OF_glIsEnabled
#define glIsTexture CALL_THE_QGL_VERSION_OF_glIsTexture
#define glLightModelx CALL_THE_QGL_VERSION_OF_glLightModelx
#define glLightModelxv CALL_THE_QGL_VERSION_OF_glLightModelxv
#define glLightx CALL_THE_QGL_VERSION_OF_glLightx
#define glLightxv CALL_THE_QGL_VERSION_OF_glLightxv
#define glLineWidthx CALL_THE_QGL_VERSION_OF_glLineWidthx
#define glLoadIdentity CALL_THE_QGL_VERSION_OF_glLoadIdentity
#define glLoadMatrixx CALL_THE_QGL_VERSION_OF_glLoadMatrixx
#define glLogicOp CALL_THE_QGL_VERSION_OF_glLogicOp
#define glMaterialx CALL_THE_QGL_VERSION_OF_glMaterialx
#define glMaterialxv CALL_THE_QGL_VERSION_OF_glMaterialxv
#define glMatrixMode CALL_THE_QGL_VERSION_OF_glMatrixMode
#define glMultMatrixx CALL_THE_QGL_VERSION_OF_glMultMatrixx
#define glMultiTexCoord4x CALL_THE_QGL_VERSION_OF_glMultiTexCoord4x
#define glNormal3x CALL_THE_QGL_VERSION_OF_glNormal3x
#define glNormalPointer CALL_THE_QGL_VERSION_OF_glNormalPointer
#define glOrthox CALL_THE_QGL_VERSION_OF_glOrthox
#define glPixelStorei CALL_THE_QGL_VERSION_OF_glPixelStorei
#define glPointParameterx CALL_THE_QGL_VERSION_OF_glPointParameterx
#define glPointParameterxv CALL_THE_QGL_VERSION_OF_glPointParameterxv
#define glPointSizex CALL_THE_QGL_VERSION_OF_glPointSizex
#define glPolygonOffsetx CALL_THE_QGL_VERSION_OF_glPolygonOffsetx
#define glPopMatrix CALL_THE_QGL_VERSION_OF_glPopMatrix
#define glPushMatrix CALL_THE_QGL_VERSION_OF_glPushMatrix
#define glReadPixels CALL_THE_QGL_VERSION_OF_glReadPixels
#define glRotatex CALL_THE_QGL_VERSION_OF_glRotatex
#define glSampleCoverage CALL_THE_QGL_VERSION_OF_glSampleCoverage
#define glSampleCoveragex CALL_THE_QGL_VERSION_OF_glSampleCoveragex
#define glScalex CALL_THE_QGL_VERSION_OF_glScalex
#define glScissor CALL_THE_QGL_VERSION_OF_glScissor
#define glShadeModel CALL_THE_QGL_VERSION_OF_glShadeModel
#define glStencilFunc CALL_THE_QGL_VERSION_OF_glStencilFunc
#define glStencilMask CALL_THE_QGL_VERSION_OF_glStencilMask
#define glStencilOp CALL_THE_QGL_VERSION_OF_glStencilOp
#define glTexCoordPointer CALL_THE_QGL_VERSION_OF_glTexCoordPointer
#define glTexEnvi CALL_THE_QGL_VERSION_OF_glTexEnvi
#define glTexEnvx CALL_THE_QGL_VERSION_OF_glTexEnvx
#define glTexEnviv CALL_THE_QGL_VERSION_OF_glTexEnviv
#define glTexEnvxv CALL_THE_QGL_VERSION_OF_glTexEnvxv
#define glTexImage2D CALL_THE_QGL_VERSION_OF_glTexImage2D
#define glTexParameteri CALL_THE_QGL_VERSION_OF_glTexParameteri
#define glTexParameterx CALL_THE_QGL_VERSION_OF_glTexParameterx
#define glTexParameteriv CALL_THE_QGL_VERSION_OF_glTexParameteriv
#define glTexParameterxv CALL_THE_QGL_VERSION_OF_glTexParameterxv
#define glTexSubImage2D CALL_THE_QGL_VERSION_OF_glTexSubImage2D
#define glTranslatex CALL_THE_QGL_VERSION_OF_glTranslatex
#define glVertexPointer CALL_THE_QGL_VERSION_OF_glVertexPointer
#define glViewport CALL_THE_QGL_VERSION_OF_glViewport
#define glPointSizePointerOES CALL_THE_QGL_VERSION_OF_glPointSizePointerOES