aboutsummaryrefslogtreecommitdiffstats
path: root/make/config/jogl/gl-common.cfg
blob: 8af080ec8041b51e9775048ad2aa951ca81d106b (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
# This .cfg file provides common options used among all glue code
# generated for Jogl on all platforms.

HierarchicalNativeOutput false

# Raise GLException instead of RuntimeException in glue code
RuntimeExceptionType GLException
UnsupportedExceptionType GLException

# Imports needed by all glue code
Import java.util.*
Import javax.media.opengl.*
Import javax.media.opengl.fixedfunc.*
Import jogamp.opengl.*

#####################################################################
# Mostly desktop OpenGL stuff below
#

# Don't output #defines of GL version identifier strings as constants, 
# because we don't need them java-side. 
Ignore GL_VERSION_.+

Ignore KHRONOS_.+

# Ignore GL functions that deal with explicit pointer values in such a
# way that we cannot implement the functionality in Java
Ignore glGetBufferPointerv
Ignore glGetBufferPointervARB
Ignore glGetBufferPointerivNV
Ignore glGetNamedBufferPointervEXT
Ignore glGetPointerv
Ignore glGetPointervEXT
Ignore glGetPointerIndexedvEXT
Ignore glGetTexParameterPointervAPPLE
Ignore glGetVertexAttribPointerv
Ignore glGetVertexAttribPointervARB
Ignore glGetVertexAttribPointervNV
Ignore glTracePointerRangeMESA 
Ignore glMultiDrawElementsBaseVertex
Ignore glDebugMessageCallbackARB
Ignore glDebugMessageCallbackAMD

# Manually implement glMapBuffer as the size of the returned buffer
# can only be computed by calling another routine
ManuallyImplement glMapBuffer
ForceProcAddressGen glMapBuffer

# Ignore the ATI_map_object_buffer extension for now unless someone
# claims they need it, as it will undoubtedly require a similar
# construct to glMapBuffer
Ignore glMapObjectBufferATI
Ignore glUnmapObjectBufferATI

# Ignore some GL functions that have outgoing void** parameters; we cannot yet deal with them
Ignore glGetVariantPointervEXT

# FIXME: these extensions require either a handle to a device context
# or take void** parameters or both. Until we think through the
# semantics of each of these individually we need to disable them.
# WGL_ARB_buffer_region
Ignore wglCreateBufferRegion
Ignore wglDeleteBufferRegion
Ignore wglSaveBufferRegion
Ignore wglRestoreBufferRegion
Ignore wglGetSyncValuesOML
Ignore wglGetMscRateOML
Ignore wglSwapBuffersMscOML
Ignore wglSwapLayerBuffersMscOML
Ignore wglWaitForMscOML
Ignore wglWaitForSbcOML
Ignore wglGetDigitalVideoParametersI3D
Ignore wglSetDigitalVideoParametersI3D
Ignore wglGetGammaTableParametersI3D
Ignore wglSetGammaTableParametersI3D
Ignore wglGetGammaTableI3D
Ignore wglSetGammaTableI3D
Ignore wglEnableGenlockI3D
Ignore wglDisableGenlockI3D
Ignore wglIsEnabledGenlockI3D
Ignore wglGenlockSourceI3D
Ignore wglGetGenlockSourceI3D
Ignore wglGenlockSourceEdgeI3D
Ignore wglGetGenlockSourceEdgeI3D
Ignore wglGenlockSampleRateI3D
Ignore wglGetGenlockSampleRateI3D
Ignore wglGenlockSourceDelayI3D
Ignore wglGetGenlockSourceDelayI3D
Ignore wglQueryGenlockMaxSourceDelayI3D
Ignore wglCreateImageBufferI3D
Ignore wglDestroyImageBufferI3D
Ignore wglAssociateImageBufferEventsI3D
Ignore wglReleaseImageBufferEventsI3D

#
# IgnoreExtension directives
#

# Ignore extensions requiring persistent pointer-to-pointer storage as
# there is no such thing as a direct "BufferBuffer"
IgnoreExtension GL_IBM_vertex_array_lists
IgnoreExtension GL_INTEL_parallel_arrays
IgnoreExtension GL_SUN_triangle_list

# Ignore extensions never approved by the ARB
IgnoreExtension GL_EXT_coordinate_frame

# Ignore discontinued extensions
IgnoreExtension GL_NV_element_array

# >>> OpenGL 1.1
# Ignore extensions subsumed in OpenGL 1.1 (from OpenGL 1.1 spec, Appendix C)
IgnoreExtension GL_EXT_vertex_array
IgnoreExtension GL_EXT_blend_logic_op
IgnoreExtension GL_EXT_copy_texture
IgnoreExtension GL_EXT_polygon_offset
IgnoreExtension GL_EXT_subtexture
IgnoreExtension GL_EXT_texture
IgnoreExtension GL_EXT_texture_object
# <<< OpenGL 1.1

# >>> OpenGL 1.2
# Ignore extensions subsumed in OpenGL 1.2 and 1.2.1 (from OpenGL 1.2.1 spec, Appendix D)
IgnoreExtension GL_EXT_bgra
IgnoreExtension GL_EXT_blend_color
IgnoreExtension GL_EXT_blend_minmax
IgnoreExtension GL_EXT_blend_subtract
IgnoreExtension GL_EXT_color_subtable
IgnoreExtension GL_EXT_convolution
IgnoreExtension GL_EXT_draw_range_elements
IgnoreExtension GL_EXT_histogram
IgnoreExtension GL_EXT_packed_pixels
# NOTE: also ignoring GL_EXT_paletted_texture because it appears that it was subsumed
# into the core even though that isn't stated explicitly in the spec
IgnoreExtension GL_EXT_paletted_texture
IgnoreExtension GL_EXT_rescale_normal
IgnoreExtension GL_EXT_separate_specular_color
IgnoreExtension GL_EXT_texture3D
IgnoreExtension GL_HP_convolution_border_modes
IgnoreExtension GL_SGI_color_matrix
IgnoreExtension GL_SGI_color_table
IgnoreExtension GL_SGIS_texture_edge_clamp
IgnoreExtension GL_SGIS_texture_lod
# <<< OpenGL 1.2

# >>> OpenGL 1.3
# Ignore extensions subsumed in OpenGL 1.3 (from OpenGL 1.3 spec, Appendix F)
IgnoreExtension GL_ARB_multisample
IgnoreExtension GL_ARB_multitexture
IgnoreExtension GL_ARB_texture_compression
IgnoreExtension GL_ARB_texture_cube_map
IgnoreExtension GL_ARB_texture_border_clamp
IgnoreExtension GL_ARB_texture_env_add
IgnoreExtension GL_ARB_texture_env_combine
IgnoreExtension GL_ARB_texture_env_dot3
IgnoreExtension GL_ARB_transpose_matrix
IgnoreExtension GL_EXT_texture_cube_map
IgnoreExtension GL_EXT_texture_env_add
IgnoreExtension GL_EXT_texture_env_combine
IgnoreExtension GL_EXT_texture_env_dot3
IgnoreExtension GL_SGIS_texture_border_clamp
# <<< OpenGL 1.3

# >>> OpenGL 1.4
# Ignore extensions subsumed in OpenGL 1.4 (from OpenGL 1.4 spec, Appendix G)
IgnoreExtension GL_ARB_depth_texture
IgnoreExtension GL_ARB_point_parameters
IgnoreExtension GL_ARB_shadow
IgnoreExtension GL_ARB_texture_env_crossbar
IgnoreExtension GL_ARB_texture_mirrored_repeat
IgnoreExtension GL_ARB_window_pos
IgnoreExtension GL_EXT_blend_func_separate
IgnoreExtension GL_EXT_fog_coord
IgnoreExtension GL_EXT_texture_lod_bias
IgnoreExtension GL_EXT_multi_draw_arrays
IgnoreExtension GL_EXT_secondary_color
IgnoreExtension GL_EXT_stencil_wrap
IgnoreExtension GL_NV_blend_square
IgnoreExtension GL_SGIS_generate_mipmap
# <<< OpenGL 1.4

# >>> OpenGL 1.5
# Ignore extensions subsumed in OpenGL 1.5 (from OpenGL 1.5 spec, Appendix H)
IgnoreExtension GL_ARB_occlusion_query
IgnoreExtension GL_ARB_vertex_buffer_object
IgnoreExtension GL_EXT_shadow_funcs
# <<< OpenGL 1.5

# >>> OpenGL 2.0
# Ignore extensions subsumed in OpenGL 2.0 (from OpenGL 2.0 spec, Appendix I)
# NOTE that GL_ARB_shader_objects is NOT ignored here, because the
# naming convention is too different for us to pick up the entry
# points automatically (e.g. glCreateShaderObjectARB was exposed as
# glCreateShader)
# IgnoreExtension GL_ARB_shader_objects
IgnoreExtension GL_ARB_vertex_shader
IgnoreExtension GL_ARB_fragment_shader
IgnoreExtension GL_ARB_texture_non_power_of_two
IgnoreExtension GL_ARB_point_sprite
IgnoreExtension GL_ARB_draw_buffers
IgnoreExtension GL_EXT_blend_equation_separate
# Don't ignore the following one since the entry point is different from anything in the core
# IgnoreExtension GL_EXT_stencil_two_side
# <<< OpenGL 2.0

# >>> OpenGL 2.1
# Ignore extensions subsumed in OpenGL 2.1 (from OpenGL 2.1 spec, Appendix J)
IgnoreExtension GL_ARB_pixel_buffer_object
IgnoreExtension GL_EXT_texture_sRGB
# <<< OpenGL 2.1

# >>> OpenGL 3.0
# Ignore/Rename extensions subsumed in OpenGL 3.0 (from OpenGL 3.0 spec, Appendix N)
RenameExtensionIntoCore GL_EXT_gpu_shader4

RenameExtensionIntoCore GL_NV_conditional_render

RenameExtensionIntoCore GL_APPLE_flush_buffer_range

RenameExtensionIntoCore GL_ARB_color_buffer_float
# gl.h uses GL_ARB_depth_buffer_float
RenameExtensionIntoCore GL_ARB_depth_buffer_float
IgnoreExtension GL_NV_depth_buffer_float
RenameExtensionIntoCore GL_ARB_texture_float
RenameExtensionIntoCore GL_EXT_packed_float
RenameExtensionIntoCore GL_EXT_texture_shared_exponent

# gl.h uses GL_ARB_framebuffer_object
RenameExtensionIntoCore GL_ARB_framebuffer_object
IgnoreExtension GL_EXT_framebuffer_object

RenameExtensionIntoCore GL_NV_half_float
RenameExtensionIntoCore GL_ARB_half_float_pixel

# naming collision w/ GL_EXT_multisampled_render_to_texture, but included anyways
# RenameExtensionIntoCore GL_EXT_framebuffer_multisample 
IgnoreExtension GL_EXT_framebuffer_multisample 
RenameExtensionIntoCore GL_EXT_framebuffer_blit

#Big gap of promoted tokens and functions: GL_EXT_texture_integer
RenameExtensionIntoCore GL_EXT_texture_integer

RenameExtensionIntoCore GL_EXT_texture_array

RenameExtensionIntoCore GL_EXT_packed_depth_stencil

RenameExtensionIntoCore GL_EXT_draw_buffers2

# gl.h uses GL_ARB_texture_compression_rgtc
RenameExtensionIntoCore GL_ARB_texture_compression_rgtc
IgnoreExtension GL_EXT_texture_compression_rgtc

RenameExtensionIntoCore GL_EXT_transform_feedback
IgnoreExtension GL_NV_transform_feedback

# gl.h uses GL_ARB_vertex_array_object
RenameExtensionIntoCore GL_ARB_vertex_array_object
IgnoreExtension GL_APPLE_vertex_array_object

# gl.h uses GL_ARB_framebuffer_sRGB
RenameExtensionIntoCore GL_ARB_framebuffer_sRGB
IgnoreExtension GL_EXT_framebuffer_sRGB

RenameExtensionIntoCore GL_ARB_map_buffer_range

# <<< OpenGL 3.0

# >>> OpenGL 3.1
# Rename extension suffices (if exist) subsumed in OpenGL 3.1 (from OpenGL 3.1 spec, Appendix G.1)
# We alias 3.1 subsumed extension even for GL2, due to the convenience of the common GL2GL3 profile!
RenameExtensionIntoCore GL_ARB_draw_instanced
IgnoreExtension GL_EXT_draw_instanced
RenameExtensionIntoCore GL_ARB_copy_buffer
# Does not match the common namespace GL_NV_primitive_restart
RenameExtensionIntoCore GL_ARB_texture_buffer_object
IgnoreExtension GL_EXT_texture_buffer_object
# We rename EXT_texture_rectangle into core, so ARB_texture_rectangle will stay for convenience
RenameExtensionIntoCore GL_EXT_texture_rectangle
IgnoreExtension GL_NV_texture_rectangle
RenameExtensionIntoCore GL_ARB_uniform_buffer_object
# <<< OpenGL 3.1

# >>> OpenGL 3.2
# Rename extension suffices (if exist) subsumed in OpenGL 3.2 (from OpenGL 3.2 spec, Appendix H.1)
RenameExtensionIntoCore GL_ARB_vertex_array_bgra
RenameExtensionIntoCore GL_ARB_draw_elements_base_vertex
RenameExtensionIntoCore GL_ARB_fragment_coord_conventions
RenameExtensionIntoCore GL_ARB_provoking_vertex
RenameExtensionIntoCore GL_ARB_seamless_cube_map
RenameExtensionIntoCore GL_ARB_texture_multisample
RenameExtensionIntoCore GL_ARB_depth_clamp
# GL_ARB_geometry_shader4 is subsumed but values/namespace is orthogonal
IgnoreExtension GL_EXT_geometry_shader4
RenameExtensionIntoCore GL_ARB_sync
# <<< OpenGL 3.2

# >>> OpenGL 3.3
# Rename extension suffices (if exist) subsumed in OpenGL 3.3 (from OpenGL 3.3 spec, Appendix I.1)
RenameExtensionIntoCore GL_ARB_shader_bit_encoding
RenameExtensionIntoCore GL_ARB_blend_func_extended
RenameExtensionIntoCore GL_ARB_explicit_attrib_location
RenameExtensionIntoCore GL_ARB_occlusion_query2
RenameExtensionIntoCore GL_ARB_sampler_objects
RenameExtensionIntoCore GL_ARB_texture_rgb10_a2ui
RenameExtensionIntoCore GL_ARB_texture_swizzle
RenameExtensionIntoCore GL_ARB_timer_query
RenameExtensionIntoCore GL_ARB_instanced_arrays
RenameExtensionIntoCore GL_ARB_vertex_type_2_10_10_10_rev
# <<< OpenGL 3.3

# >>> OpenGL 4.0
# Rename extension suffices (if exist) subsumed in OpenGL 4.0 (from OpenGL 4.0 spec, Appendix J.1)
RenameExtensionIntoCore GL_ARB_texture_query_lod
RenameExtensionIntoCore GL_ARB_draw_buffers_blend
RenameExtensionIntoCore GL_ARB_draw_indirect
RenameExtensionIntoCore GL_ARB_gpu_shader5
RenameExtensionIntoCore GL_ARB_gpu_shader_fp64
RenameExtensionIntoCore GL_ARB_sample_shading
RenameExtensionIntoCore GL_ARB_shader_subroutine
RenameExtensionIntoCore GL_ARB_tessellation_shader
RenameExtensionIntoCore GL_ARB_texture_buffer_object_rgb32
RenameExtensionIntoCore GL_ARB_texture_cube_map_array
RenameExtensionIntoCore GL_ARB_texture_gather
RenameExtensionIntoCore GL_ARB_transform_feedback2
RenameExtensionIntoCore GL_ARB_transform_feedback3
# <<< OpenGL 4.0

# >>> OpenGL 4.1
# Rename extension suffices (if exist) subsumed in OpenGL 4.1 (from OpenGL 4.1 spec, Appendix K.1)
RenameExtensionIntoCore GL_ARB_ES2_compatibility
RenameExtensionIntoCore GL_ARB_get_program_binary
RenameExtensionIntoCore GL_ARB_separate_shader_objects
RenameExtensionIntoCore GL_ARB_shader_precision
RenameExtensionIntoCore GL_ARB_vertex_attrib_64bit
IgnoreExtension GL_EXT_vertex_attrib_64bit
RenameExtensionIntoCore GL_ARB_viewport_array
# <<< OpenGL 4.1

# >>> OpenGL 4.2
# Rename extension suffices (if exist) subsumed in OpenGL 4.2 (from OpenGL 4.2 spec, Appendix L.1)
# <<< OpenGL 4.2

# Ignore a few obsolete versions of extensions that have been subsumed into the core or ARB extensions
IgnoreExtension GL_EXT_multisample
IgnoreExtension GL_EXT_point_parameters
IgnoreExtension GL_EXT_separate_shader_objects
IgnoreExtension GL_EXT_shader_image_load_store

#
# Opaques and other directives for platform-independent routines
#

Opaque boolean GLboolean
Opaque long GLsync
Opaque long GLeglImageOES
ReturnsString glGetString
ReturnsString glGetStringi

# Experimental: Only NIO function, no arrays ..
# NIOOnly __ALL__

#
# NIODirectOnly directives for vertex arrays and other core routines
#               essential where the buffer lifecycle extends the function call.
#
# Note: API calls like glColorPointer(..) will not be exploded to 
#       multiple primitive arrays, since the pointer argument is 'void *'.
#

#NIO Review: No technical reason to constrain array access for these:
#NIODirectOnly glColorPointer
#NIODirectOnly glEdgeFlagPointer
#NIODirectOnly glIndexPointer
#NIODirectOnly glNormalPointer
#NIODirectOnly glTexCoordPointer
#NIODirectOnly glVertexPointer
#NIODirectOnly glVertexAttribPointer
#NIODirectOnly glFogCoordPointer
#NIODirectOnly glSecondaryColorPointer

#Return values
#NIODirectOnly glGenBuffers
#NIODirectOnly glGetPointerv
#NIODirectOnly glFeedbackBuffer
#NIODirectOnly glSelectBuffer
#NIODirectOnly glGetBufferSubData

#
# NIODirectOnly directives for other extensions
#
#NIO Review: No technical reason to constrain array access for these:
#NIODirectOnly glMatrixIndexPointerARB
NIODirectOnly glGetProgramStringARB
NIODirectOnly glPixelDataRangeNV
NIODirectOnly glVertexArrayRangeNV
NIODirectOnly glVertexArrayRangeApple
NIODirectOnly wglFreeMemoryNV
NIODirectOnly glXFreeMemoryNV

#
# NIOOnly for a few API calls ..
#
NIOOnly glVertexAttribPointerNV
NIOOnly glVertexWeightPointerEXT

# Capacity of wglAllocateMemoryNV/glXAllocateMemoryNV return value is
# same as value of first argument
ReturnValueCapacity wglAllocateMemoryNV {0}
ReturnValueCapacity glXAllocateMemoryNV {0}

ReturnValueCapacity glMapBufferRange {2}
ReturnValueCapacity glMapNamedBufferRangeEXT {2}

# Pass arguments to ARB_vertex_program, ARB_fragment_program,
# ARB_shader_objects, NV_vertex_program, NV_fragment_program, and
# ARB_vertex_shader as Strings
ArgumentIsString glBindAttribLocation 2
ArgumentIsString glBindAttribLocationARB 2
ArgumentIsString glGetAttribLocation 1
ArgumentIsString glGetAttribLocationARB 1
ArgumentIsString glGetProgramNamedParameterfvNV 2
ArgumentIsString glGetProgramNamedParameterdvNV 2
ArgumentIsString glGetUniformLocation 1
ArgumentIsString glGetUniformLocationARB 1
ArgumentIsString glLoadProgramNV 3
ArgumentIsString glProgramString 3
ArgumentIsString glProgramStringARB 3
ArgumentIsString glProgramNamedParameter4fNV 2
ArgumentIsString glProgramNamedParameter4dNV 2
ArgumentIsString glProgramNamedParameter4fvNV 2
ArgumentIsString glProgramNamedParameter4dvNV 2
ArgumentIsString glShaderSource 2
ArgumentIsString glShaderSourceARB 2

ArgumentIsString glBindFragDataLocation 2
ArgumentIsString glGetFragDataLocation 1
ArgumentIsString glGetUniformIndices 2
ArgumentIsString glGetUniformBlockIndex 1
ArgumentIsString glTransformFeedbackVaryings 2

# String return values must use byte[] etc ..
#   ArgumentIsString glGetActiveAttrib 6
#   ArgumentIsString glGetActiveUniformBlockName 4
#   ArgumentIsString glGetActiveUniformName 4
#   ArgumentIsString glGetActiveUniform 6
#   ArgumentIsString glGetProgramInfoLog 3
#   ArgumentIsString glGetShaderInfoLog 3
#   ArgumentIsString glGetShaderSource 3
#   ArgumentIsString glGetTransformFeedbackVarying 6
#   ArgumentIsString glGetActiveUniformARB 6
#   ArgumentIsString glGetActiveSubroutineName 5
#   ArgumentIsString glGetActiveSubroutineUniformName 5
#   ArgumentIsString glGetNamedStringARB 4 - bug param1 is String r/o see below
#   ArgumentIsString glGetDebugMessageLogARB  7
#   ArgumentIsString glGetDebugMessageLogAMD  6

ArgumentIsString glBindFragDataLocationIndexed 3
ArgumentIsString glGetFragDataIndex 1
ArgumentIsString glGetSubroutineIndex 2
ArgumentIsString glGetSubroutineUniformLocation 2

ArgumentIsString glDebugMessageInsertARB  5
ArgumentIsString glDebugMessageInsertAMD  4

ArgumentIsString glNamedStringARB 2 4
ArgumentIsString glDeleteNamedStringARB 1
ArgumentIsString glCompileShaderIncludeARB 2
ArgumentIsString glIsNamedStringARB 1
ArgumentIsString glGetNamedStringARB 1
ArgumentIsString glGetNamedStringivARB 1

#
# Use cached GL_EXTENSION if possible,
# which also allows GL3 compatibility.
#
JavaPrologue glGetString  if(_context.isExtensionCacheInitialized()) {
JavaPrologue glGetString    if(GL.GL_EXTENSIONS==name) {
JavaPrologue glGetString        return _context.getGLExtensionsString();
JavaPrologue glGetString    } /* else if(GL.GL_VERSION==name) {
JavaPrologue glGetString        return _context.getGLVersion();
JavaPrologue glGetString    } */
JavaPrologue glGetString  }

#
# Directives for Vertex Buffer Object and Pixel Buffer Object checking
#
# NOTE: we currently don't emit glue code for some of these but
# include them for completeness.
#
# FIXME: what about glMultiDrawElements? Do we want to add a VBO
# variant for that, or simply add checks to the top of the current
# implementation?
# 
JavaPrologue glBegin inBeginEndPair = true;
JavaEpilogue glEnd   inBeginEndPair = false;
JavaEpilogue glBindBuffer       bufferStateTracker.setBoundBufferObject({0}, {1});
JavaEpilogue glBindBufferARB    bufferStateTracker.setBoundBufferObject({0}, {1});
JavaEpilogue glPushClientAttrib bufferStateTracker.clearBufferObjectState();
JavaEpilogue glPushClientAttrib glStateTracker.pushAttrib(mask);
JavaEpilogue glPopClientAttrib  bufferStateTracker.clearBufferObjectState();
JavaEpilogue glPopClientAttrib  glStateTracker.popAttrib();
JavaEpilogue glBufferData       bufferSizeTracker.setBufferSize(bufferStateTracker, {0}, this, {1});

BufferObjectKind Array glColorPointer
BufferObjectKind Array glEdgeFlagPointer
BufferObjectKind Array glElementPointerATI
BufferObjectKind Array glFogCoordPointer
BufferObjectKind Array glFogCoordPointerEXT
# The next one is problematic. It isn't discussed by the specs and
# doesn't have any associated state.
BufferObjectKind Array glInterleavedArrays
BufferObjectKind Array glMatrixIndexPointerARB
BufferObjectKind Array glNormalPointer
BufferObjectKind Array glSecondaryColorPointer
BufferObjectKind Array glSecondaryColorPointerEXT
BufferObjectKind Array glTexCoordPointer
BufferObjectKind Array glVariantPointerEXT
BufferObjectKind Array glVertexPointer
BufferObjectKind Array glVertexAttribPointer
BufferObjectKind Array glVertexAttribPointerARB
BufferObjectKind Array glVertexAttribPointerNV
BufferObjectKind Array glVertexWeightPointerEXT
BufferObjectKind Array glWeightPointerARB

BufferObjectKind Element glDrawElements
BufferObjectKind Element glDrawRangeElements
BufferObjectKind Element glDrawRangeElementsEXT

# There are no PBOs in the embedded OpenGL variants right now
BufferObjectKind UnpackPixel glBitmap
BufferObjectKind UnpackPixel glColorTable
BufferObjectKind UnpackPixel glColorSubTable
BufferObjectKind UnpackPixel glCompressedTexImage1D
BufferObjectKind UnpackPixel glCompressedTexImage1DARB
BufferObjectKind UnpackPixel glCompressedTexImage2D
BufferObjectKind UnpackPixel glCompressedTexImage2DARB
BufferObjectKind UnpackPixel glCompressedTexImage3D
BufferObjectKind UnpackPixel glCompressedTexImage3DARB
BufferObjectKind UnpackPixel glCompressedTexSubImage1D
BufferObjectKind UnpackPixel glCompressedTexSubImage1DARB
BufferObjectKind UnpackPixel glCompressedTexSubImage2D
BufferObjectKind UnpackPixel glCompressedTexSubImage2DARB
BufferObjectKind UnpackPixel glCompressedTexSubImage3D
BufferObjectKind UnpackPixel glCompressedTexSubImage3DARB
BufferObjectKind UnpackPixel glConvolutionFilter1D
BufferObjectKind UnpackPixel glConvolutionFilter2D
BufferObjectKind UnpackPixel glDrawPixels
BufferObjectKind UnpackPixel glPixelMapfv
BufferObjectKind UnpackPixel glPixelMapuiv
BufferObjectKind UnpackPixel glPixelMapusv
BufferObjectKind UnpackPixel glPolygonStipple
BufferObjectKind UnpackPixel glSeparableFilter2D
BufferObjectKind UnpackPixel glTexImage1D
BufferObjectKind UnpackPixel glTexImage2D
BufferObjectKind UnpackPixel glTexImage3D
BufferObjectKind UnpackPixel glTexSubImage1D
BufferObjectKind UnpackPixel glTexSubImage2D
BufferObjectKind UnpackPixel glTexSubImage3D

BufferObjectKind PackPixel glGetColorTable
BufferObjectKind PackPixel glGetCompressedTexImage
BufferObjectKind PackPixel glGetCompressedTexImageARB
BufferObjectKind PackPixel glGetConvolutionFilter
BufferObjectKind PackPixel glGetHistogram
BufferObjectKind PackPixel glGetMinmax
BufferObjectKind PackPixel glGetPixelMapfv
BufferObjectKind PackPixel glGetPixelMapuiv
BufferObjectKind PackPixel glGetPixelMapusv
BufferObjectKind PackPixel glGetPolygonStipple
BufferObjectKind PackPixel glGetSeparableFilter
BufferObjectKind PackPixel glGetTexImage
BufferObjectKind PackPixel glReadPixels

# Range check directives for various routines
# FIXME: some of these are really the bare minimum and won't catch
# many classes of errors. Should extend the DebugGL to perform much
# more error checking with e.g. glDrawElements.
RangeCheck glColorPointer             3 1
RangeCheck glDrawElements             3 {1}
RangeCheck glDrawRangeElements        5 {3}
RangeCheck glEdgeFlagPointer          1 1
RangeCheck glElementPointerATI        1 1
RangeCheck glFogCoordPointer          2 1
RangeCheck glFogCoordPointerEXT       2 1
RangeCheck glInterleavedArrays        2 1
RangeCheck glMatrixIndexPointerARB    3 1
RangeCheck glNormalPointer            2 1
RangeCheck glSecondaryColorPointer    3 1
RangeCheck glSecondaryColorPointerEXT 3 1
RangeCheck glTexCoordPointer          3 1
RangeCheck glVariantPointerEXT        3 1
RangeCheck glVertexPointer            3 1
RangeCheck glVertexAttribPointer      5 1
RangeCheck glVertexAttribPointerARB   5 1
RangeCheck glWeightPointerARB         3 1

# Give ourselves the texture width and height for range checking inside glGetTexImage
JavaPrologue glGetTexImage int width = 0, height = 0, depth = 1;
JavaPrologue glGetTexImage int[] tmp = new int[1];
JavaPrologue glGetTexImage glGetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH, tmp, 0);
JavaPrologue glGetTexImage width = tmp[0];
JavaPrologue glGetTexImage glGetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT, tmp, 0);
JavaPrologue glGetTexImage height = tmp[0];
JavaPrologue glGetTexImage if (target == GL_TEXTURE_3D) {
JavaPrologue glGetTexImage     glGetTexLevelParameteriv(target, level, GL_TEXTURE_DEPTH, tmp, 0);
JavaPrologue glGetTexImage     depth = tmp[0];
JavaPrologue glGetTexImage }

# Range check directives for various image-related routines
RangeCheckBytes glColorTable          5 imageSizeInBytes({3}, {4}, {2}            , 1              , 1    , false)
RangeCheckBytes glColorTableEXT       5 imageSizeInBytes({3}, {4}, {2}            , 1              , 1    , false)
RangeCheckBytes glConvolutionFilter1D 5 imageSizeInBytes({3}, {4}, {2}            , 1              , 1    , false)
RangeCheckBytes glConvolutionFilter2D 6 imageSizeInBytes({4}, {5}, {2}            , {3}            , 1    , false)
RangeCheckBytes glDrawPixels          4 imageSizeInBytes({2}, {3}, {0}            , {1}            , 1    , false)
RangeCheckBytes glReadPixels          6 imageSizeInBytes({4}, {5}, {2}            , {3}            , 1    , true)
RangeCheckBytes glTexImage1D          7 imageSizeInBytes({5}, {6}, {3}            , 1              , 1    , false)
RangeCheckBytes glTexImage2D          8 imageSizeInBytes({6}, {7}, {3}            , {4}            , 1    , false)
RangeCheckBytes glTexImage3D          9 imageSizeInBytes({7}, {8}, {3}            , {4}            , {5}  , false)
RangeCheckBytes glTexSubImage1D       6 imageSizeInBytes({4}, {5}, {3}            , 1              , 1    , false)
RangeCheckBytes glTexSubImage2D       8 imageSizeInBytes({6}, {7}, {4}            , {5}            , 1    , false)
RangeCheckBytes glTexSubImage3D      10 imageSizeInBytes({8}, {9}, {5}            , {6}            , {7}  , false)
# This may produce wrong answers for 1D textures
RangeCheckBytes glGetTexImage         4 imageSizeInBytes({2}, {3}, width          , height         , depth, true)
# Note we don't support glTexImage4DSGIS / glTexSubImage4DSGIS
# FIXME: add the following unpack operations:
#   glBitmap, glPolygonStipple
# and the following pack operations:
#   glGetColorTable, glGetConvolutionFilter, glGetSeparableFilter, glGetHistogram, glGetMinmax

# Range checks for server-side object creation and deletion methods
RangeCheck glGenBuffers               1 {0}
RangeCheck glDeleteBuffers            1 {0}
RangeCheck glGenBuffersARB            1 {0}
RangeCheck glDeleteBuffersARB         1 {0}
RangeCheck glGenFencesAPPLE           1 {0}
RangeCheck glDeleteFencesAPPLE        1 {0}
RangeCheck glGenFencesNV              1 {0}
RangeCheck glDeleteFencesNV           1 {0}
RangeCheck glGenFramebuffersEXT       1 {0}
RangeCheck glDeleteFramebuffersEXT    1 {0}
RangeCheck glGenOcclusionQueriesNV    1 {0}
RangeCheck glDeleteOcclusionQueriesNV 1 {0}
RangeCheck glGenProgramsARB           1 {0}
RangeCheck glDeleteProgramsARB        1 {0}
RangeCheck glGenProgramsNV            1 {0}
RangeCheck glDeleteProgramsNV         1 {0}
RangeCheck glGenQueries               1 {0}
RangeCheck glDeleteQueries            1 {0}
RangeCheck glGenQueriesARB            1 {0}
RangeCheck glDeleteQueriesARB         1 {0}
RangeCheck glGenRenderbuffersEXT      1 {0}
RangeCheck glDeleteRenderbuffersEXT   1 {0}
RangeCheck glGenTextures              1 {0}
RangeCheck glDeleteTextures           1 {0}
RangeCheck glGenVertexArraysAPPLE     1 {0}
RangeCheck glDeleteVertexArraysAPPLE  1 {0}

# Javadoc for the GL class
ClassJavadoc GL /**
ClassJavadoc GL  * <P> Common interface containing the subset of all profiles, GL3bc, GL3, GL2, GLES1 and GLES2.<br>
ClassJavadoc GL  * This interface reflects common data types, texture and framebuffer functionality.</P>
ClassJavadoc GL  */

ClassJavadoc GL2ES1 /**
ClassJavadoc GL2ES1  * <P> 
ClassJavadoc GL2ES1  * Interface containing the common subset of GL2 and GLES1.<br>
ClassJavadoc GL2ES1  * This interface reflects only the fixed functionality of OpenGL<br>
ClassJavadoc GL2ES1  * </P>
ClassJavadoc GL2ES1  */

ClassJavadoc GL2ES2 /**
ClassJavadoc GL2ES2  * <P> 
ClassJavadoc GL2ES2  * Interface containing the common subset of GL3, GL2 and GLES2.<br>
ClassJavadoc GL2ES2  * This interface reflects only the programmable shader functionality of desktop and embedded OpenGL<br>
ClassJavadoc GL2ES2  * </P>
ClassJavadoc GL2ES2  */

ClassJavadoc GL2GL3 /**
ClassJavadoc GL2GL3  * <P> 
ClassJavadoc GL2GL3  * Interface containing the common subset of core GL3 (OpenGL 3.1+) and GL2 (OpenGL 3.0), 
ClassJavadoc GL2GL3  * also known as the OpenGL 3.0 forward compatible, non deprecated subset.<br>
ClassJavadoc GL2GL3  * This interface reflects only the programmable shader functionality of desktop OpenGL<br>
ClassJavadoc GL2GL3  * </P>
ClassJavadoc GL2GL3  */

ClassJavadoc GL2 /**
ClassJavadoc GL2  * <P> 
ClassJavadoc GL2  * This interface contains all core desktop OpenGL methods through
ClassJavadoc GL2  * version 3.0, inclusive, as well as most of it's extensions defined at the
ClassJavadoc GL2  * time of this specification.  Early OpenGL extensions whose functionality
ClassJavadoc GL2  * was incorporated into core OpenGL by version 3.0, inclusive, are specifically
ClassJavadoc GL2  * excluded.<br>
ClassJavadoc GL2  * Note: OpenGL 3.0 is the last subsumed version in the specification. 
ClassJavadoc GL2  * You need to use a {@link GL3} or {@link GL3bc} OpenGL 3.1+ context to benefit
ClassJavadoc GL2  * from new functionality and versions.
ClassJavadoc GL2  * </P>
ClassJavadoc GL2  */

ClassJavadoc GL3bc /**
ClassJavadoc GL3bc  * <P> 
ClassJavadoc GL3bc  * This interface contains the OpenGL 3.x compatibility profile, ie includes all methods
ClassJavadoc GL3bc  * as defined in {@link GL2} and {@link GL3}.<br>
ClassJavadoc GL3bc  * </P>
ClassJavadoc GL3bc  */

ClassJavadoc GL3 /**
ClassJavadoc GL3  * <P> 
ClassJavadoc GL3  * This interface contains all core, forward compatible, OpenGL methods starting from 3.1,
ClassJavadoc GL3  * inclusive, as well as most of it's extensions defined at the time of this specification.<br>
ClassJavadoc GL3  * Note: OpenGL 3.0 forward compatible, non deprecated functionality is included in the 
ClassJavadoc GL3  * 3.1 specification, hence the {@link GL2GL3} implemented interface.<br>
ClassJavadoc GL3  * Note: OpenGL 3.1 forward compatible no more includes fixed point functionality.
ClassJavadoc GL3  * </P>
ClassJavadoc GL3  */

ClassJavadoc GLES1 /**
ClassJavadoc GLES1  * <P> 
ClassJavadoc GLES1  * This interface contains all core embedded OpenGL methods of ES 1.x, with x >= 0,
ClassJavadoc GLES1  * inclusive, as well as most of it's extensions defined at the
ClassJavadoc GLES1  * time of this specification.
ClassJavadoc GLES1  * </P>
ClassJavadoc GLES1  */

ClassJavadoc GLES2 /**
ClassJavadoc GLES2  * <P> 
ClassJavadoc GLES2  * This interface contains all core embedded OpenGL methods of ES 2.x, with x >= 0,
ClassJavadoc GLES2  * inclusive, as well as most of it's extensions defined at the
ClassJavadoc GLES2  * time of this specification.
ClassJavadoc GLES2  * </P>
ClassJavadoc GLES2  */

# Javadoc for the EGL class
ClassJavadoc EGL /**
ClassJavadoc EGL  * Provides access to the embedded-specific OpenGL vendor extensions.
ClassJavadoc EGL  * See {@link GLBase} for more information.
ClassJavadoc EGL  */

# Javadoc for the WGL class
ClassJavadoc WGL /**
ClassJavadoc WGL  * Provides access to the Windows-specific OpenGL vendor extensions.
ClassJavadoc WGL  * See {@link GLBase} for more information.
ClassJavadoc WGL  */

# Javadoc for the GLX class
ClassJavadoc GLX /**
ClassJavadoc GLX  * Provides access to the X11-specific OpenGL vendor extensions.
ClassJavadoc GLX  * See {@link GLBase} for more information.
ClassJavadoc GLX  */

# Javadoc for the CGL class
ClassJavadoc CGL /**
ClassJavadoc CGL  * Provides access to the MacOSX-specific OpenGL vendor extensions.
ClassJavadoc CGL  * See {@link GLBase} for more information.
ClassJavadoc CGL  */

# Javadoc for the XVisualInfo class
ClassJavadoc XVisualInfo /**
ClassJavadoc XVisualInfo  * Wrapper for the XVisualInfo data structure, referenced by some GLX OpenGL
ClassJavadoc XVisualInfo  * extensions. No other access is provided to these data structures so currently
ClassJavadoc XVisualInfo  * this wrapper is not useful to end users, though it is used in the implementation.
ClassJavadoc XVisualInfo  */

# Custom code for querying extensions and exposing
# wglAllocateMemoryNV/glXAllocateMemoryNV
CustomJavaCode GL2GL3   /**
CustomJavaCode GL2GL3    * Provides platform-independent access to the <code>wglAllocateMemoryNV</code> /
CustomJavaCode GL2GL3    * <code>glXAllocateMemoryNV</code> extension.
CustomJavaCode GL2GL3    */
CustomJavaCode GL2GL3   public java.nio.ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3);