Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
55 pj 1
/* $Id: enums.c,v 1.1 2003-02-28 11:42:00 pj Exp $ */
2
 
3
/*
4
 * Mesa 3-D graphics library
5
 * Version:  3.5
6
 *
7
 * Copyright (C) 1999-2001  Brian Paul   All Rights Reserved.
8
 *
9
 * Permission is hereby granted, free of charge, to any person obtaining a
10
 * copy of this software and associated documentation files (the "Software"),
11
 * to deal in the Software without restriction, including without limitation
12
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13
 * and/or sell copies of the Software, and to permit persons to whom the
14
 * Software is furnished to do so, subject to the following conditions:
15
 *
16
 * The above copyright notice and this permission notice shall be included
17
 * in all copies or substantial portions of the Software.
18
 *
19
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
22
 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23
 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
 *
26
 * Author:
27
 *    Keith Whitwell <keith@tungstengraphics.com>
28
 */
29
 
30
 
31
#include "glheader.h"
32
#include "enums.h"
33
#include "imports.h"
34
 
35
 
36
typedef struct {
37
   const char *c;
38
   int n;
39
} enum_elt;
40
 
41
enum_elt all_enums[] =
42
{
43
   /* Boolean values */
44
   { "GL_FALSE", 0 },
45
   { "GL_TRUE", 1 },
46
 
47
   /* Data types */
48
   { "GL_BYTE", 0x1400 },
49
   { "GL_UNSIGNED_BYTE", 0x1401 },
50
   { "GL_SHORT", 0x1402 },
51
   { "GL_UNSIGNED_SHORT", 0x1403 },
52
   { "GL_INT", 0x1404 },
53
   { "GL_UNSIGNED_INT", 0x1405 },
54
   { "GL_FLOAT", 0x1406 },
55
   { "GL_DOUBLE", 0x140A },
56
   { "GL_2_BYTES", 0x1407 },
57
   { "GL_3_BYTES", 0x1408 },
58
   { "GL_4_BYTES", 0x1409 },
59
 
60
   /* Primitives */
61
   { "GL_LINES", 0x0001 },
62
   { "GL_POINTS", 0x0000 },
63
   { "GL_LINE_STRIP", 0x0003 },
64
   { "GL_LINE_LOOP", 0x0002 },
65
   { "GL_TRIANGLES", 0x0004 },
66
   { "GL_TRIANGLE_STRIP", 0x0005 },
67
   { "GL_TRIANGLE_FAN", 0x0006 },
68
   { "GL_QUADS", 0x0007 },
69
   { "GL_QUAD_STRIP", 0x0008 },
70
   { "GL_POLYGON", 0x0009 },
71
   { "GL_EDGE_FLAG", 0x0B43 },
72
 
73
   /* Vertex Arrays */
74
   { "GL_VERTEX_ARRAY", 0x8074 },
75
   { "GL_NORMAL_ARRAY", 0x8075 },
76
   { "GL_COLOR_ARRAY", 0x8076 },
77
   { "GL_INDEX_ARRAY", 0x8077 },
78
   { "GL_TEXTURE_COORD_ARRAY", 0x8078 },
79
   { "GL_EDGE_FLAG_ARRAY", 0x8079 },
80
   { "GL_VERTEX_ARRAY_SIZE", 0x807A },
81
   { "GL_VERTEX_ARRAY_TYPE", 0x807B },
82
   { "GL_VERTEX_ARRAY_STRIDE", 0x807C },
83
   { "GL_NORMAL_ARRAY_TYPE", 0x807E },
84
   { "GL_NORMAL_ARRAY_STRIDE", 0x807F },
85
   { "GL_COLOR_ARRAY_SIZE", 0x8081 },
86
   { "GL_COLOR_ARRAY_TYPE", 0x8082 },
87
   { "GL_COLOR_ARRAY_STRIDE", 0x8083 },
88
   { "GL_INDEX_ARRAY_TYPE", 0x8085 },
89
   { "GL_INDEX_ARRAY_STRIDE", 0x8086 },
90
   { "GL_TEXTURE_COORD_ARRAY_SIZE", 0x8088 },
91
   { "GL_TEXTURE_COORD_ARRAY_TYPE", 0x8089 },
92
   { "GL_TEXTURE_COORD_ARRAY_STRIDE", 0x808A },
93
   { "GL_EDGE_FLAG_ARRAY_STRIDE", 0x808C },
94
   { "GL_VERTEX_ARRAY_POINTER", 0x808E },
95
   { "GL_NORMAL_ARRAY_POINTER", 0x808F },
96
   { "GL_COLOR_ARRAY_POINTER", 0x8090 },
97
   { "GL_INDEX_ARRAY_POINTER", 0x8091 },
98
   { "GL_TEXTURE_COORD_ARRAY_POINTER", 0x8092 },
99
   { "GL_EDGE_FLAG_ARRAY_POINTER", 0x8093 },
100
   { "GL_V2F", 0x2A20 },
101
   { "GL_V3F", 0x2A21 },
102
   { "GL_C4UB_V2F", 0x2A22 },
103
   { "GL_C4UB_V3F", 0x2A23 },
104
   { "GL_C3F_V3F", 0x2A24 },
105
   { "GL_N3F_V3F", 0x2A25 },
106
   { "GL_C4F_N3F_V3F", 0x2A26 },
107
   { "GL_T2F_V3F", 0x2A27 },
108
   { "GL_T4F_V4F", 0x2A28 },
109
   { "GL_T2F_C4UB_V3F", 0x2A29 },
110
   { "GL_T2F_C3F_V3F", 0x2A2A },
111
   { "GL_T2F_N3F_V3F", 0x2A2B },
112
   { "GL_T2F_C4F_N3F_V3F", 0x2A2C },
113
   { "GL_T4F_C4F_N3F_V4F", 0x2A2D },
114
 
115
   /* Matrix Mode */
116
   { "GL_MATRIX_MODE", 0x0BA0 },
117
   { "GL_MODELVIEW", 0x1700 },
118
   { "GL_PROJECTION", 0x1701 },
119
   { "GL_TEXTURE", 0x1702 },
120
 
121
   /* Points */
122
   { "GL_POINT_SMOOTH", 0x0B10 },
123
   { "GL_POINT_SIZE", 0x0B11 },
124
   { "GL_POINT_SIZE_GRANULARITY ", 0x0B13 },
125
   { "GL_POINT_SIZE_RANGE", 0x0B12 },
126
 
127
   /* Lines */
128
   { "GL_LINE_SMOOTH", 0x0B20 },
129
   { "GL_LINE_STIPPLE", 0x0B24 },
130
   { "GL_LINE_STIPPLE_PATTERN", 0x0B25 },
131
   { "GL_LINE_STIPPLE_REPEAT", 0x0B26 },
132
   { "GL_LINE_WIDTH", 0x0B21 },
133
   { "GL_LINE_WIDTH_GRANULARITY", 0x0B23 },
134
   { "GL_LINE_WIDTH_RANGE", 0x0B22 },
135
 
136
   /* Polygons */
137
   { "GL_POINT", 0x1B00 },
138
   { "GL_LINE", 0x1B01 },
139
   { "GL_FILL", 0x1B02 },
140
   { "GL_CCW", 0x0901 },
141
   { "GL_CW", 0x0900 },
142
   { "GL_FRONT", 0x0404 },
143
   { "GL_BACK", 0x0405 },
144
   { "GL_CULL_FACE", 0x0B44 },
145
   { "GL_CULL_FACE_MODE", 0x0B45 },
146
   { "GL_POLYGON_SMOOTH", 0x0B41 },
147
   { "GL_POLYGON_STIPPLE", 0x0B42 },
148
   { "GL_FRONT_FACE", 0x0B46 },
149
   { "GL_POLYGON_MODE", 0x0B40 },
150
   { "GL_POLYGON_OFFSET_FACTOR", 0x8038 },
151
   { "GL_POLYGON_OFFSET_UNITS", 0x2A00 },
152
   { "GL_POLYGON_OFFSET_POINT", 0x2A01 },
153
   { "GL_POLYGON_OFFSET_LINE", 0x2A02 },
154
   { "GL_POLYGON_OFFSET_FILL", 0x8037 },
155
 
156
   /* Display Lists */
157
   { "GL_COMPILE", 0x1300 },
158
   { "GL_COMPILE_AND_EXECUTE", 0x1301 },
159
   { "GL_LIST_BASE", 0x0B32 },
160
   { "GL_LIST_INDEX", 0x0B33 },
161
   { "GL_LIST_MODE", 0x0B30 },
162
 
163
   /* Depth buffer */
164
   { "GL_NEVER", 0x0200 },
165
   { "GL_LESS", 0x0201 },
166
   { "GL_GEQUAL", 0x0206 },
167
   { "GL_LEQUAL", 0x0203 },
168
   { "GL_GREATER", 0x0204 },
169
   { "GL_NOTEQUAL", 0x0205 },
170
   { "GL_EQUAL", 0x0202 },
171
   { "GL_ALWAYS", 0x0207 },
172
   { "GL_DEPTH_TEST", 0x0B71 },
173
   { "GL_DEPTH_BITS", 0x0D56 },
174
   { "GL_DEPTH_CLEAR_VALUE", 0x0B73 },
175
   { "GL_DEPTH_FUNC", 0x0B74 },
176
   { "GL_DEPTH_RANGE", 0x0B70 },
177
   { "GL_DEPTH_WRITEMASK", 0x0B72 },
178
   { "GL_DEPTH_COMPONENT", 0x1902 },
179
 
180
   /* Lighting */
181
   { "GL_LIGHTING", 0x0B50 },
182
   { "GL_LIGHT0", 0x4000 },
183
   { "GL_LIGHT1", 0x4001 },
184
   { "GL_LIGHT2", 0x4002 },
185
   { "GL_LIGHT3", 0x4003 },
186
   { "GL_LIGHT4", 0x4004 },
187
   { "GL_LIGHT5", 0x4005 },
188
   { "GL_LIGHT6", 0x4006 },
189
   { "GL_LIGHT7", 0x4007 },
190
   { "GL_SPOT_EXPONENT", 0x1205 },
191
   { "GL_SPOT_CUTOFF", 0x1206 },
192
   { "GL_CONSTANT_ATTENUATION", 0x1207 },
193
   { "GL_LINEAR_ATTENUATION", 0x1208 },
194
   { "GL_QUADRATIC_ATTENUATION", 0x1209 },
195
   { "GL_AMBIENT", 0x1200 },
196
   { "GL_DIFFUSE", 0x1201 },
197
   { "GL_SPECULAR", 0x1202 },
198
   { "GL_SHININESS", 0x1601 },
199
   { "GL_EMISSION", 0x1600 },
200
   { "GL_POSITION", 0x1203 },
201
   { "GL_SPOT_DIRECTION", 0x1204 },
202
   { "GL_AMBIENT_AND_DIFFUSE", 0x1602 },
203
   { "GL_COLOR_INDEXES", 0x1603 },
204
   { "GL_LIGHT_MODEL_TWO_SIDE", 0x0B52 },
205
   { "GL_LIGHT_MODEL_LOCAL_VIEWER", 0x0B51 },
206
   { "GL_LIGHT_MODEL_AMBIENT", 0x0B53 },
207
   { "GL_FRONT_AND_BACK", 0x0408 },
208
   { "GL_SHADE_MODEL", 0x0B54 },
209
   { "GL_FLAT", 0x1D00 },
210
   { "GL_SMOOTH", 0x1D01 },
211
   { "GL_COLOR_MATERIAL", 0x0B57 },
212
   { "GL_COLOR_MATERIAL_FACE", 0x0B55 },
213
   { "GL_COLOR_MATERIAL_PARAMETER", 0x0B56 },
214
   { "GL_NORMALIZE", 0x0BA1 },
215
 
216
   /* User clipping planes */
217
   { "GL_CLIP_PLANE0", 0x3000 },
218
   { "GL_CLIP_PLANE1", 0x3001 },
219
   { "GL_CLIP_PLANE2", 0x3002 },
220
   { "GL_CLIP_PLANE3", 0x3003 },
221
   { "GL_CLIP_PLANE4", 0x3004 },
222
   { "GL_CLIP_PLANE5", 0x3005 },
223
 
224
   /* Accumulation buffer */
225
   { "GL_ACCUM_RED_BITS", 0x0D58 },
226
   { "GL_ACCUM_GREEN_BITS", 0x0D59 },
227
   { "GL_ACCUM_BLUE_BITS", 0x0D5A },
228
   { "GL_ACCUM_ALPHA_BITS", 0x0D5B },
229
   { "GL_ACCUM_CLEAR_VALUE", 0x0B80 },
230
   { "GL_ACCUM", 0x0100 },
231
   { "GL_ADD", 0x0104 },
232
   { "GL_LOAD", 0x0101 },
233
   { "GL_MULT", 0x0103 },
234
   { "GL_RETURN", 0x0102 },
235
 
236
   /* Alpha testing */
237
   { "GL_ALPHA_TEST", 0x0BC0 },
238
   { "GL_ALPHA_TEST_REF", 0x0BC2 },
239
   { "GL_ALPHA_TEST_FUNC", 0x0BC1 },
240
 
241
   /* Blending */
242
   { "GL_BLEND", 0x0BE2 },
243
   { "GL_BLEND_SRC", 0x0BE1 },
244
   { "GL_BLEND_DST", 0x0BE0 },
245
   { "GL_ZERO", 0 },
246
   { "GL_ONE", 1 },
247
   { "GL_SRC_COLOR", 0x0300 },
248
   { "GL_ONE_MINUS_SRC_COLOR", 0x0301 },
249
   { "GL_DST_COLOR", 0x0306 },
250
   { "GL_ONE_MINUS_DST_COLOR", 0x0307 },
251
   { "GL_SRC_ALPHA", 0x0302 },
252
   { "GL_ONE_MINUS_SRC_ALPHA", 0x0303 },
253
   { "GL_DST_ALPHA", 0x0304 },
254
   { "GL_ONE_MINUS_DST_ALPHA", 0x0305 },
255
   { "GL_SRC_ALPHA_SATURATE", 0x0308 },
256
   { "GL_CONSTANT_COLOR", 0x8001 },
257
   { "GL_ONE_MINUS_CONSTANT_COLOR", 0x8002 },
258
   { "GL_CONSTANT_ALPHA", 0x8003 },
259
   { "GL_ONE_MINUS_CONSTANT_ALPHA", 0x8004 },
260
 
261
   /* Render Mode */
262
   { "GL_FEEDBACK", 0x1C01 },
263
   { "GL_RENDER", 0x1C00 },
264
   { "GL_SELECT", 0x1C02 },
265
 
266
   /* Feedback */
267
   { "GL_2D", 0x0600 },
268
   { "GL_3D", 0x0601 },
269
   { "GL_3D_COLOR", 0x0602 },
270
   { "GL_3D_COLOR_TEXTURE", 0x0603 },
271
   { "GL_4D_COLOR_TEXTURE", 0x0604 },
272
   { "GL_POINT_TOKEN", 0x0701 },
273
   { "GL_LINE_TOKEN", 0x0702 },
274
   { "GL_LINE_RESET_TOKEN", 0x0707 },
275
   { "GL_POLYGON_TOKEN", 0x0703 },
276
   { "GL_BITMAP_TOKEN", 0x0704 },
277
   { "GL_DRAW_PIXEL_TOKEN", 0x0705 },
278
   { "GL_COPY_PIXEL_TOKEN", 0x0706 },
279
   { "GL_PASS_THROUGH_TOKEN", 0x0700 },
280
   { "GL_FEEDBACK_BUFFER_POINTER", 0x0DF0 },
281
   { "GL_FEEDBACK_BUFFER_SIZE", 0x0DF1 },
282
   { "GL_FEEDBACK_BUFFER_TYPE", 0x0DF2 },
283
 
284
   /* Selection */
285
   { "GL_SELECTION_BUFFER_POINTER", 0x0DF3 },
286
   { "GL_SELECTION_BUFFER_SIZE", 0x0DF4 },
287
 
288
   /* Fog */
289
   { "GL_FOG", 0x0B60 },
290
   { "GL_FOG_MODE", 0x0B65 },
291
   { "GL_FOG_DENSITY", 0x0B62 },
292
   { "GL_FOG_COLOR", 0x0B66 },
293
   { "GL_FOG_INDEX", 0x0B61 },
294
   { "GL_FOG_START", 0x0B63 },
295
   { "GL_FOG_END", 0x0B64 },
296
   { "GL_LINEAR", 0x2601 },
297
   { "GL_EXP", 0x0800 },
298
   { "GL_EXP2", 0x0801 },
299
 
300
   /* Logic Ops */
301
   { "GL_LOGIC_OP", 0x0BF1 },
302
   { "GL_INDEX_LOGIC_OP", 0x0BF1 },
303
   { "GL_COLOR_LOGIC_OP", 0x0BF2 },
304
   { "GL_LOGIC_OP_MODE", 0x0BF0 },
305
   { "GL_CLEAR", 0x1500 },
306
   { "GL_SET", 0x150F },
307
   { "GL_COPY", 0x1503 },
308
   { "GL_COPY_INVERTED", 0x150C },
309
   { "GL_NOOP", 0x1505 },
310
   { "GL_INVERT", 0x150A },
311
   { "GL_AND", 0x1501 },
312
   { "GL_NAND", 0x150E },
313
   { "GL_OR", 0x1507 },
314
   { "GL_NOR", 0x1508 },
315
   { "GL_XOR", 0x1506 },
316
   { "GL_EQUIV", 0x1509 },
317
   { "GL_AND_REVERSE", 0x1502 },
318
   { "GL_AND_INVERTED", 0x1504 },
319
   { "GL_OR_REVERSE", 0x150B },
320
   { "GL_OR_INVERTED", 0x150D },
321
 
322
   /* Stencil */
323
   { "GL_STENCIL_TEST", 0x0B90 },
324
   { "GL_STENCIL_WRITEMASK", 0x0B98 },
325
   { "GL_STENCIL_BITS", 0x0D57 },
326
   { "GL_STENCIL_FUNC", 0x0B92 },
327
   { "GL_STENCIL_VALUE_MASK", 0x0B93 },
328
   { "GL_STENCIL_REF", 0x0B97 },
329
   { "GL_STENCIL_FAIL", 0x0B94 },
330
   { "GL_STENCIL_PASS_DEPTH_PASS", 0x0B96 },
331
   { "GL_STENCIL_PASS_DEPTH_FAIL", 0x0B95 },
332
   { "GL_STENCIL_CLEAR_VALUE", 0x0B91 },
333
   { "GL_STENCIL_INDEX", 0x1901 },
334
   { "GL_KEEP", 0x1E00 },
335
   { "GL_REPLACE", 0x1E01 },
336
   { "GL_INCR", 0x1E02 },
337
   { "GL_DECR", 0x1E03 },
338
 
339
   /* Buffers, Pixel Drawing/Reading */
340
   { "GL_NONE", 0 },
341
   { "GL_LEFT", 0x0406 },
342
   { "GL_RIGHT", 0x0407 },
343
   { "GL_FRONT_LEFT", 0x0400 },
344
   { "GL_FRONT_RIGHT", 0x0401 },
345
   { "GL_BACK_LEFT", 0x0402 },
346
   { "GL_BACK_RIGHT", 0x0403 },
347
   { "GL_AUX0", 0x0409 },
348
   { "GL_AUX1", 0x040A },
349
   { "GL_AUX2", 0x040B },
350
   { "GL_AUX3", 0x040C },
351
   { "GL_COLOR_INDEX", 0x1900 },
352
   { "GL_RED", 0x1903 },
353
   { "GL_GREEN", 0x1904 },
354
   { "GL_BLUE", 0x1905 },
355
   { "GL_ALPHA", 0x1906 },
356
   { "GL_LUMINANCE", 0x1909 },
357
   { "GL_LUMINANCE_ALPHA", 0x190A },
358
   { "GL_ALPHA_BITS", 0x0D55 },
359
   { "GL_RED_BITS", 0x0D52 },
360
   { "GL_GREEN_BITS", 0x0D53 },
361
   { "GL_BLUE_BITS", 0x0D54 },
362
   { "GL_INDEX_BITS", 0x0D51 },
363
   { "GL_SUBPIXEL_BITS", 0x0D50 },
364
   { "GL_AUX_BUFFERS", 0x0C00 },
365
   { "GL_READ_BUFFER", 0x0C02 },
366
   { "GL_DRAW_BUFFER", 0x0C01 },
367
   { "GL_DOUBLEBUFFER", 0x0C32 },
368
   { "GL_STEREO", 0x0C33 },
369
   { "GL_BITMAP", 0x1A00 },
370
   { "GL_COLOR", 0x1800 },
371
   { "GL_DEPTH", 0x1801 },
372
   { "GL_STENCIL", 0x1802 },
373
   { "GL_DITHER", 0x0BD0 },
374
   { "GL_RGB", 0x1907 },
375
   { "GL_RGBA", 0x1908 },
376
 
377
   /* Implementation limits */
378
   { "GL_MAX_LIST_NESTING", 0x0B31 },
379
   { "GL_MAX_ATTRIB_STACK_DEPTH", 0x0D35 },
380
   { "GL_MAX_MODELVIEW_STACK_DEPTH", 0x0D36 },
381
   { "GL_MAX_NAME_STACK_DEPTH", 0x0D37 },
382
   { "GL_MAX_PROJECTION_STACK_DEPTH", 0x0D38 },
383
   { "GL_MAX_TEXTURE_STACK_DEPTH", 0x0D39 },
384
   { "GL_MAX_EVAL_ORDER", 0x0D30 },
385
   { "GL_MAX_LIGHTS", 0x0D31 },
386
   { "GL_MAX_CLIP_PLANES", 0x0D32 },
387
   { "GL_MAX_TEXTURE_SIZE", 0x0D33 },
388
   { "GL_MAX_PIXEL_MAP_TABLE", 0x0D34 },
389
   { "GL_MAX_VIEWPORT_DIMS", 0x0D3A },
390
   { "GL_MAX_CLIENT_ATTRIB_STACK_DEPTH", 0x0D3B },
391
 
392
 
393
   { "GL_ATTRIB_STACK_DEPTH", 0x0BB0 },
394
   { "GL_CLIENT_ATTRIB_STACK_DEPTH", 0x0BB1 },
395
   { "GL_COLOR_CLEAR_VALUE", 0x0C22 },
396
   { "GL_COLOR_WRITEMASK", 0x0C23 },
397
   { "GL_CURRENT_INDEX", 0x0B01 },
398
   { "GL_CURRENT_COLOR", 0x0B00 },
399
   { "GL_CURRENT_NORMAL", 0x0B02 },
400
   { "GL_CURRENT_RASTER_COLOR", 0x0B04 },
401
   { "GL_CURRENT_RASTER_DISTANCE", 0x0B09 },
402
   { "GL_CURRENT_RASTER_INDEX", 0x0B05 },
403
   { "GL_CURRENT_RASTER_POSITION", 0x0B07 },
404
   { "GL_CURRENT_RASTER_TEXTURE_COORDS", 0x0B06},
405
   { "GL_CURRENT_RASTER_POSITION_VALID", 0x0B08 },
406
   { "GL_CURRENT_TEXTURE_COORDS", 0x0B03 },
407
   { "GL_INDEX_CLEAR_VALUE", 0x0C20 },
408
   { "GL_INDEX_MODE", 0x0C30 },
409
   { "GL_INDEX_WRITEMASK", 0x0C21 },
410
   { "GL_MODELVIEW_MATRIX", 0x0BA6 },
411
   { "GL_MODELVIEW_STACK_DEPTH", 0x0BA3 },
412
   { "GL_NAME_STACK_DEPTH", 0x0D70 },
413
   { "GL_PROJECTION_MATRIX", 0x0BA7 },
414
   { "GL_PROJECTION_STACK_DEPTH", 0x0BA4 },
415
   { "GL_RENDER_MODE", 0x0C40 },
416
   { "GL_RGBA_MODE", 0x0C31 },
417
   { "GL_TEXTURE_MATRIX", 0x0BA8 },
418
   { "GL_TEXTURE_STACK_DEPTH", 0x0BA5 },
419
   { "GL_VIEWPORT", 0x0BA2 },
420
 
421
 
422
   /* Evaluators */
423
   { "GL_AUTO_NORMAL", 0x0D80 },
424
   { "GL_MAP1_COLOR_4", 0x0D90 },
425
   { "GL_MAP1_GRID_DOMAIN", 0x0DD0 },
426
   { "GL_MAP1_GRID_SEGMENTS", 0x0DD1 },
427
   { "GL_MAP1_INDEX", 0x0D91 },
428
   { "GL_MAP1_NORMAL", 0x0D92 },
429
   { "GL_MAP1_TEXTURE_COORD_1", 0x0D93 },
430
   { "GL_MAP1_TEXTURE_COORD_2", 0x0D94 },
431
   { "GL_MAP1_TEXTURE_COORD_3", 0x0D95 },
432
   { "GL_MAP1_TEXTURE_COORD_4", 0x0D96 },
433
   { "GL_MAP1_VERTEX_3", 0x0D97 },
434
   { "GL_MAP1_VERTEX_4", 0x0D98 },
435
   { "GL_MAP2_COLOR_4", 0x0DB0 },
436
   { "GL_MAP2_GRID_DOMAIN", 0x0DD2 },
437
   { "GL_MAP2_GRID_SEGMENTS", 0x0DD3 },
438
   { "GL_MAP2_INDEX", 0x0DB1 },
439
   { "GL_MAP2_NORMAL", 0x0DB2 },
440
   { "GL_MAP2_TEXTURE_COORD_1", 0x0DB3 },
441
   { "GL_MAP2_TEXTURE_COORD_2", 0x0DB4 },
442
   { "GL_MAP2_TEXTURE_COORD_3", 0x0DB5 },
443
   { "GL_MAP2_TEXTURE_COORD_4", 0x0DB6 },
444
   { "GL_MAP2_VERTEX_3", 0x0DB7 },
445
   { "GL_MAP2_VERTEX_4", 0x0DB8 },
446
   { "GL_COEFF", 0x0A00 },
447
   { "GL_DOMAIN", 0x0A02 },
448
   { "GL_ORDER", 0x0A01 },
449
 
450
   /* Hints */
451
   { "GL_FOG_HINT", 0x0C54 },
452
   { "GL_LINE_SMOOTH_HINT", 0x0C52 },
453
   { "GL_PERSPECTIVE_CORRECTION_HINT", 0x0C50 },
454
   { "GL_POINT_SMOOTH_HINT", 0x0C51 },
455
   { "GL_POLYGON_SMOOTH_HINT", 0x0C53 },
456
   { "GL_DONT_CARE", 0x1100 },
457
   { "GL_FASTEST", 0x1101 },
458
   { "GL_NICEST", 0x1102 },
459
 
460
   /* Scissor box */
461
   { "GL_SCISSOR_TEST", 0x0C11 },
462
   { "GL_SCISSOR_BOX", 0x0C10 },
463
 
464
   /* Pixel Mode / Transfer */
465
   { "GL_MAP_COLOR", 0x0D10 },
466
   { "GL_MAP_STENCIL", 0x0D11 },
467
   { "GL_INDEX_SHIFT", 0x0D12 },
468
   { "GL_INDEX_OFFSET", 0x0D13 },
469
   { "GL_RED_SCALE", 0x0D14 },
470
   { "GL_RED_BIAS", 0x0D15 },
471
   { "GL_GREEN_SCALE", 0x0D18 },
472
   { "GL_GREEN_BIAS", 0x0D19 },
473
   { "GL_BLUE_SCALE", 0x0D1A },
474
   { "GL_BLUE_BIAS", 0x0D1B },
475
   { "GL_ALPHA_SCALE", 0x0D1C },
476
   { "GL_ALPHA_BIAS", 0x0D1D },
477
   { "GL_DEPTH_SCALE", 0x0D1E },
478
   { "GL_DEPTH_BIAS", 0x0D1F },
479
   { "GL_PIXEL_MAP_S_TO_S_SIZE", 0x0CB1 },
480
   { "GL_PIXEL_MAP_I_TO_I_SIZE", 0x0CB0 },
481
   { "GL_PIXEL_MAP_I_TO_R_SIZE", 0x0CB2 },
482
   { "GL_PIXEL_MAP_I_TO_G_SIZE", 0x0CB3 },
483
   { "GL_PIXEL_MAP_I_TO_B_SIZE", 0x0CB4 },
484
   { "GL_PIXEL_MAP_I_TO_A_SIZE", 0x0CB5 },
485
   { "GL_PIXEL_MAP_R_TO_R_SIZE", 0x0CB6 },
486
   { "GL_PIXEL_MAP_G_TO_G_SIZE", 0x0CB7 },
487
   { "GL_PIXEL_MAP_B_TO_B_SIZE", 0x0CB8 },
488
   { "GL_PIXEL_MAP_A_TO_A_SIZE", 0x0CB9 },
489
   { "GL_PIXEL_MAP_S_TO_S", 0x0C71 },
490
   { "GL_PIXEL_MAP_I_TO_I", 0x0C70 },
491
   { "GL_PIXEL_MAP_I_TO_R", 0x0C72 },
492
   { "GL_PIXEL_MAP_I_TO_G", 0x0C73 },
493
   { "GL_PIXEL_MAP_I_TO_B", 0x0C74 },
494
   { "GL_PIXEL_MAP_I_TO_A", 0x0C75 },
495
   { "GL_PIXEL_MAP_R_TO_R", 0x0C76 },
496
   { "GL_PIXEL_MAP_G_TO_G", 0x0C77 },
497
   { "GL_PIXEL_MAP_B_TO_B", 0x0C78 },
498
   { "GL_PIXEL_MAP_A_TO_A", 0x0C79 },
499
   { "GL_PACK_ALIGNMENT", 0x0D05 },
500
   { "GL_PACK_LSB_FIRST", 0x0D01 },
501
   { "GL_PACK_ROW_LENGTH", 0x0D02 },
502
   { "GL_PACK_SKIP_PIXELS", 0x0D04 },
503
   { "GL_PACK_SKIP_ROWS", 0x0D03 },
504
   { "GL_PACK_SWAP_BYTES", 0x0D00 },
505
   { "GL_UNPACK_ALIGNMENT", 0x0CF5 },
506
   { "GL_UNPACK_LSB_FIRST", 0x0CF1 },
507
   { "GL_UNPACK_ROW_LENGTH", 0x0CF2 },
508
   { "GL_UNPACK_SKIP_PIXELS", 0x0CF4 },
509
   { "GL_UNPACK_SKIP_ROWS", 0x0CF3 },
510
   { "GL_UNPACK_SWAP_BYTES", 0x0CF0 },
511
   { "GL_ZOOM_X", 0x0D16 },
512
   { "GL_ZOOM_Y", 0x0D17 },
513
 
514
   /* Texture mapping */
515
   { "GL_TEXTURE_ENV", 0x2300 },
516
   { "GL_TEXTURE_ENV_MODE", 0x2200 },
517
   { "GL_TEXTURE_1D", 0x0DE0 },
518
   { "GL_TEXTURE_2D", 0x0DE1 },
519
   { "GL_TEXTURE_WRAP_S", 0x2802 },
520
   { "GL_TEXTURE_WRAP_T", 0x2803 },
521
   { "GL_TEXTURE_MAG_FILTER", 0x2800 },
522
   { "GL_TEXTURE_MIN_FILTER", 0x2801 },
523
   { "GL_TEXTURE_ENV_COLOR", 0x2201 },
524
   { "GL_TEXTURE_GEN_S", 0x0C60 },
525
   { "GL_TEXTURE_GEN_T", 0x0C61 },
526
   { "GL_TEXTURE_GEN_MODE", 0x2500 },
527
   { "GL_TEXTURE_BORDER_COLOR", 0x1004 },
528
   { "GL_TEXTURE_WIDTH", 0x1000 },
529
   { "GL_TEXTURE_HEIGHT", 0x1001 },
530
   { "GL_TEXTURE_BORDER", 0x1005 },
531
   { "GL_TEXTURE_COMPONENTS", 0x1003 },
532
   { "GL_TEXTURE_RED_SIZE", 0x805C },
533
   { "GL_TEXTURE_GREEN_SIZE", 0x805D },
534
   { "GL_TEXTURE_BLUE_SIZE", 0x805E },
535
   { "GL_TEXTURE_ALPHA_SIZE", 0x805F },
536
   { "GL_TEXTURE_LUMINANCE_SIZE", 0x8060 },
537
   { "GL_TEXTURE_INTENSITY_SIZE", 0x8061 },
538
   { "GL_NEAREST_MIPMAP_NEAREST", 0x2700 },
539
   { "GL_NEAREST_MIPMAP_LINEAR", 0x2702 },
540
   { "GL_LINEAR_MIPMAP_NEAREST", 0x2701 },
541
   { "GL_LINEAR_MIPMAP_LINEAR", 0x2703 },
542
   { "GL_OBJECT_LINEAR", 0x2401 },
543
   { "GL_OBJECT_PLANE", 0x2501 },
544
   { "GL_EYE_LINEAR", 0x2400 },
545
   { "GL_EYE_PLANE", 0x2502 },
546
   { "GL_SPHERE_MAP", 0x2402 },
547
   { "GL_DECAL", 0x2101 },
548
   { "GL_MODULATE", 0x2100 },
549
   { "GL_NEAREST", 0x2600 },
550
   { "GL_REPEAT", 0x2901 },
551
   { "GL_CLAMP", 0x2900 },
552
   { "GL_S", 0x2000 },
553
   { "GL_T", 0x2001 },
554
   { "GL_R", 0x2002 },
555
   { "GL_Q", 0x2003 },
556
   { "GL_TEXTURE_GEN_R", 0x0C62 },
557
   { "GL_TEXTURE_GEN_Q", 0x0C63 },
558
 
559
   /* GL 1.1 texturing */
560
   { "GL_PROXY_TEXTURE_1D", 0x8063 },
561
   { "GL_PROXY_TEXTURE_2D", 0x8064 },
562
   { "GL_TEXTURE_PRIORITY", 0x8066 },
563
   { "GL_TEXTURE_RESIDENT", 0x8067 },
564
   { "GL_TEXTURE_BINDING_1D", 0x8068 },
565
   { "GL_TEXTURE_BINDING_2D", 0x8069 },
566
   { "GL_TEXTURE_INTERNAL_FORMAT", 0x1003 },
567
 
568
   /* GL 1.2 texturing */
569
   { "GL_PACK_SKIP_IMAGES", 0x806B },
570
   { "GL_PACK_IMAGE_HEIGHT", 0x806C },
571
   { "GL_UNPACK_SKIP_IMAGES", 0x806D },
572
   { "GL_UNPACK_IMAGE_HEIGHT", 0x806E },
573
   { "GL_TEXTURE_3D", 0x806F },
574
   { "GL_PROXY_TEXTURE_3D", 0x8070 },
575
   { "GL_TEXTURE_DEPTH", 0x8071 },
576
   { "GL_TEXTURE_WRAP_R", 0x8072 },
577
   { "GL_MAX_3D_TEXTURE_SIZE", 0x8073 },
578
   { "GL_TEXTURE_BINDING_3D", 0x806A },
579
 
580
   /* Internal texture formats (GL 1.1) */
581
   { "GL_ALPHA4", 0x803B },
582
   { "GL_ALPHA8", 0x803C },
583
   { "GL_ALPHA12", 0x803D },
584
   { "GL_ALPHA16", 0x803E },
585
   { "GL_LUMINANCE4", 0x803F },
586
   { "GL_LUMINANCE8", 0x8040 },
587
   { "GL_LUMINANCE12", 0x8041 },
588
   { "GL_LUMINANCE16", 0x8042 },
589
   { "GL_LUMINANCE4_ALPHA4", 0x8043 },
590
   { "GL_LUMINANCE6_ALPHA2", 0x8044 },
591
   { "GL_LUMINANCE8_ALPHA8", 0x8045 },
592
   { "GL_LUMINANCE12_ALPHA4", 0x8046 },
593
   { "GL_LUMINANCE12_ALPHA12", 0x8047 },
594
   { "GL_LUMINANCE16_ALPHA16", 0x8048 },
595
   { "GL_INTENSITY", 0x8049 },
596
   { "GL_INTENSITY4", 0x804A },
597
   { "GL_INTENSITY8", 0x804B },
598
   { "GL_INTENSITY12", 0x804C },
599
   { "GL_INTENSITY16", 0x804D },
600
   { "GL_R3_G3_B2", 0x2A10 },
601
   { "GL_RGB4", 0x804F },
602
   { "GL_RGB5", 0x8050 },
603
   { "GL_RGB8", 0x8051 },
604
   { "GL_RGB10", 0x8052 },
605
   { "GL_RGB12", 0x8053 },
606
   { "GL_RGB16", 0x8054 },
607
   { "GL_RGBA2", 0x8055 },
608
   { "GL_RGBA4", 0x8056 },
609
   { "GL_RGB5_A1", 0x8057 },
610
   { "GL_RGBA8", 0x8058 },
611
   { "GL_RGB10_A2", 0x8059 },
612
   { "GL_RGBA12", 0x805A },
613
   { "GL_RGBA16", 0x805B },
614
 
615
   /* Utility */
616
   { "GL_VENDOR", 0x1F00 },
617
   { "GL_RENDERER", 0x1F01 },
618
   { "GL_VERSION", 0x1F02 },
619
   { "GL_EXTENSIONS", 0x1F03 },
620
 
621
   /* Errors */
622
   { "GL_INVALID_VALUE", 0x0501 },
623
   { "GL_INVALID_ENUM", 0x0500 },
624
   { "GL_INVALID_OPERATION", 0x0502 },
625
   { "GL_STACK_OVERFLOW", 0x0503 },
626
   { "GL_STACK_UNDERFLOW", 0x0504 },
627
   { "GL_OUT_OF_MEMORY", 0x0505 },
628
 
629
   /*
630
    * Extensions
631
    */
632
 
633
   { "GL_CONSTANT_COLOR_EXT", 0x8001 },
634
   { "GL_ONE_MINUS_CONSTANT_COLOR_EXT", 0x8002 },
635
   { "GL_CONSTANT_ALPHA_EXT", 0x8003 },
636
   { "GL_ONE_MINUS_CONSTANT_ALPHA_EXT", 0x8004 },
637
   { "GL_BLEND_EQUATION_EXT", 0x8009 },
638
   { "GL_MIN_EXT", 0x8007 },
639
   { "GL_MAX_EXT", 0x8008 },
640
   { "GL_FUNC_ADD_EXT", 0x8006 },
641
   { "GL_FUNC_SUBTRACT_EXT", 0x800A },
642
   { "GL_FUNC_REVERSE_SUBTRACT_EXT", 0x800B },
643
   { "GL_BLEND_COLOR_EXT", 0x8005 },
644
 
645
   { "GL_POLYGON_OFFSET_EXT", 0x8037 },
646
   { "GL_POLYGON_OFFSET_FACTOR_EXT", 0x8038 },
647
   { "GL_POLYGON_OFFSET_BIAS_EXT", 0x8039 },
648
 
649
 
650
   { "GL_VERTEX_ARRAY_EXT", 0x8074 },
651
   { "GL_NORMAL_ARRAY_EXT", 0x8075 },
652
   { "GL_COLOR_ARRAY_EXT", 0x8076 },
653
   { "GL_INDEX_ARRAY_EXT", 0x8077 },
654
   { "GL_TEXTURE_COORD_ARRAY_EXT", 0x8078 },
655
   { "GL_EDGE_FLAG_ARRAY_EXT", 0x8079 },
656
   { "GL_VERTEX_ARRAY_SIZE_EXT", 0x807A },
657
   { "GL_VERTEX_ARRAY_TYPE_EXT", 0x807B },
658
   { "GL_VERTEX_ARRAY_STRIDE_EXT", 0x807C },
659
   { "GL_VERTEX_ARRAY_COUNT_EXT", 0x807D },
660
   { "GL_NORMAL_ARRAY_TYPE_EXT", 0x807E },
661
   { "GL_NORMAL_ARRAY_STRIDE_EXT", 0x807F },
662
   { "GL_NORMAL_ARRAY_COUNT_EXT", 0x8080 },
663
   { "GL_COLOR_ARRAY_SIZE_EXT", 0x8081 },
664
   { "GL_COLOR_ARRAY_TYPE_EXT", 0x8082 },
665
   { "GL_COLOR_ARRAY_STRIDE_EXT", 0x8083 },
666
   { "GL_COLOR_ARRAY_COUNT_EXT", 0x8084 },
667
   { "GL_INDEX_ARRAY_TYPE_EXT", 0x8085 },
668
   { "GL_INDEX_ARRAY_STRIDE_EXT", 0x8086 },
669
   { "GL_INDEX_ARRAY_COUNT_EXT", 0x8087 },
670
   { "GL_TEXTURE_COORD_ARRAY_SIZE_EXT", 0x8088 },
671
   { "GL_TEXTURE_COORD_ARRAY_TYPE_EXT", 0x8089 },
672
   { "GL_TEXTURE_COORD_ARRAY_STRIDE_EXT", 0x808A },
673
   { "GL_TEXTURE_COORD_ARRAY_COUNT_EXT", 0x808B },
674
   { "GL_EDGE_FLAG_ARRAY_STRIDE_EXT", 0x808C },
675
   { "GL_EDGE_FLAG_ARRAY_COUNT_EXT", 0x808D },
676
   { "GL_VERTEX_ARRAY_POINTER_EXT", 0x808E },
677
   { "GL_NORMAL_ARRAY_POINTER_EXT", 0x808F },
678
   { "GL_COLOR_ARRAY_POINTER_EXT", 0x8090 },
679
   { "GL_INDEX_ARRAY_POINTER_EXT", 0x8091 },
680
   { "GL_TEXTURE_COORD_ARRAY_POINTER_EXT", 0x8092 },
681
   { "GL_EDGE_FLAG_ARRAY_POINTER_EXT", 0x8093 },
682
 
683
   { "GL_TEXTURE_PRIORITY_EXT", 0x8066 },
684
   { "GL_TEXTURE_RESIDENT_EXT", 0x8067 },
685
   { "GL_TEXTURE_1D_BINDING_EXT", 0x8068 },
686
   { "GL_TEXTURE_2D_BINDING_EXT", 0x8069 },
687
 
688
   { "GL_PACK_SKIP_IMAGES_EXT", 0x806B },
689
   { "GL_PACK_IMAGE_HEIGHT_EXT", 0x806C },
690
   { "GL_UNPACK_SKIP_IMAGES_EXT", 0x806D },
691
   { "GL_UNPACK_IMAGE_HEIGHT_EXT", 0x806E },
692
   { "GL_TEXTURE_3D_EXT", 0x806F },
693
   { "GL_PROXY_TEXTURE_3D_EXT", 0x8070 },
694
   { "GL_TEXTURE_DEPTH_EXT", 0x8071 },
695
   { "GL_TEXTURE_WRAP_R_EXT", 0x8072 },
696
   { "GL_MAX_3D_TEXTURE_SIZE_EXT", 0x8073 },
697
   { "GL_TEXTURE_3D_BINDING_EXT", 0x806A },
698
 
699
   { "GL_TABLE_TOO_LARGE_EXT", 0x8031 },
700
   { "GL_COLOR_TABLE_FORMAT_EXT", 0x80D8 },
701
   { "GL_COLOR_TABLE_WIDTH_EXT", 0x80D9 },
702
   { "GL_COLOR_TABLE_RED_SIZE_EXT", 0x80DA },
703
   { "GL_COLOR_TABLE_GREEN_SIZE_EXT", 0x80DB },
704
   { "GL_COLOR_TABLE_BLUE_SIZE_EXT", 0x80DC },
705
   { "GL_COLOR_TABLE_ALPHA_SIZE_EXT", 0x80DD },
706
   { "GL_COLOR_TABLE_LUMINANCE_SIZE_EXT", 0x80DE },
707
   { "GL_COLOR_TABLE_INTENSITY_SIZE_EXT", 0x80DF },
708
   { "GL_TEXTURE_INDEX_SIZE_EXT", 0x80ED },
709
   { "GL_COLOR_INDEX1_EXT", 0x80E2 },
710
   { "GL_COLOR_INDEX2_EXT", 0x80E3 },
711
   { "GL_COLOR_INDEX4_EXT", 0x80E4 },
712
   { "GL_COLOR_INDEX8_EXT", 0x80E5 },
713
   { "GL_COLOR_INDEX12_EXT", 0x80E6 },
714
   { "GL_COLOR_INDEX16_EXT", 0x80E7 },
715
 
716
   { "GL_SHARED_TEXTURE_PALETTE_EXT", 0x81FB },
717
 
718
   { "GL_POINT_SIZE_MIN_EXT", 0x8126 },
719
   { "GL_POINT_SIZE_MAX_EXT", 0x8127 },
720
   { "GL_POINT_FADE_THRESHOLD_SIZE_EXT", 0x8128 },
721
   { "GL_DISTANCE_ATTENUATION_EXT", 0x8129 },
722
 
723
   { "GL_RESCALE_NORMAL_EXT", 0x803A },
724
 
725
   { "GL_ABGR_EXT", 0x8000 },
726
 
727
   { "GL_INCR_WRAP_EXT", 0x8507 },
728
   { "GL_DECR_WRAP_EXT", 0x8508 },
729
 
730
   { "GL_CLAMP_TO_EDGE_SGIS", 0x812F },
731
 
732
   { "GL_BLEND_DST_RGB_INGR", 0x80C8 },
733
   { "GL_BLEND_SRC_RGB_INGR", 0x80C9 },
734
   { "GL_BLEND_DST_ALPHA_INGR", 0x80CA },
735
   { "GL_BLEND_SRC_ALPHA_INGR", 0x80CB },
736
 
737
   { "GL_RESCALE_NORMAL", 0x803A },
738
   { "GL_CLAMP_TO_EDGE", 0x812F },
739
   { "GL_MAX_ELEMENTS_VERTICES", 0xF0E8 },
740
   { "GL_MAX_ELEMENTS_INDICES", 0xF0E9 },
741
   { "GL_BGR", 0x80E0 },
742
   { "GL_BGRA", 0x80E1 },
743
   { "GL_UNSIGNED_BYTE_3_3_2", 0x8032 },
744
   { "GL_UNSIGNED_BYTE_2_3_3_REV", 0x8362 },
745
   { "GL_UNSIGNED_SHORT_5_6_5", 0x8363 },
746
   { "GL_UNSIGNED_SHORT_5_6_5_REV", 0x8364 },
747
   { "GL_UNSIGNED_SHORT_4_4_4_4", 0x8033 },
748
   { "GL_UNSIGNED_SHORT_4_4_4_4_REV", 0x8365 },
749
   { "GL_UNSIGNED_SHORT_5_5_5_1", 0x8034 },
750
   { "GL_UNSIGNED_SHORT_1_5_5_5_REV", 0x8366 },
751
   { "GL_UNSIGNED_INT_8_8_8_8", 0x8035 },
752
   { "GL_UNSIGNED_INT_8_8_8_8_REV", 0x8367 },
753
   { "GL_UNSIGNED_INT_10_10_10_2", 0x8036 },
754
   { "GL_UNSIGNED_INT_2_10_10_10_REV", 0x8368 },
755
   { "GL_LIGHT_MODEL_COLOR_CONTROL", 0x81F8 },
756
   { "GL_SINGLE_COLOR", 0x81F9 },
757
   { "GL_SEPARATE_SPECULAR_COLOR", 0x81FA },
758
   { "GL_TEXTURE_MIN_LOD", 0x813A },
759
   { "GL_TEXTURE_MAX_LOD", 0x813B },
760
   { "GL_TEXTURE_BASE_LEVEL", 0x813C },
761
   { "GL_TEXTURE_MAX_LEVEL", 0x813D },
762
 
763
   { "GL_TEXTURE0_ARB", 0x84C0 },
764
   { "GL_TEXTURE1_ARB", 0x84C1 },
765
   { "GL_TEXTURE2_ARB", 0x84C2 },
766
   { "GL_TEXTURE3_ARB", 0x84C3 },
767
   { "GL_ACTIVE_TEXTURE_ARB", 0x84E0 },
768
   { "GL_CLIENT_ACTIVE_TEXTURE_ARB", 0x84E1 },
769
   { "GL_MAX_TEXTURE_UNITS_ARB", 0x84E2 },
770
 
771
   { "GL_OCCLUSION_TEST_HP", 0x8165 },
772
   { "GL_OCCLUSION_TEST_RESULT_HP", 0x8166 },
773
 
774
   { "GL_TEXTURE_FILTER_CONTROL_EXT", 0x8500 },
775
   { "GL_TEXTUER_LOD_BIAS_EXT", 0x8501 },
776
 
777
   { "GL_NORMAL_MAP_NV", 0x8511 },
778
   { "GL_REFLECTION_MAP_NV", 0x8512 },
779
 
780
   { "GL_PREFER_DOUBLEBUFFER_HINT_PGI", 107000 },
781
   { "GL_STRICT_DEPTHFUNC_HINT_PGI", 107030 },
782
   { "GL_STRICT_LIGHTING_HINT_PGI", 107031 },
783
   { "GL_STRICT_SCISSOR_HINT_PGI", 107032 },
784
   { "GL_FULL_STIPPLE_HINT_PGI", 107033 },
785
   { "GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI", 107011 },
786
   { "GL_NATIVE_GRAPHICS_END_HINT_PGI", 107012 },
787
   { "GL_CONSERVE_MEMORY_HINT_PGI", 107005 },
788
   { "GL_RECLAIM_MEMORY_HINT_PGI", 107006 },
789
   { "GL_ALWAYS_FAST_HINT_PGI", 107020 },
790
   { "GL_ALWAYS_SOFT_HINT_PGI", 107021 },
791
   { "GL_ALLOW_DRAW_OBJ_HINT_PGI", 107022 },
792
   { "GL_ALLOW_DRAW_WIN_HINT_PGI", 107023 },
793
   { "GL_ALLOW_DRAW_FRG_HINT_PGI", 107024 },
794
   { "GL_ALLOW_DRAW_SPN_HINT_PGI", 107024 },
795
   { "GL_ALLOW_DRAW_MEM_HINT_PGI", 107025 },
796
   { "GL_CLIP_NEAR_HINT_PGI", 107040 },
797
   { "GL_CLIP_FAR_HINT_PGI", 107041 },
798
   { "GL_WIDE_LINE_HINT_PGI", 107042 },
799
   { "GL_BACK_NORMALS_HINT_PGI", 107043 },
800
   { "GL_NATIVE_GRAPHICS_HANDLE_PGI", 107010 },
801
 
802
   /* GL_EXT_compiled_vertex_array */
803
   { "GL_ARRAY_ELEMENT_LOCK_FIRST_EXT", 0x81A8},
804
   { "GL_ARRAY_ELEMENT_LOCK_COUNT_EXT", 0x81A9},
805
 
806
   /* GL_EXT_clip_volume_hint */
807
   { "GL_CLIP_VOLUME_CLIPPING_HINT_EXT", 0x80F0},
808
 
809
   /* GL_EXT_texture_env_combine */
810
   { "GL_COMBINE_EXT", 0x8570 },
811
   { "GL_COMBINE_RGB_EXT", 0x8571 },
812
   { "GL_COMBINE_ALPHA_EXT", 0x8572 },
813
   { "GL_SOURCE0_RGB_EXT", 0x8580 },
814
   { "GL_SOURCE1_RGB_EXT", 0x8581 },
815
   { "GL_SOURCE2_RGB_EXT", 0x8582 },
816
   { "GL_SOURCE0_ALPHA_EXT", 0x8588 },
817
   { "GL_SOURCE1_ALPHA_EXT", 0x8589 },
818
   { "GL_SOURCE2_ALPHA_EXT", 0x858A },
819
   { "GL_OPERAND0_RGB_EXT", 0x8590 },
820
   { "GL_OPERAND1_RGB_EXT", 0x8591 },
821
   { "GL_OPERAND2_RGB_EXT", 0x8592 },
822
   { "GL_OPERAND0_ALPHA_EXT", 0x8598 },
823
   { "GL_OPERAND1_ALPHA_EXT", 0x8599 },
824
   { "GL_OPERAND2_ALPHA_EXT", 0x859A },
825
   { "GL_RGB_SCALE_EXT", 0x8573 },
826
   { "GL_ADD_SIGNED_EXT", 0x8574 },
827
   { "GL_INTERPOLATE_EXT", 0x8575 },
828
   { "GL_CONSTANT_EXT", 0x8576 },
829
   { "GL_PRIMARY_COLOR_EXT", 0x8577 },
830
   { "GL_PREVIOUS_EXT", 0x8578 },
831
 
832
   /* GL_ARB_texture_env_combine */
833
   { "GL_SUBTRACT_ARB", 0x84E7 },
834
 
835
   /* GL_EXT_texture_env_dot3 */
836
   { "GL_DOT3_RGB_EXT", 0x8740 },
837
   { "GL_DOT3_RGBA_EXT", 0x8741 },
838
 
839
   /* GL_ARB_texture_env_dot3 */
840
   { "GL_DOT3_RGB_EXT", 0x86ae },
841
   { "GL_DOT3_RGBA_EXT", 0x86af },
842
 
843
   /* GL_ARB_texture_border_clamp */
844
   { "GL_CLAMP_TO_BORDER_ARB", 0x812D },
845
};
846
 
847
#define Elements(x) sizeof(x)/sizeof(*x)
848
 
849
typedef int (GLWINAPIV *cfunc)(const void *, const void *);
850
 
851
static enum_elt **index1 = 0;
852
static int sorted = 0;
853
 
854
static int compar_name( const enum_elt *a, const enum_elt *b )
855
{
856
   return _mesa_strcmp(a->c, b->c);
857
}
858
 
859
 
860
/* note the extra level of indirection
861
 */
862
static int compar_nr( const enum_elt **a, const enum_elt **b )
863
{
864
   return (*a)->n - (*b)->n;
865
}
866
 
867
 
868
static void sort_enums( void )
869
{
870
   GLuint i;
871
   index1 = (enum_elt **)MALLOC( Elements(all_enums) * sizeof(enum_elt *) );
872
   sorted = 1;
873
 
874
   if (!index1)
875
      return;  /* what else can we do? */
876
 
877
   qsort( all_enums, Elements(all_enums), sizeof(*all_enums),
878
          (cfunc) compar_name );
879
 
880
   for (i = 0 ; i < Elements(all_enums) ; i++)
881
      index1[i] = &all_enums[i];
882
 
883
   qsort( index1, Elements(all_enums), sizeof(*index1), (cfunc) compar_nr );
884
}
885
 
886
 
887
 
888
int _mesa_lookup_enum_by_name( const char *symbol )
889
{
890
   enum_elt tmp;
891
   enum_elt *e;
892
 
893
   if (!sorted)
894
      sort_enums();
895
 
896
   if (!symbol)
897
      return 0;
898
 
899
   tmp.c = symbol;
900
   e = (enum_elt *)bsearch( &tmp, all_enums, Elements(all_enums),
901
                            sizeof(*all_enums), (cfunc) compar_name );
902
 
903
   return e ? e->n : -1;
904
}
905
 
906
 
907
static char token_tmp[20];
908
 
909
const char *_mesa_lookup_enum_by_nr( int nr )
910
{
911
   enum_elt tmp, *e, **f;
912
 
913
   if (!sorted)
914
      sort_enums();
915
 
916
   tmp.n = nr;
917
   e = &tmp;
918
 
919
   f = (enum_elt **)bsearch( &e, index1, Elements(all_enums),
920
                             sizeof(*index1), (cfunc) compar_nr );
921
 
922
   if (f) {
923
      return (*f)->c;
924
   }
925
   else {
926
      /* this isn't re-entrant safe, no big deal here */
927
      _mesa_sprintf(token_tmp, "0x%x", nr);
928
      return token_tmp;
929
   }
930
}