I am currently trying to create a strongly typed OpenGL binding for the pascal language.
I need a list of which enumerations are used with which OpenGL commands so I can use typed enums.
This will allow the compiler to flag incorrect enums used in a function as an invalid typecast error, detecting in milliseconds an error that could take a programmer a lot longer to find.
The gl.spec file contains an entry for each command that specifies the type of each parameter, including the individual enum types that I need:
DrawPixels(width, height, format, type, pixels)
param width SizeI in value
param height SizeI in value
param format PixelFormat in value
param type PixelType in value
param pixels Void in array [COMPSIZE(format/type/width/height)]
category VERSION_1_0_DEPRECATED # old: pixel-rw
glxflags client-handcode server-handcode
wglflags client-handcode server-handcode
This shows that the 3rd parameter is called format and has a type "PixelFormat".
The enum.spec file lists the enum values for this type:
COLOR_INDEX = 0x1900
STENCIL_INDEX = 0x1901
DEPTH_COMPONENT = 0x1902
RED = 0x1903
GREEN = 0x1904
BLUE = 0x1905
ALPHA = 0x1906
RGB = 0x1907
RGBA = 0x1908
LUMINANCE = 0x1909
LUMINANCE_ALPHA = 0x190A
use EXT_abgr ABGR_EXT
use EXT_cmyka CMYK_EXT
use EXT_cmyka CMYKA_EXT
use SGIX_icc_texture R5_G6_B5_ICC_SGIX
use SGIX_icc_texture R5_G6_B5_A8_ICC_SGIX
use SGIX_icc_texture ALPHA16_ICC_SGIX
use SGIX_icc_texture LUMINANCE16_ICC_SGIX
use SGIX_icc_texture LUMINANCE16_ALPHA8_ICC_SGIX
use SGIX_ycrcb YCRCB_422_SGIX
use SGIX_ycrcb YCRCB_444_SGIX
The "use" lines refer to values defined elsewhere in enum.spec that are to be reused with this type and hence with the commands that use this type.
BUT the OpenGL specification shows several other enums for this command that are not listed here.
In enum.spec those values are defined but are never referenced.
There seem to be hundreds of other values, (90%+ of the values 0x8000 and higher) which are never referenced by a use clause in a type definition, and hence cant be traced back to the functions that use them.
Why are hundreds of use clauses "missing" from enum.spec?
If this information is no longer being updated in the spec files, then where is it?
Where can i find a simple (parsable) list of which enums are used by which command?