# 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

RenameExtensionIntoCore 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

# 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


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

Opaque boolean GLboolean
Opaque long GLsync
ReturnsString glGetString
ReturnsString glGetStringi

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

#
# NIODirectOnly directives for vertex arrays and other core routines
#

NIODirectOnly glColorPointer
NIODirectOnly glEdgeFlagPointer
NIODirectOnly glFeedbackBuffer
NIODirectOnly glIndexPointer
NIODirectOnly glNormalPointer
NIODirectOnly glSelectBuffer
NIODirectOnly glTexCoordPointer
NIODirectOnly glVertexPointer
#
# FIXME: we should probably be ignoring the "EXT" variants of these
#
NIODirectOnly glColorPointerEXT
NIODirectOnly glEdgeFlagPointerEXT
NIODirectOnly glIndexPointerEXT
NIODirectOnly glNormalPointerEXT
NIODirectOnly glTexCoordPointerEXT
NIODirectOnly glVertexPointerEXT
#
# NIODirectOnly directives for other extensions
#
NIODirectOnly glBinormalPointerEXT
NIODirectOnly glGetBufferSubDataARB
# FIXME: should add way to restrict argument to be a direct ByteBuffer
NIODirectOnly glGetProgramStringARB
NIODirectOnly glElementPointerATI
NIODirectOnly glElementPointerNV
NIODirectOnly glElementPointerAPPLE
NIODirectOnly glFogCoordPointer
NIODirectOnly glFogCoordPointerEXT
NIODirectOnly glMatrixIndexPointerARB
NIODirectOnly glPixelDataRangeNV
NIODirectOnly glSecondaryColorPointer
NIODirectOnly glSecondaryColorPointerEXT
NIODirectOnly glTangentPointerEXT
NIODirectOnly glVertexArrayRangeNV
NIODirectOnly glVertexArrayRangeApple
NIODirectOnly glVertexAttribPointerARB
NIODirectOnly glVertexAttribPointerNV
NIODirectOnly glVertexWeightPointerEXT
NIODirectOnly glWeightPointerARB
NIODirectOnly wglFreeMemoryNV
NIODirectOnly glXFreeMemoryNV

# 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);