This file is indexed.

/usr/share/pyshared/OpenGL/GL/glget.py is in python-opengl 3.0.1~b2-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
"""Implementation of the special "glGet" functions

For comparison, here's what a straightforward implementation looks like:

    def glGetDoublev( pname ):
        "Natural writing of glGetDoublev using standard ctypes"
        output = c_double*sizes.get( pname )
        result = output()
        result = platform.OpenGL.glGetDoublev( pname, byref(result) )
        return Numeric.array( result )
"""
from OpenGL import platform, arrays, error, wrapper, converters
from OpenGL.raw import GL as simple
import ctypes
GLenum = ctypes.c_uint
GLsize = GLsizei = ctypes.c_int

__all__ = (
    'glGetBoolean','glGetBooleanv','glGetInteger','glGetIntegerv',
    'glGetFloat','glGetFloatv','glGetDouble','glGetDoublev',
    'glGetString',
    'glGetLightfv','glGetLightiv',
    'glGetMaterialfv','glGetMaterialiv',
    'glGetPixelMapfv','glGetPixelMapusv','glGetPixelMapuiv',
    'glGetPolygonStipple', 'glGetPolygonStippleub',
    'glGetTexEnviv','glGetTexEnvfv',
    'glGetTexGenfv','glGetTexGeniv','glGetTexGendv',
    'glGetTexLevelParameteriv',
    'glGetTexLevelParameterfv',
    'glGetTexParameterfv',
    'glGetTexParameteriv',
)

glGetString = platform.OpenGL.glGetString
glGetString.restype = ctypes.c_char_p
glGetString.__doc__ = """glGetString( constant ) -> Current string value"""

GL_GET_SIZES = {
    simple.GL_ACCUM_ALPHA_BITS                      : (1,),                
    simple.GL_ACCUM_BLUE_BITS                       : (1,),                
    simple.GL_ACCUM_CLEAR_VALUE                     : (4,),                
    simple.GL_ACCUM_GREEN_BITS                      : (1,),                
    simple.GL_ACCUM_RED_BITS                        : (1,),                
    simple.GL_ACTIVE_TEXTURE                        : (1,),
    simple.GL_ACTIVE_TEXTURE_ARB                    : (1,),                
    simple.GL_ALIASED_LINE_WIDTH_RANGE              : (2,),                
    simple.GL_ALIASED_POINT_SIZE_RANGE              : (2,),                
    simple.GL_ALPHA_BIAS                            : (1,),                
    simple.GL_ALPHA_BITS                            : (1,),                
    simple.GL_ALPHA_SCALE                           : (1,),                
    simple.GL_ALPHA_TEST                            : (1,),                
    simple.GL_ALPHA_TEST_FUNC                       : (1,),                
    simple.GL_ALPHA_TEST_REF                        : (1,),                
    simple.GL_ARRAY_BUFFER_BINDING                  : (1,),
    simple.GL_ATTRIB_STACK_DEPTH                    : (1,),                
    simple.GL_AUTO_NORMAL                           : (1,),                
    simple.GL_AUX_BUFFERS                           : (1,),                
    simple.GL_BLEND                                 : (1,),                
    simple.GL_BLEND_COLOR                           : (4,),                
    simple.GL_BLEND_DST_ALPHA                       : (1,),                
    simple.GL_BLEND_DST_RGB                         : (1,),                
    simple.GL_BLEND_EQUATION_RGB                    : (1,),                
    simple.GL_BLEND_EQUATION_ALPHA                  : (1,),                
    simple.GL_BLEND_SRC_RGB                         : (1,),                
    simple.GL_BLEND_SRC_ALPHA                       : (1,),                
    simple.GL_BLUE_BIAS                             : (1,),                
    simple.GL_BLUE_BITS                             : (1,),                
    simple.GL_BLUE_SCALE                            : (1,),                
    simple.GL_CLIENT_ACTIVE_TEXTURE                 : (1,),                
    simple.GL_CLIENT_ACTIVE_TEXTURE_ARB             : (1,),                
    simple.GL_CLIENT_ATTRIB_STACK_DEPTH             : (1,),                
    simple.GL_CLIP_PLANE0                           : (1,),                
    simple.GL_CLIP_PLANE1                           : (1,),                
    simple.GL_CLIP_PLANE2                           : (1,),                
    simple.GL_CLIP_PLANE3                           : (1,),                
    simple.GL_CLIP_PLANE4                           : (1,),                
    simple.GL_CLIP_PLANE5                           : (1,),                
    simple.GL_COLOR_ARRAY                           : (1,),                
    simple.GL_COLOR_ARRAY_BUFFER_BINDING            : (1,),                
    simple.GL_COLOR_ARRAY_SIZE                      : (1,),                
    simple.GL_COLOR_ARRAY_STRIDE                    : (1,),                
    simple.GL_COLOR_ARRAY_TYPE                      : (1,),                
    simple.GL_COLOR_CLEAR_VALUE                     : (4,),                
    simple.GL_COLOR_LOGIC_OP                        : (1,),                
    simple.GL_COLOR_MATERIAL                        : (1,),                
    simple.GL_COLOR_MATERIAL_FACE                   : (1,),                
    simple.GL_COLOR_MATERIAL_PARAMETER              : (1,),                
    simple.GL_COLOR_MATRIX                          : (4, 4),              
    simple.GL_COLOR_MATRIX_STACK_DEPTH              : (1,),                
    simple.GL_COLOR_SUM                             : (1,),                
    simple.GL_COLOR_TABLE                           : (1,),                
    simple.GL_COLOR_WRITEMASK                       : (4,),                
    # TODO: this *requires* a lookup to determine how many will be returned...
    #simple.GL_COMPRESSED_TEXTURE_FORMATS            : (4,),
    simple.GL_CONVOLUTION_1D                        : (1,),                
    simple.GL_CONVOLUTION_2D                        : (1,),                
    simple.GL_CULL_FACE                             : (1,),                
    simple.GL_CULL_FACE_MODE                        : (1,),                
    simple.GL_CURRENT_COLOR                         : (4,),                
    simple.GL_CURRENT_INDEX                         : (1,),                
    simple.GL_CURRENT_NORMAL                        : (3,),                
    simple.GL_CURRENT_RASTER_COLOR                  : (4,),                
    simple.GL_CURRENT_RASTER_DISTANCE               : (1,),                
    simple.GL_CURRENT_RASTER_INDEX                  : (1,),                
    simple.GL_CURRENT_RASTER_POSITION               : (4,),                
    simple.GL_CURRENT_RASTER_POSITION_VALID         : (1,),                
    simple.GL_CURRENT_RASTER_TEXTURE_COORDS         : (4,),                
    simple.GL_CURRENT_SECONDARY_COLOR               : (4,),                
    simple.GL_CURRENT_TEXTURE_COORDS                : (4,),                
    simple.GL_DEPTH_BIAS                            : (1,),                
    simple.GL_DEPTH_BITS                            : (1,),                
    simple.GL_DEPTH_CLEAR_VALUE                     : (1,),                
    simple.GL_DEPTH_FUNC                            : (1,),                
    simple.GL_DEPTH_RANGE                           : (2,),                
    simple.GL_DEPTH_SCALE                           : (1,),                
    simple.GL_DEPTH_TEST                            : (1,),                
    simple.GL_DEPTH_WRITEMASK                       : (1,),                
    simple.GL_DITHER                                : (1,),                
    simple.GL_DOUBLEBUFFER                          : (1,),                
    simple.GL_DRAW_BUFFER                           : (1,),                
    simple.GL_EDGE_FLAG                             : (1,),                
    simple.GL_EDGE_FLAG_ARRAY                       : (1,),                
    simple.GL_EDGE_FLAG_ARRAY_BUFFER_BINDING        : (1,),
    simple.GL_EDGE_FLAG_ARRAY_STRIDE                : (1,),
    simple.GL_ELEMENT_ARRAY_BUFFER_BINDING          : (1,),
    simple.GL_FEEDBACK_BUFFER_SIZE                  : (1,),                
    simple.GL_FEEDBACK_BUFFER_TYPE                  : (1,),                
    simple.GL_FOG                                   : (1,),                
    simple.GL_FOG_COORD_ARRAY                       : (1,),
    simple.GL_FOG_COORD_ARRAY_BUFFER_BINDING        : (1,),
    simple.GL_FOG_COORD_ARRAY_STRIDE                : (1,),
    simple.GL_FOG_COORD_ARRAY_TYPE                  : (1,),
    simple.GL_FOG_COORD_SRC                         : (1,),
    simple.GL_FOG_COLOR                             : (4,),                
    simple.GL_FOG_DENSITY                           : (1,),                
    simple.GL_FOG_END                               : (1,),                
    simple.GL_FOG_HINT                              : (1,),                
    simple.GL_FOG_INDEX                             : (1,),                
    simple.GL_FOG_MODE                              : (1,),                
    simple.GL_FOG_START                             : (1,),
    simple.GL_FRAGMENT_SHADER_DERIVATIVE_HINT       : (1,),
    simple.GL_FRONT_FACE                            : (1,),                
    simple.GL_GENERATE_MIPMAP_HINT                  : (1,),
    simple.GL_GREEN_BIAS                            : (1,),                
    simple.GL_GREEN_BITS                            : (1,),                
    simple.GL_GREEN_SCALE                           : (1,),                
    simple.GL_HISTOGRAM                             : (1,),                
    simple.GL_INDEX_ARRAY                           : (1,),  
    simple.GL_INDEX_ARRAY_BUFFER_BINDING            : (1,),
    simple.GL_INDEX_ARRAY_STRIDE                    : (1,),                
    simple.GL_INDEX_ARRAY_TYPE                      : (1,),                
    simple.GL_INDEX_BITS                            : (1,),                
    simple.GL_INDEX_CLEAR_VALUE                     : (1,),                
    simple.GL_INDEX_LOGIC_OP                        : (1,),                
    simple.GL_INDEX_MODE                            : (1,),                
    simple.GL_INDEX_OFFSET                          : (1,),                
    simple.GL_INDEX_SHIFT                           : (1,),                
    simple.GL_INDEX_WRITEMASK                       : (1,),                
    simple.GL_LIGHT0                                : (1,),                
    simple.GL_LIGHT1                                : (1,),                
    simple.GL_LIGHT2                                : (1,),                
    simple.GL_LIGHT3                                : (1,),                
    simple.GL_LIGHT4                                : (1,),                
    simple.GL_LIGHT5                                : (1,),                
    simple.GL_LIGHT6                                : (1,),                
    simple.GL_LIGHT7                                : (1,),                
    simple.GL_LIGHTING                              : (1,),                
    simple.GL_LIGHT_MODEL_AMBIENT                   : (4,),                
    simple.GL_LIGHT_MODEL_COLOR_CONTROL             : (1,),                
    simple.GL_LIGHT_MODEL_LOCAL_VIEWER              : (1,),                
    simple.GL_LIGHT_MODEL_TWO_SIDE                  : (1,),                
    simple.GL_LINE_SMOOTH                           : (1,),                
    simple.GL_LINE_SMOOTH_HINT                      : (1,),                
    simple.GL_LINE_STIPPLE                          : (1,),                
    simple.GL_LINE_STIPPLE_PATTERN                  : (1,),                
    simple.GL_LINE_STIPPLE_REPEAT                   : (1,),                
    simple.GL_LINE_WIDTH                            : (1,),                
    simple.GL_LINE_WIDTH_GRANULARITY                : (1,),                
    simple.GL_LINE_WIDTH_RANGE                      : (2,),                
    simple.GL_LIST_BASE                             : (1,),                
    simple.GL_LIST_INDEX                            : (1,),                
    simple.GL_LIST_MODE                             : (1,),                
    simple.GL_LOGIC_OP_MODE                         : (1,),                
    simple.GL_MAP1_COLOR_4                          : (1,),                
    simple.GL_MAP1_GRID_DOMAIN                      : (2,),                
    simple.GL_MAP1_GRID_SEGMENTS                    : (1,),                
    simple.GL_MAP1_INDEX                            : (1,),                
    simple.GL_MAP1_NORMAL                           : (1,),                
    simple.GL_MAP1_TEXTURE_COORD_1                  : (1,),                
    simple.GL_MAP1_TEXTURE_COORD_2                  : (1,),                
    simple.GL_MAP1_TEXTURE_COORD_3                  : (1,),                
    simple.GL_MAP1_TEXTURE_COORD_4                  : (1,),                
    simple.GL_MAP1_VERTEX_3                         : (1,),                
    simple.GL_MAP1_VERTEX_4                         : (1,),                
    simple.GL_MAP2_COLOR_4                          : (1,),                
    simple.GL_MAP2_GRID_DOMAIN                      : (4,),                
    simple.GL_MAP2_GRID_SEGMENTS                    : (2,),                
    simple.GL_MAP2_INDEX                            : (1,),                
    simple.GL_MAP2_NORMAL                           : (1,),                
    simple.GL_MAP2_TEXTURE_COORD_1                  : (1,),                
    simple.GL_MAP2_TEXTURE_COORD_2                  : (1,),                
    simple.GL_MAP2_TEXTURE_COORD_3                  : (1,),                
    simple.GL_MAP2_TEXTURE_COORD_4                  : (1,),                
    simple.GL_MAP2_VERTEX_3                         : (1,),                
    simple.GL_MAP2_VERTEX_4                         : (1,),                
    simple.GL_MAP_COLOR                             : (1,),                
    simple.GL_MAP_STENCIL                           : (1,),                
    simple.GL_MATRIX_MODE                           : (1,),                
    simple.GL_MAX_3D_TEXTURE_SIZE                   : (1,),                
    simple.GL_MAX_ATTRIB_STACK_DEPTH                : (1,),                
    simple.GL_MAX_CLIENT_ATTRIB_STACK_DEPTH         : (1,),                
    simple.GL_MAX_CLIP_PLANES                       : (1,),                
    simple.GL_MAX_COLOR_MATRIX_STACK_DEPTH          : (1,),                
    simple.GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS      : (1,),
    simple.GL_MAX_CUBE_MAP_TEXTURE_SIZE             : (1,),
    simple.GL_MAX_DRAW_BUFFERS                      : (1,),
    simple.GL_MAX_ELEMENTS_INDICES                  : (1,),                
    simple.GL_MAX_ELEMENTS_VERTICES                 : (1,),                
    simple.GL_MAX_EVAL_ORDER                        : (1,),                
    simple.GL_MAX_LIGHTS                            : (1,),                
    simple.GL_MAX_LIST_NESTING                      : (1,),                
    simple.GL_MAX_MODELVIEW_STACK_DEPTH             : (1,),                
    simple.GL_MAX_NAME_STACK_DEPTH                  : (1,),                
    simple.GL_MAX_PIXEL_MAP_TABLE                   : (1,),                
    simple.GL_MAX_PROJECTION_STACK_DEPTH            : (1,),                
    simple.GL_MAX_TEXTURE_IMAGE_UNITS               : (1,),                
    simple.GL_MAX_TEXTURE_LOD_BIAS                  : (1,),
    simple.GL_MAX_TEXTURE_SIZE                      : (1,),                
    simple.GL_MAX_TEXTURE_STACK_DEPTH               : (1,),                
    simple.GL_MAX_TEXTURE_UNITS                     : (1,),                
    simple.GL_MAX_TEXTURE_UNITS_ARB                 : (1,),                
    simple.GL_MAX_VARYING_FLOATS                    : (1,),
    simple.GL_MAX_VERTEX_ATTRIBS                    : (1,),
    simple.GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS        : (1,),
    simple.GL_MAX_VERTEX_UNIFORM_COMPONENTS         : (1,),
    simple.GL_MAX_VIEWPORT_DIMS                     : (2,),                
    simple.GL_MINMAX                                : (1,),                
    simple.GL_MODELVIEW_MATRIX                      : (4, 4),              
    simple.GL_MODELVIEW_STACK_DEPTH                 : (1,),                
    simple.GL_NAME_STACK_DEPTH                      : (1,),                
    simple.GL_NORMALIZE                             : (1,),                
    simple.GL_NORMAL_ARRAY                          : (1,),                
    simple.GL_NORMAL_ARRAY_BUFFER_BINDING           : (1,),
    simple.GL_NORMAL_ARRAY_STRIDE                   : (1,),                
    simple.GL_NORMAL_ARRAY_TYPE                     : (1,),
    simple.GL_NORMALIZE                             : (1,),
    simple.GL_NUM_COMPRESSED_TEXTURE_FORMATS        : (1,),
    simple.GL_PACK_ALIGNMENT                        : (1,),                
    simple.GL_PACK_IMAGE_HEIGHT                     : (1,),                
    simple.GL_PACK_LSB_FIRST                        : (1,),                
    simple.GL_PACK_ROW_LENGTH                       : (1,),                
    simple.GL_PACK_SKIP_IMAGES                      : (1,),                
    simple.GL_PACK_SKIP_PIXELS                      : (1,),                
    simple.GL_PACK_SKIP_ROWS                        : (1,),                
    simple.GL_PACK_SWAP_BYTES                       : (1,),                
    simple.GL_PERSPECTIVE_CORRECTION_HINT           : (1,),                
    simple.GL_PIXEL_MAP_A_TO_A_SIZE                 : (1,),                
    simple.GL_PIXEL_MAP_B_TO_B_SIZE                 : (1,),                
    simple.GL_PIXEL_MAP_G_TO_G_SIZE                 : (1,),                
    simple.GL_PIXEL_MAP_I_TO_A_SIZE                 : (1,),                
    simple.GL_PIXEL_MAP_I_TO_B_SIZE                 : (1,),                
    simple.GL_PIXEL_MAP_I_TO_G_SIZE                 : (1,),                
    simple.GL_PIXEL_MAP_I_TO_I_SIZE                 : (1,),                
    simple.GL_PIXEL_MAP_I_TO_R_SIZE                 : (1,),                
    simple.GL_PIXEL_MAP_R_TO_R_SIZE                 : (1,),                
    simple.GL_PIXEL_MAP_S_TO_S_SIZE                 : (1,),                
    simple.GL_PIXEL_PACK_BUFFER_BINDING_ARB         : (1,),
    simple.GL_PIXEL_UNPACK_BUFFER_BINDING_ARB       : (1,),
    simple.GL_POINT_DISTANCE_ATTENUATION            : (3,),
    simple.GL_POINT_FADE_THRESHOLD_SIZE             : (1,),
    simple.GL_POINT_SIZE                            : (1,),                
    simple.GL_POINT_SIZE_GRANULARITY                : (1,),                
    simple.GL_POINT_SIZE_MAX                        : (1,),
    simple.GL_POINT_SIZE_MIN                        : (1,),
    simple.GL_POINT_SIZE_RANGE                      : (2,),                
    simple.GL_POINT_SMOOTH                          : (1,),                
    simple.GL_POINT_SMOOTH_HINT                     : (1,),                
    simple.GL_POLYGON_MODE                          : (2,),                
    simple.GL_POLYGON_OFFSET_FACTOR                 : (1,),                
    simple.GL_POLYGON_OFFSET_FILL                   : (1,),                
    simple.GL_POLYGON_OFFSET_LINE                   : (1,),                
    simple.GL_POLYGON_OFFSET_POINT                  : (1,),                
    simple.GL_POLYGON_OFFSET_UNITS                  : (1,),                
    simple.GL_POLYGON_SMOOTH                        : (1,),                
    simple.GL_POLYGON_SMOOTH_HINT                   : (1,),                
    simple.GL_POLYGON_STIPPLE                       : (1,),
    simple.GL_POST_COLOR_MATRIX_ALPHA_BIAS          : (1,),                
    simple.GL_POST_COLOR_MATRIX_ALPHA_SCALE         : (1,),                
    simple.GL_POST_COLOR_MATRIX_BLUE_BIAS           : (1,),                
    simple.GL_POST_COLOR_MATRIX_BLUE_SCALE          : (1,),                
    simple.GL_POST_COLOR_MATRIX_COLOR_TABLE         : (1,),                
    simple.GL_POST_COLOR_MATRIX_GREEN_BIAS          : (1,),                
    simple.GL_POST_COLOR_MATRIX_GREEN_SCALE         : (1,),                
    simple.GL_POST_COLOR_MATRIX_RED_BIAS            : (1,),                
    simple.GL_POST_COLOR_MATRIX_RED_SCALE           : (1,),                
    simple.GL_POST_CONVOLUTION_ALPHA_BIAS           : (1,),                
    simple.GL_POST_CONVOLUTION_ALPHA_SCALE          : (1,),                
    simple.GL_POST_CONVOLUTION_BLUE_BIAS            : (1,),                
    simple.GL_POST_CONVOLUTION_BLUE_SCALE           : (1,),                
    simple.GL_POST_CONVOLUTION_COLOR_TABLE          : (1,),                
    simple.GL_POST_CONVOLUTION_GREEN_BIAS           : (1,),                
    simple.GL_POST_CONVOLUTION_GREEN_SCALE          : (1,),                
    simple.GL_POST_CONVOLUTION_RED_BIAS             : (1,),                
    simple.GL_POST_CONVOLUTION_RED_SCALE            : (1,),                
    simple.GL_PROJECTION_MATRIX                     : (4, 4),              
    simple.GL_PROJECTION_STACK_DEPTH                : (1,),                
    simple.GL_READ_BUFFER                           : (1,),                
    simple.GL_RED_BIAS                              : (1,),                
    simple.GL_RED_BITS                              : (1,),                
    simple.GL_RED_SCALE                             : (1,),                
    simple.GL_RENDER_MODE                           : (1,),                
    simple.GL_RESCALE_NORMAL                        : (1,),                
    simple.GL_RGBA_MODE                             : (1,),                
    simple.GL_SAMPLE_BUFFERS                        : (1,),
    simple.GL_SAMPLE_COVERAGE_VALUE                 : (1,),
    simple.GL_SAMPLE_COVERAGE_INVERT                : (1,),
    simple.GL_SAMPLES                               : (1,),
    simple.GL_SCISSOR_BOX                           : (4,),                
    simple.GL_SCISSOR_TEST                          : (1,),                
    simple.GL_SECONDARY_COLOR_ARRAY                 : (1,),
    simple.GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING  : (1,),
    simple.GL_SECONDARY_COLOR_ARRAY_SIZE            : (1,),
    simple.GL_SECONDARY_COLOR_ARRAY_STRIDE          : (1,),
    simple.GL_SECONDARY_COLOR_ARRAY_TYPE            : (1,),
    simple.GL_SELECTION_BUFFER_SIZE                 : (1,),                
    simple.GL_SEPARABLE_2D                          : (1,),                
    simple.GL_SHADE_MODEL                           : (1,),
    simple.GL_SMOOTH_LINE_WIDTH_RANGE               : (1,),
    simple.GL_SMOOTH_LINE_WIDTH_GRANULARITY         : (1,),
    simple.GL_SMOOTH_POINT_SIZE_RANGE               : (2,),
    simple.GL_SMOOTH_POINT_SIZE_GRANULARITY         : (1,),
    simple.GL_STENCIL_BACK_FAIL                     : (1,),
    simple.GL_STENCIL_BACK_FUNC                     : (1,),
    simple.GL_STENCIL_BACK_PASS_DEPTH_FAIL          : (1,),
    simple.GL_STENCIL_BACK_PASS_DEPTH_PASS          : (1,),
    simple.GL_STENCIL_BACK_REF                      : (1,),
    simple.GL_STENCIL_BACK_VALUE_MASK               : (1,),
    simple.GL_STENCIL_BACK_WRITEMASK                : (1,),
    simple.GL_STENCIL_BITS                          : (1,),                
    simple.GL_STENCIL_CLEAR_VALUE                   : (1,),                
    simple.GL_STENCIL_FAIL                          : (1,),                
    simple.GL_STENCIL_FUNC                          : (1,),                
    simple.GL_STENCIL_PASS_DEPTH_FAIL               : (1,),                
    simple.GL_STENCIL_PASS_DEPTH_PASS               : (1,),                
    simple.GL_STENCIL_REF                           : (1,),                
    simple.GL_STENCIL_TEST                          : (1,),                
    simple.GL_STENCIL_VALUE_MASK                    : (1,),                
    simple.GL_STENCIL_WRITEMASK                     : (1,),                
    simple.GL_STEREO                                : (1,),                
    simple.GL_SUBPIXEL_BITS                         : (1,),
    simple.GL_TEXTURE_1D                            : (1,),
    simple.GL_TEXTURE_2D                            : (1,),
    simple.GL_TEXTURE_3D                            : (1,),
    simple.GL_TEXTURE_CUBE_MAP                      : (1,),
    simple.GL_TEXTURE_BINDING_1D                    : (1,),
    simple.GL_TEXTURE_BINDING_2D                    : (1,),
    simple.GL_TEXTURE_BINDING_3D                    : (1,),
    simple.GL_TEXTURE_BINDING_CUBE_MAP              : (1,),
    simple.GL_TEXTURE_COMPRESSION_HINT              : (1,),
    simple.GL_TEXTURE_COORD_ARRAY                   : (1,),
    simple.GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING    : (1,),
    simple.GL_TEXTURE_COORD_ARRAY_SIZE              : (1,),
    simple.GL_TEXTURE_COORD_ARRAY_STRIDE            : (1,),
    simple.GL_TEXTURE_COORD_ARRAY_TYPE              : (1,),
    simple.GL_TEXTURE_GEN_Q                         : (1,),
    simple.GL_TEXTURE_GEN_R                         : (1,),
    simple.GL_TEXTURE_GEN_S                         : (1,),
    simple.GL_TEXTURE_GEN_T                         : (1,),
    simple.GL_TEXTURE_MATRIX                        : (4, 4),
    simple.GL_TEXTURE_STACK_DEPTH                   : (1,),
    simple.GL_TRANSPOSE_COLOR_MATRIX                : (4,4),
    simple.GL_TRANSPOSE_MODELVIEW_MATRIX            : (4,4),
    simple.GL_TRANSPOSE_PROJECTION_MATRIX           : (4,4),
    simple.GL_TRANSPOSE_TEXTURE_MATRIX              : (4,4),
    simple.GL_UNPACK_ALIGNMENT                      : (1,),
    simple.GL_UNPACK_IMAGE_HEIGHT                   : (1,),
    simple.GL_UNPACK_LSB_FIRST                      : (1,),
    simple.GL_UNPACK_ROW_LENGTH                     : (1,),
    simple.GL_UNPACK_SKIP_IMAGES                    : (1,),
    simple.GL_UNPACK_SKIP_PIXELS                    : (1,),
    simple.GL_UNPACK_SKIP_ROWS                      : (1,),
    simple.GL_UNPACK_SWAP_BYTES                     : (1,),
    simple.GL_VERTEX_ARRAY                          : (1,),
    simple.GL_VERTEX_ARRAY_BUFFER_BINDING           : (1,),
    simple.GL_VERTEX_ARRAY_SIZE                     : (1,),
    simple.GL_VERTEX_ARRAY_STRIDE                   : (1,),
    simple.GL_VERTEX_ARRAY_TYPE                     : (1,),
    simple.GL_VERTEX_PROGRAM_POINT_SIZE             : (1,),
    simple.GL_VERTEX_PROGRAM_TWO_SIDE               : (1,),
    simple.GL_VIEWPORT                              : (4,),
    simple.GL_ZOOM_X                                : (1,),
    simple.GL_ZOOM_Y                                : (1,),
    
    # Constants beyond OpenGL 2.1 (see src/find_glget_constants.py)...
    # Note: there are more, this is just what *my* hardware can find...
    simple.GL_ARRAY_ELEMENT_LOCK_COUNT_EXT: (1,),
    simple.GL_ARRAY_ELEMENT_LOCK_FIRST_EXT: (1,),
    simple.GL_BLEND_DST: (1,),
    simple.GL_BLEND_SRC: (1,),
    simple.GL_CLAMP_FRAGMENT_COLOR_ARB: (1,),
    simple.GL_CLAMP_READ_COLOR_ARB: (1,),
    simple.GL_CLAMP_VERTEX_COLOR_ARB: (1,),
    simple.GL_COLOR_ALPHA_PAIRING_ATI: (1,),
    simple.GL_COLOR_ARRAY_COUNT_EXT: (1,),
    simple.GL_COMPRESSED_TEXTURE_FORMATS: (1,),
    simple.GL_COMPRESSED_TEXTURE_FORMATS_ARB: (1,),
    simple.GL_CURRENT_FOG_COORDINATE: (1,),
    simple.GL_CURRENT_FOG_COORDINATE: (1,),
    simple.GL_CURRENT_FOG_COORDINATE_EXT: (1,),
    simple.GL_CURRENT_MATRIX_ARB: (4, 4),
    simple.GL_CURRENT_MATRIX_NV: (4, 4),
    simple.GL_CURRENT_MATRIX_STACK_DEPTH_ARB: (1,),
    simple.GL_CURRENT_MATRIX_STACK_DEPTH_NV: (1,),
    simple.GL_CURRENT_PROGRAM: (1,),
    simple.GL_DRAW_BUFFER0: (1,),
    simple.GL_DRAW_BUFFER0_ARB: (1,),
    simple.GL_DRAW_BUFFER0_ATI: (1,),
    simple.GL_DRAW_BUFFER1: (1,),
    simple.GL_DRAW_BUFFER10: (1,),
    simple.GL_DRAW_BUFFER10_ARB: (1,),
    simple.GL_DRAW_BUFFER10_ATI: (1,),
    simple.GL_DRAW_BUFFER11: (1,),
    simple.GL_DRAW_BUFFER11_ARB: (1,),
    simple.GL_DRAW_BUFFER11_ATI: (1,),
    simple.GL_DRAW_BUFFER12: (1,),
    simple.GL_DRAW_BUFFER12_ARB: (1,),
    simple.GL_DRAW_BUFFER12_ATI: (1,),
    simple.GL_DRAW_BUFFER13: (1,),
    simple.GL_DRAW_BUFFER13_ARB: (1,),
    simple.GL_DRAW_BUFFER13_ATI: (1,),
    simple.GL_DRAW_BUFFER14: (1,),
    simple.GL_DRAW_BUFFER14_ARB: (1,),
    simple.GL_DRAW_BUFFER14_ATI: (1,),
    simple.GL_DRAW_BUFFER15: (1,),
    simple.GL_DRAW_BUFFER15_ARB: (1,),
    simple.GL_DRAW_BUFFER15_ATI: (1,),
    simple.GL_DRAW_BUFFER1_ARB: (1,),
    simple.GL_DRAW_BUFFER1_ATI: (1,),
    simple.GL_DRAW_BUFFER2: (1,),
    simple.GL_DRAW_BUFFER2_ARB: (1,),
    simple.GL_DRAW_BUFFER2_ATI: (1,),
    simple.GL_DRAW_BUFFER3: (1,),
    simple.GL_DRAW_BUFFER3_ARB: (1,),
    simple.GL_DRAW_BUFFER3_ATI: (1,),
    simple.GL_DRAW_BUFFER4: (1,),
    simple.GL_DRAW_BUFFER4_ARB: (1,),
    simple.GL_DRAW_BUFFER4_ATI: (1,),
    simple.GL_DRAW_BUFFER5: (1,),
    simple.GL_DRAW_BUFFER5_ARB: (1,),
    simple.GL_DRAW_BUFFER5_ATI: (1,),
    simple.GL_DRAW_BUFFER6: (1,),
    simple.GL_DRAW_BUFFER6_ARB: (1,),
    simple.GL_DRAW_BUFFER6_ATI: (1,),
    simple.GL_DRAW_BUFFER7: (1,),
    simple.GL_DRAW_BUFFER7_ARB: (1,),
    simple.GL_DRAW_BUFFER7_ATI: (1,),
    simple.GL_DRAW_BUFFER8: (1,),
    simple.GL_DRAW_BUFFER8_ARB: (1,),
    simple.GL_DRAW_BUFFER8_ATI: (1,),
    simple.GL_DRAW_BUFFER9: (1,),
    simple.GL_DRAW_BUFFER9_ARB: (1,),
    simple.GL_DRAW_BUFFER9_ATI: (1,),
    simple.GL_EDGE_FLAG_ARRAY_COUNT_EXT: (1,),
    simple.GL_FRAGMENT_PROGRAM_ARB: (1,),
    simple.GL_FRAGMENT_SHADER_ATI: (1,),
    simple.GL_FRAMEBUFFER_BINDING_EXT: (1,),
    simple.GL_INDEX_ARRAY_COUNT_EXT: (1,),
    simple.GL_MAX_COLOR_ATTACHMENTS_EXT: (1,),
    simple.GL_MAX_FRAGMENT_UNIFORM_COMPONENTS: (1,),
    simple.GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB: (1,),
    simple.GL_MAX_PROGRAM_MATRICES_ARB: (1,),
    simple.GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB: (1,),
    simple.GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB: (1,),
    simple.GL_MAX_RECTANGLE_TEXTURE_SIZE_NV: (1,),
    simple.GL_MAX_RENDERBUFFER_SIZE_EXT: (1,),
    simple.GL_MAX_TEXTURE_COORDS: (1,),
    simple.GL_MAX_TEXTURE_COORDS_ARB: (1,),
    simple.GL_MAX_TEXTURE_COORDS_NV: (1,),
    simple.GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT: (1,),
    simple.GL_MAX_TRACK_MATRICES_NV: (1,),
    simple.GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV: (1,),
    simple.GL_MULTISAMPLE: (1,),
    simple.GL_MULTISAMPLE_ARB: (1,),
    simple.GL_MULTISAMPLE_EXT: (1,),
    simple.GL_MULTISAMPLE_SGIS: (1,),
    simple.GL_NORMAL_ARRAY_COUNT_EXT: (1,),
    simple.GL_NUM_FRAGMENT_CONSTANTS_ATI: (1,),
    simple.GL_NUM_FRAGMENT_REGISTERS_ATI: (1,),
    simple.GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI: (1,),
    simple.GL_NUM_INSTRUCTIONS_PER_PASS_ATI: (1,),
    simple.GL_NUM_INSTRUCTIONS_TOTAL_ATI: (1,),
    simple.GL_NUM_LOOPBACK_COMPONENTS_ATI: (1,),
    simple.GL_NUM_PASSES_ATI: (1,),
    simple.GL_PIXEL_COUNTER_BITS_NV: (1,),
    simple.GL_POINT_SPRITE: (1,),
    simple.GL_POINT_SPRITE_ARB: (1,),
    simple.GL_POINT_SPRITE_COORD_ORIGIN: (1,),
    simple.GL_POINT_SPRITE_NV: (1,),
    simple.GL_PRIMITIVE_RESTART_INDEX_NV: (1,),
    simple.GL_PRIMITIVE_RESTART_NV: (1,),
    simple.GL_PROGRAM_ERROR_POSITION_ARB: (1,),
    simple.GL_PROGRAM_ERROR_POSITION_NV: (1,),
    simple.GL_QUERY_COUNTER_BITS: (1,),
    simple.GL_QUERY_COUNTER_BITS_ARB: (1,),
    simple.GL_RENDERBUFFER_BINDING_EXT: (1,),
    simple.GL_RGBA_FLOAT_MODE_ARB: (1,),
    simple.GL_SAMPLE_ALPHA_TO_COVERAGE: (1,),
    simple.GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: (1,),
    simple.GL_SAMPLE_ALPHA_TO_MASK_EXT: (1,),
    simple.GL_SAMPLE_ALPHA_TO_MASK_SGIS: (1,),
    simple.GL_SAMPLE_ALPHA_TO_ONE: (1,),
    simple.GL_SAMPLE_ALPHA_TO_ONE_ARB: (1,),
    simple.GL_SAMPLE_ALPHA_TO_ONE_EXT: (1,),
    simple.GL_SAMPLE_ALPHA_TO_ONE_SGIS: (1,),
    simple.GL_SAMPLE_COVERAGE: (1,),
    simple.GL_SAMPLE_COVERAGE_ARB: (1,),
    simple.GL_SAMPLE_MASK_EXT: (1,),
    simple.GL_SAMPLE_MASK_SGIS: (1,),
    simple.GL_TEXTURE_BINDING_RECTANGLE_ARB: (1,),
    simple.GL_TEXTURE_BINDING_RECTANGLE_NV: (1,),
    simple.GL_TEXTURE_COORD_ARRAY_COUNT_EXT: (1,),
    simple.GL_TEXTURE_RECTANGLE_ARB: (1,),
    simple.GL_TEXTURE_RECTANGLE_NV: (1,),
    simple.GL_TRANSPOSE_CURRENT_MATRIX_ARB: (4, 4),
    simple.GL_TYPE_RGBA_FLOAT_ATI: (1,),
    simple.GL_UNPACK_CLIENT_STORAGE_APPLE: (1,),
    simple.GL_VERTEX_ARRAY_BINDING_APPLE: (1,),
    simple.GL_VERTEX_ARRAY_COUNT_EXT: (1,),
    simple.GL_VERTEX_PROGRAM_ARB: (1,),
    simple.GL_VERTEX_PROGRAM_NV: (1,),
    simple.GL_VERTEX_SHADER_EXT: (1,),
}
def addGLGetConstant( constant, arraySize ):
    """Add a glGet* constant to return an output array of correct size"""
    GL_GET_SIZES[ constant ] = arraySize
glGetDouble = glGetDoublev = wrapper.wrapper(simple.glGetDoublev).setOutput(
    "params",GL_GET_SIZES, "pname", 
)
glGetFloat = glGetFloatv = wrapper.wrapper(simple.glGetFloatv).setOutput(
    "params",GL_GET_SIZES, "pname", 
)
glGetBoolean = glGetBooleanv = glGetInteger = glGetIntegerv = wrapper.wrapper(simple.glGetIntegerv).setOutput(
    "params",GL_GET_SIZES, "pname", 
)

GL_GET_LIGHT_SIZES = {
    # glGetLightXv
    simple.GL_AMBIENT                               : (4,),
    simple.GL_DIFFUSE                               : (4,),
    simple.GL_SPECULAR                              : (4,),
    simple.GL_POSITION                              : (4,),
    simple.GL_SPOT_DIRECTION                        : (3,),
    simple.GL_SPOT_EXPONENT                         : (1,),
    simple.GL_SPOT_CUTOFF                           : (1,),
    simple.GL_CONSTANT_ATTENUATION                  : (1,),
    simple.GL_LINEAR_ATTENUATION                    : (1,),
    simple.GL_QUADRATIC_ATTENUATION                 : (1,),
} # end of sizes
glGetLightfv = wrapper.wrapper(simple.glGetLightfv).setOutput(
    "params",GL_GET_LIGHT_SIZES, "pname", 
)
glGetLightiv = wrapper.wrapper(simple.glGetLightiv).setOutput(
    "params",GL_GET_LIGHT_SIZES, "pname", 
)

GL_GET_MATERIAL_SIZES = {
    simple.GL_AMBIENT: (4,),
    simple.GL_DIFFUSE: (4,),
    simple.GL_SPECULAR: (4,),
    simple.GL_EMISSION: (4,),
    simple.GL_SHININESS: (1,),
    simple.GL_COLOR_INDEXES: (3,)
}
glGetMaterialfv = wrapper.wrapper(simple.glGetMaterialfv).setOutput(
    "params",GL_GET_MATERIAL_SIZES, "pname", 
)
glGetMaterialiv = wrapper.wrapper(simple.glGetMaterialiv).setOutput(
    "params",GL_GET_MATERIAL_SIZES, "pname", 
)
PIXEL_MAP_SIZE_CONSTANT_MAP = {
    simple.GL_PIXEL_MAP_A_TO_A: simple.GL_PIXEL_MAP_A_TO_A_SIZE,
    simple.GL_PIXEL_MAP_B_TO_B: simple.GL_PIXEL_MAP_B_TO_B_SIZE,
    simple.GL_PIXEL_MAP_G_TO_G: simple.GL_PIXEL_MAP_G_TO_G_SIZE,
    simple.GL_PIXEL_MAP_I_TO_A: simple.GL_PIXEL_MAP_I_TO_A_SIZE,
    simple.GL_PIXEL_MAP_I_TO_B: simple.GL_PIXEL_MAP_I_TO_B_SIZE,
    simple.GL_PIXEL_MAP_I_TO_G: simple.GL_PIXEL_MAP_I_TO_G_SIZE,
    simple.GL_PIXEL_MAP_I_TO_I: simple.GL_PIXEL_MAP_I_TO_I_SIZE,
    simple.GL_PIXEL_MAP_I_TO_R: simple.GL_PIXEL_MAP_I_TO_R_SIZE,
    simple.GL_PIXEL_MAP_R_TO_R: simple.GL_PIXEL_MAP_R_TO_R_SIZE,
    simple.GL_PIXEL_MAP_S_TO_S: simple.GL_PIXEL_MAP_S_TO_S_SIZE,
}
def GL_GET_PIXEL_MAP_SIZE( pname ):
    """Given a pname, lookup the size using a glGet query..."""
    constant = PIXEL_MAP_SIZE_CONSTANT_MAP[ pname ]
    return glGetIntegerv( constant )
glGetPixelMapfv = wrapper.wrapper(simple.glGetPixelMapfv).setOutput(
    "values",GL_GET_PIXEL_MAP_SIZE, "map", 
)
glGetPixelMapuiv = wrapper.wrapper(simple.glGetPixelMapuiv).setOutput(
    "values",GL_GET_PIXEL_MAP_SIZE, "map", 
)
glGetPixelMapusv = wrapper.wrapper(simple.glGetPixelMapusv).setOutput(
    "values",GL_GET_PIXEL_MAP_SIZE, "map", 
)

# 32 * 32 bits
POLYGON_STIPPLE_SIZE = (32*32//8,)
glGetPolygonStipple = glGetPolygonStippleub = wrapper.wrapper(simple.glGetPolygonStipple).setOutput(
    "mask",POLYGON_STIPPLE_SIZE, 
)
GL_GET_TEX_ENV_SIZES = {
    simple.GL_TEXTURE_ENV_MODE: (1,),
    simple.GL_TEXTURE_ENV_COLOR: (4,),
}
glGetTexEnvfv = wrapper.wrapper(simple.glGetTexEnvfv).setOutput(
    "params",GL_GET_TEX_ENV_SIZES, 'pname',  
)
glGetTexEnviv = wrapper.wrapper(simple.glGetTexEnviv).setOutput(
    "params",GL_GET_TEX_ENV_SIZES, 'pname',  
)
GL_GET_TEX_GEN_SIZES = {
    simple.GL_TEXTURE_GEN_MODE: (1,),
    simple.GL_OBJECT_PLANE: (4,),
    simple.GL_EYE_PLANE: (4,),
}
glGetTexGendv = wrapper.wrapper(simple.glGetTexGendv).setOutput(
    "params",GL_GET_TEX_GEN_SIZES, 'pname',  
)
glGetTexGenfv = wrapper.wrapper(simple.glGetTexGenfv).setOutput(
    "params",GL_GET_TEX_GEN_SIZES, 'pname',  
)
glGetTexGeniv = wrapper.wrapper(simple.glGetTexGeniv).setOutput(
    "params",GL_GET_TEX_GEN_SIZES, 'pname',  
)

glGetTexLevelParameterfv = wrapper.wrapper(simple.glGetTexLevelParameterfv).setOutput(
    "params",(1,)
)
glGetTexLevelParameteriv = wrapper.wrapper(simple.glGetTexLevelParameteriv).setOutput(
    "params",(1,)
)
TEX_PARAMETER_SIZES = {
    simple.GL_TEXTURE_MAG_FILTER: (1,),
    simple.GL_TEXTURE_MIN_FILTER: (1,), 
    simple.GL_TEXTURE_MIN_LOD: (1,),
    simple.GL_TEXTURE_MAX_LOD: (1,),
    simple.GL_TEXTURE_BASE_LEVEL: (1,),
    simple.GL_TEXTURE_MAX_LEVEL: (1,),
    simple.GL_TEXTURE_WRAP_S: (1,),
    simple.GL_TEXTURE_WRAP_T: (1,),
    simple.GL_TEXTURE_WRAP_R: (1,),
    simple.GL_TEXTURE_BORDER_COLOR: (4,), 
    simple.GL_TEXTURE_PRIORITY: (1,),
    simple.GL_TEXTURE_RESIDENT: (1,)
}

glGetTexParameterfv = wrapper.wrapper(simple.glGetTexParameterfv).setOutput(
    "params",TEX_PARAMETER_SIZES, 'pname',
)
glGetTexParameteriv = wrapper.wrapper(simple.glGetTexParameteriv).setOutput(
    "params",TEX_PARAMETER_SIZES, 'pname',
)