# This is the definition file for all GL functions and types.

%COPY_INTERFACE

// C types
type
  SignedChar = ShortInt;
  UnsignedChar = Byte;
  Short = SmallInt;
  SignedShort = Short;
  UnsignedShort = Word;
  Int = LongInt;
  SignedInt = Int;
  UnsignedInt = LongWord;
  Float = Single;

  PInt = ^Int;


// ===================================================================
//   GL consts, types and functions
// ===================================================================


// -------------------------------------------------------------------
//   GL types
// -------------------------------------------------------------------

type

  PGLvoid = Pointer;
  GLboolean = Boolean;
  GLbyte = SignedChar;		// 1-byte signed
  GLshort = Short;		// 2-byte signed
  GLint = Int;			// 4-byte signed
  GLubyte = UnsignedChar;	// 1-byte unsigned
  GLushort = UnsignedShort;	// 2-byte unsigned
  GLuint = UnsignedInt;		// 4-byte unsigned
  GLsizei = Int;		// 4-byte signed
  GLfloat = Float;		// single precision float
  GLclampf = Float;		// single precision float in [0,1]
  GLdouble = Double;		// double precision float
  GLclampd = Double;		// double precision float in [0,1]

  PGLfloat = ^GLfloat;

  GLenum = Integer;

  GLbitfield = set of (GL_CURRENT_BIT, GL_POINT_BIT, GL_LINE_BIT,
    GL_POLYGON_BIT, GL_POLYGON_STIPPLE_BIT, GL_PIXEL_MODE_BIT,
    GL_LIGHTING_BIT, GL_FOG_BIT, GL_DEPTH_BUFFER_BIT, GL_ACCUM_BUFFER_BIT,
    GL_STENCIL_BUFFER_BIT, GL_VIEWPORT_BIT, GL_TRANSFORM_BIT, GL_ENABLE_BIT,
    GL_COLOR_BUFFER_BIT, GL_HINT_BIT, GL_EVAL_BIT, GL_LIST_BIT, GL_TEXTURE_BIT,
    GL_SCISSOR_BIT);

const
  GL_ALL_ATTRIB_BITS = [Low(GLbitfield)..High(GLbitfield)];


// -------------------------------------------------------------------
//   GL constants
// -------------------------------------------------------------------

const
  GL_NO_ERROR                           = 0;

  // Boolean values
  GL_FALSE                              = False;
  GL_TRUE                               = True;

  // Data types
  GL_BYTE                               = $1400;
  GL_UNSIGNED_BYTE                      = $1401;
  GL_SHORT                              = $1402;
  GL_UNSIGNED_SHORT                     = $1403;
  GL_INT                                = $1404;
  GL_UNSIGNED_INT                       = $1405;
  GL_FLOAT                              = $1406;
  GL_DOUBLE                             = $140A;
  GL_2_BYTES                            = $1407;
  GL_3_BYTES                            = $1408;
  GL_4_BYTES                            = $1409;

  // Primitives
  GL_LINES                              = $0001;
  GL_POINTS                             = $0000;
  GL_LINE_STRIP                         = $0003;
  GL_LINE_LOOP                          = $0002;
  GL_TRIANGLES                          = $0004;
  GL_TRIANGLE_STRIP                     = $0005;
  GL_TRIANGLE_FAN                       = $0006;
  GL_QUADS                              = $0007;
  GL_QUAD_STRIP                         = $0008;
  GL_POLYGON                            = $0009;
  GL_EDGE_FLAG                          = $0B43;

  // Vertex arrays
  GL_VERTEX_ARRAY                       = $8074;
  GL_NORMAL_ARRAY                       = $8075;
  GL_COLOR_ARRAY                        = $8076;
  GL_INDEX_ARRAY                        = $8077;
  GL_TEXTURE_COORD_ARRAY                = $8078;
  GL_EDGE_FLAG_ARRAY                    = $8079;
  GL_VERTEX_ARRAY_SIZE                  = $807A;
  GL_VERTEX_ARRAY_TYPE                  = $807B;
  GL_VERTEX_ARRAY_STRIDE                = $807C;
  GL_NORMAL_ARRAY_TYPE                  = $807E;
  GL_NORMAL_ARRAY_STRIDE                = $807F;
  GL_COLOR_ARRAY_SIZE                   = $8081;
  GL_COLOR_ARRAY_TYPE                   = $8082;
  GL_COLOR_ARRAY_STRIDE                 = $8083;
  GL_INDEX_ARRAY_TYPE                   = $8085;
  GL_INDEX_ARRAY_STRIDE                 = $8086;
  GL_TEXTURE_COORD_ARRAY_SIZE           = $8088;
  GL_TEXTURE_COORD_ARRAY_TYPE           = $8089;
  GL_TEXTURE_COORD_ARRAY_STRIDE         = $808A;
  GL_EDGE_FLAG_ARRAY_STRIDE             = $808C;
  GL_VERTEX_ARRAY_POINTER               = $808E;
  GL_NORMAL_ARRAY_POINTER               = $808F;
  GL_COLOR_ARRAY_POINTER                = $8090;
  GL_INDEX_ARRAY_POINTER                = $8091;
  GL_TEXTURE_COORD_ARRAY_POINTER        = $8092;
  GL_EDGE_FLAG_ARRAY_POINTER            = $8093;
  GL_V2F                                = $2A20;
  GL_V3F                                = $2A21;
  GL_C4UB_V2F                           = $2A22;
  GL_C4UB_V3F                           = $2A23;
  GL_C3F_V3F                            = $2A24;
  GL_N3F_V3F                            = $2A25;
  GL_C4F_N3F_V3F                        = $2A26;
  GL_T2F_V3F                            = $2A27;
  GL_T4F_V4F                            = $2A28;
  GL_T2F_C4UB_V3F                       = $2A29;
  GL_T2F_C3F_V3F                        = $2A2A;
  GL_T2F_N3F_V3F                        = $2A2B;
  GL_T2F_C4F_N3F_V3F                    = $2A2C;
  GL_T4F_C4F_N3F_V4F                    = $2A2D;

  // Matrix Mode
  GL_MATRIX_MODE                        = $0BA0;
  GL_MODELVIEW                          = $1700;
  GL_PROJECTION                         = $1701;
  GL_TEXTURE                            = $1702;

  // Points
  GL_POINT_SMOOTH                       = $0B10;
  GL_POINT_SIZE                         = $0B11;
  GL_POINT_SIZE_GRANULARITY             = $0B13;
  GL_POINT_SIZE_RANGE                   = $0B12;

  // Lines
  GL_LINE_SMOOTH                        = $0B20;
  GL_LINE_STIPPLE                       = $0B24;
  GL_LINE_STIPPLE_PATTERN               = $0B25;
  GL_LINE_STIPPLE_REPEAT                = $0B26;
  GL_LINE_WIDTH                         = $0B21;
  GL_LINE_WIDTH_GRANULARITY             = $0B23;
  GL_LINE_WIDTH_RANGE                   = $0B22;

  // Polygons
  GL_POINT                              = $1B00;
  GL_LINE                               = $1B01;
  GL_FILL                               = $1B02;
  GL_CCW                                = $0901;
  GL_CW                                 = $0900;
  GL_FRONT                              = $0404;
  GL_BACK                               = $0405;
  GL_CULL_FACE                          = $0B44;
  GL_CULL_FACE_MODE                     = $0B45;
  GL_POLYGON_SMOOTH                     = $0B41;
  GL_POLYGON_STIPPLE                    = $0B42;
  GL_FRONT_FACE                         = $0B46;
  GL_POLYGON_MODE                       = $0B40;
  GL_POLYGON_OFFSET_FACTOR              = $8038;
  GL_POLYGON_OFFSET_UNITS               = $2A00;
  GL_POLYGON_OFFSET_POINT               = $2A01;
  GL_POLYGON_OFFSET_LINE                = $2A02;
  GL_POLYGON_OFFSET_FILL                = $8037;

  // Display lists
  GL_COMPILE                            = $1300;
  GL_COMPILE_AND_EXECUTE                = $1301;
  GL_LIST_BASE                          = $0B32;
  GL_LIST_INDEX                         = $0B33;
  GL_LIST_MODE                          = $0B30;

  // Depth buffer
  GL_NEVER                              = $0200;
  GL_LESS                               = $0201;
  GL_GEQUAL                             = $0206;
  GL_LEQUAL                             = $0203;
  GL_GREATER                            = $0204;
  GL_NOTEQUAL                           = $0205;
  GL_EQUAL                              = $0202;
  GL_ALWAYS                             = $0207;
  GL_DEPTH_TEST                         = $0B71;
  GL_DEPTH_BITS                         = $0D56;
  GL_DEPTH_CLEAR_VALUE                  = $0B73;
  GL_DEPTH_FUNC                         = $0B74;
  GL_DEPTH_RANGE                        = $0B70;
  GL_DEPTH_WRITEMASK                    = $0B72;
  GL_DEPTH_COMPONENT                    = $1902;

  // Lighting
  GL_LIGHTING                           = $0B50;
  GL_LIGHT0                             = $4000;
  GL_LIGHT1                             = $4001;
  GL_LIGHT2                             = $4002;
  GL_LIGHT3                             = $4003;
  GL_LIGHT4                             = $4004;
  GL_LIGHT5                             = $4005;
  GL_LIGHT6                             = $4006;
  GL_LIGHT7                             = $4007;
  GL_SPOT_EXPONENT                      = $1205;
  GL_SPOT_CUTOFF                        = $1206;
  GL_CONSTANT_ATTENUATION               = $1207;
  GL_LINEAR_ATTENUATION                 = $1208;
  GL_QUADRATIC_ATTENUATION              = $1209;
  GL_AMBIENT                            = $1200;
  GL_DIFFUSE                            = $1201;
  GL_SPECULAR                           = $1202;
  GL_SHININESS                          = $1601;
  GL_EMISSION                           = $1600;
  GL_POSITION                           = $1203;
  GL_SPOT_DIRECTION                     = $1204;
  GL_AMBIENT_AND_DIFFUSE                = $1602;
  GL_COLOR_INDEXES                      = $1603;
  GL_LIGHT_MODEL_TWO_SIDE               = $0B52;
  GL_LIGHT_MODEL_LOCAL_VIEWER           = $0B51;
  GL_LIGHT_MODEL_AMBIENT                = $0B53;
  GL_FRONT_AND_BACK                     = $0408;
  GL_SHADE_MODEL                        = $0B54;
  GL_FLAT                               = $1D00;
  GL_SMOOTH                             = $1D01;
  GL_COLOR_MATERIAL                     = $0B57;
  GL_COLOR_MATERIAL_FACE                = $0B55;
  GL_COLOR_MATERIAL_PARAMETER           = $0B56;
  GL_NORMALIZE                          = $0BA1;

  // User clipping planes
  GL_CLIP_PLANE0                        = $3000;
  GL_CLIP_PLANE1                        = $3001;
  GL_CLIP_PLANE2                        = $3002;
  GL_CLIP_PLANE3                        = $3003;
  GL_CLIP_PLANE4                        = $3004;
  GL_CLIP_PLANE5                        = $3005;

  // Accumulation buffer
  GL_ACCUM_RED_BITS                     = $0D58;
  GL_ACCUM_GREEN_BITS                   = $0D59;
  GL_ACCUM_BLUE_BITS                    = $0D5A;
  GL_ACCUM_ALPHA_BITS                   = $0D5B;
  GL_ACCUM_CLEAR_VALUE                  = $0B80;
  GL_ACCUM                              = $0100;
  GL_ADD                                = $0104;
  GL_LOAD                               = $0101;
  GL_MULT                               = $0103;
  GL_RETURN                             = $0102;

  // Alpha testing
  GL_ALPHA_TEST                         = $0BC0;
  GL_ALPHA_TEST_REF                     = $0BC2;
  GL_ALPHA_TEST_FUNC                    = $0BC1;

  // Blending
  GL_BLEND                              = $0BE2;
  GL_BLEND_SRC                          = $0BE1;
  GL_BLEND_DST                          = $0BE0;
  GL_ZERO                               = 0;
  GL_ONE                                = 1;
  GL_SRC_COLOR                          = $0300;
  GL_ONE_MINUS_SRC_COLOR                = $0301;
  GL_DST_COLOR                          = $0306;
  GL_ONE_MINUS_DST_COLOR                = $0307;
  GL_SRC_ALPHA                          = $0302;
  GL_ONE_MINUS_SRC_ALPHA                = $0303;
  GL_DST_ALPHA                          = $0304;
  GL_ONE_MINUS_DST_ALPHA                = $0305;
  GL_SRC_ALPHA_SATURATE                 = $0308;
  GL_CONSTANT_COLOR                     = $8001;
  GL_ONE_MINUS_CONSTANT_COLOR           = $8002;
  GL_CONSTANT_ALPHA                     = $8003;
  GL_ONE_MINUS_CONSTANT_ALPHA           = $8004;

  // Render mode
  GL_FEEDBACK                           = $1C01;
  GL_RENDER                             = $1C00;
  GL_SELECT                             = $1C02;

  // Feedback
  GL_2D                                 = $0600;
  GL_3D                                 = $0601;
  GL_3D_COLOR                           = $0602;
  GL_3D_COLOR_TEXTURE                   = $0603;
  GL_4D_COLOR_TEXTURE                   = $0604;
  GL_POINT_TOKEN                        = $0701;
  GL_LINE_TOKEN                         = $0702;
  GL_LINE_RESET_TOKEN                   = $0707;
  GL_POLYGON_TOKEN                      = $0703;
  GL_BITMAP_TOKEN                       = $0704;
  GL_DRAW_PIXEL_TOKEN                   = $0705;
  GL_COPY_PIXEL_TOKEN                   = $0706;
  GL_PASS_THROUGH_TOKEN                 = $0700;
  GL_FEEDBACK_BUFFER_POINTER            = $0DF0;
  GL_FEEDBACK_BUFFER_SIZE               = $0DF1;
  GL_FEEDBACK_BUFFER_TYPE               = $0DF2;

  // Selection
  GL_SELECTION_BUFFER_POINTER           = $0DF3;
  GL_SELECTION_BUFFER_SIZE              = $0DF4;

  // Fog
  GL_FOG                                = $0B60;
  GL_FOG_MODE                           = $0B65;
  GL_FOG_DENSITY                        = $0B62;
  GL_FOG_COLOR                          = $0B66;
  GL_FOG_INDEX                          = $0B61;
  GL_FOG_START                          = $0B63;
  GL_FOG_END                            = $0B64;
  GL_LINEAR                             = $2601;
  GL_EXP                                = $0800;
  GL_EXP2                               = $0801;

  // Logic ops
  GL_LOGIC_OP                           = $0BF1;
  GL_INDEX_LOGIC_OP                     = $0BF1;
  GL_COLOR_LOGIC_OP                     = $0BF2;
  GL_LOGIC_OP_MODE                      = $0BF0;
  GL_CLEAR                              = $1500;
  GL_SET                                = $150F;
  GL_COPY                               = $1503;
  GL_COPY_INVERTED                      = $150C;
  GL_NOOP                               = $1505;
  GL_INVERT                             = $150A;
  GL_AND                                = $1501;
  GL_NAND                               = $150E;
  GL_OR                                 = $1507;
  GL_NOR                                = $1508;
  GL_XOR                                = $1506;
  GL_EQUIV                              = $1509;
  GL_AND_REVERSE                        = $1502;
  GL_AND_INVERTED                       = $1504;
  GL_OR_REVERSE                         = $150B;
  GL_OR_INVERTED                        = $150D;

  // Stencil
  GL_STENCIL_TEST                       = $0B90;
  GL_STENCIL_WRITEMASK                  = $0B98;
  GL_STENCIL_BITS                       = $0D57;
  GL_STENCIL_FUNC                       = $0B92;
  GL_STENCIL_VALUE_MASK                 = $0B93;
  GL_STENCIL_REF                        = $0B97;
  GL_STENCIL_FAIL                       = $0B94;
  GL_STENCIL_PASS_DEPTH_PASS            = $0B96;
  GL_STENCIL_PASS_DEPTH_FAIL            = $0B95;
  GL_STENCIL_CLEAR_VALUE                = $0B91;
  GL_STENCIL_INDEX                      = $1901;
  GL_KEEP                               = $1E00;
  GL_REPLACE                            = $1E01;
  GL_INCR                               = $1E02;
  GL_DECR                               = $1E03;

  // Buffers, Pixel Drawing/Reading
  GL_NONE                               = 0;
  GL_LEFT                               = $0406;
  GL_RIGHT                              = $0407;
  //GL_FRONT                            = $0404;
  //GL_BACK                             = $0405;
  //GL_FRONT_AND_BACK                   = $0408;
  GL_FRONT_LEFT                         = $0400;
  GL_FRONT_RIGHT                        = $0401;
  GL_BACK_LEFT                          = $0402;
  GL_BACK_RIGHT                         = $0403;
  GL_AUX0                               = $0409;
  GL_AUX1                               = $040A;
  GL_AUX2                               = $040B;
  GL_AUX3                               = $040C;
  GL_COLOR_INDEX                        = $1900;
  GL_RED                                = $1903;
  GL_GREEN                              = $1904;
  GL_BLUE                               = $1905;
  GL_ALPHA                              = $1906;
  GL_LUMINANCE                          = $1909;
  GL_LUMINANCE_ALPHA                    = $190A;
  GL_ALPHA_BITS                         = $0D55;
  GL_RED_BITS                           = $0D52;
  GL_GREEN_BITS                         = $0D53;
  GL_BLUE_BITS                          = $0D54;
  GL_INDEX_BITS                         = $0D51;
  GL_SUBPIXEL_BITS                      = $0D50;
  GL_AUX_BUFFERS                        = $0C00;
  GL_READ_BUFFER                        = $0C02;
  GL_DRAW_BUFFER                        = $0C01;
  GL_DOUBLEBUFFER                       = $0C32;
  GL_STEREO                             = $0C33;
  GL_BITMAP                             = $1A00;
  GL_COLOR                              = $1800;
  GL_DEPTH                              = $1801;
  GL_STENCIL                            = $1802;
  GL_DITHER                             = $0BD0;
  GL_RGB                                = $1907;
  GL_RGBA                               = $1908;

  // Implementation limits
  GL_MAX_LIST_NESTING                   = $0B31;
  GL_MAX_ATTRIB_STACK_DEPTH             = $0D35;
  GL_MAX_MODELVIEW_STACK_DEPTH          = $0D36;
  GL_MAX_NAME_STACK_DEPTH               = $0D37;
  GL_MAX_PROJECTION_STACK_DEPTH         = $0D38;
  GL_MAX_TEXTURE_STACK_DEPTH            = $0D39;
  GL_MAX_EVAL_ORDER                     = $0D30;
  GL_MAX_LIGHTS                         = $0D31;
  GL_MAX_CLIP_PLANES                    = $0D32;
  GL_MAX_TEXTURE_SIZE                   = $0D33;
  GL_MAX_PIXEL_MAP_TABLE                = $0D34;
  GL_MAX_VIEWPORT_DIMS                  = $0D3A;
  GL_MAX_CLIENT_ATTRIB_STACK_DEPTH      = $0D3B;

  // Gets
  GL_ATTRIB_STACK_DEPTH                 = $0BB0;
  GL_CLIENT_ATTRIB_STACK_DEPTH          = $0BB1;
  GL_COLOR_CLEAR_VALUE                  = $0C22;
  GL_COLOR_WRITEMASK                    = $0C23;
  GL_CURRENT_INDEX                      = $0B01;
  GL_CURRENT_COLOR                      = $0B00;
  GL_CURRENT_NORMAL                     = $0B02;
  GL_CURRENT_RASTER_COLOR               = $0B04;
  GL_CURRENT_RASTER_DISTANCE            = $0B09;
  GL_CURRENT_RASTER_INDEX               = $0B05;
  GL_CURRENT_RASTER_POSITION            = $0B07;
  GL_CURRENT_RASTER_TEXTURE_COORDS      = $0B06;
  GL_CURRENT_RASTER_POSITION_VALID      = $0B08;
  GL_CURRENT_TEXTURE_COORDS             = $0B03;
  GL_INDEX_CLEAR_VALUE                  = $0C20;
  GL_INDEX_MODE                         = $0C30;
  GL_INDEX_WRITEMASK                    = $0C21;
  GL_MODELVIEW_MATRIX                   = $0BA6;
  GL_MODELVIEW_STACK_DEPTH              = $0BA3;
  GL_NAME_STACK_DEPTH                   = $0D70;
  GL_PROJECTION_MATRIX                  = $0BA7;
  GL_PROJECTION_STACK_DEPTH             = $0BA4;
  GL_RENDER_MODE                        = $0C40;
  GL_RGBA_MODE                          = $0C31;
  GL_TEXTURE_MATRIX                     = $0BA8;
  GL_TEXTURE_STACK_DEPTH                = $0BA5;
  GL_VIEWPORT                           = $0BA2;

  // Evaluators
  GL_AUTO_NORMAL                        = $0D80;
  GL_MAP1_COLOR_4                       = $0D90;
  GL_MAP1_GRID_DOMAIN                   = $0DD0;
  GL_MAP1_GRID_SEGMENTS                 = $0DD1;
  GL_MAP1_INDEX                         = $0D91;
  GL_MAP1_NORMAL                        = $0D92;
  GL_MAP1_TEXTURE_COORD_1               = $0D93;
  GL_MAP1_TEXTURE_COORD_2               = $0D94;
  GL_MAP1_TEXTURE_COORD_3               = $0D95;
  GL_MAP1_TEXTURE_COORD_4               = $0D96;
  GL_MAP1_VERTEX_3                      = $0D97;
  GL_MAP1_VERTEX_4                      = $0D98;
  GL_MAP2_COLOR_4                       = $0DB0;
  GL_MAP2_GRID_DOMAIN                   = $0DD2;
  GL_MAP2_GRID_SEGMENTS                 = $0DD3;
  GL_MAP2_INDEX                         = $0DB1;
  GL_MAP2_NORMAL                        = $0DB2;
  GL_MAP2_TEXTURE_COORD_1               = $0DB3;
  GL_MAP2_TEXTURE_COORD_2               = $0DB4;
  GL_MAP2_TEXTURE_COORD_3               = $0DB5;
  GL_MAP2_TEXTURE_COORD_4               = $0DB6;
  GL_MAP2_VERTEX_3                      = $0DB7;
  GL_MAP2_VERTEX_4                      = $0DB8;
  GL_COEFF                              = $0A00;
  GL_DOMAIN                             = $0A02;
  GL_ORDER                              = $0A01;

  // Hints
  GL_FOG_HINT                           = $0C54;
  GL_LINE_SMOOTH_HINT                   = $0C52;
  GL_PERSPECTIVE_CORRECTION_HINT        = $0C50;
  GL_POINT_SMOOTH_HINT                  = $0C51;
  GL_POLYGON_SMOOTH_HINT                = $0C53;
  GL_DONT_CARE                          = $1100;
  GL_FASTEST                            = $1101;
  GL_NICEST                             = $1102;

  // Scissor box
  GL_SCISSOR_TEST                       = $0C11;
  GL_SCISSOR_BOX                        = $0C10;

  // Pixel Mode / Transfer
  GL_MAP_COLOR                          = $0D10;
  GL_MAP_STENCIL                        = $0D11;
  GL_INDEX_SHIFT                        = $0D12;
  GL_INDEX_OFFSET                       = $0D13;
  GL_RED_SCALE                          = $0D14;
  GL_RED_BIAS                           = $0D15;
  GL_GREEN_SCALE                        = $0D18;
  GL_GREEN_BIAS                         = $0D19;
  GL_BLUE_SCALE                         = $0D1A;
  GL_BLUE_BIAS                          = $0D1B;
  GL_ALPHA_SCALE                        = $0D1C;
  GL_ALPHA_BIAS                         = $0D1D;
  GL_DEPTH_SCALE                        = $0D1E;
  GL_DEPTH_BIAS                         = $0D1F;
  GL_PIXEL_MAP_S_TO_S_SIZE              = $0CB1;
  GL_PIXEL_MAP_I_TO_I_SIZE              = $0CB0;
  GL_PIXEL_MAP_I_TO_R_SIZE              = $0CB2;
  GL_PIXEL_MAP_I_TO_G_SIZE              = $0CB3;
  GL_PIXEL_MAP_I_TO_B_SIZE              = $0CB4;
  GL_PIXEL_MAP_I_TO_A_SIZE              = $0CB5;
  GL_PIXEL_MAP_R_TO_R_SIZE              = $0CB6;
  GL_PIXEL_MAP_G_TO_G_SIZE              = $0CB7;
  GL_PIXEL_MAP_B_TO_B_SIZE              = $0CB8;
  GL_PIXEL_MAP_A_TO_A_SIZE              = $0CB9;
  GL_PIXEL_MAP_S_TO_S                   = $0C71;
  GL_PIXEL_MAP_I_TO_I                   = $0C70;
  GL_PIXEL_MAP_I_TO_R                   = $0C72;
  GL_PIXEL_MAP_I_TO_G                   = $0C73;
  GL_PIXEL_MAP_I_TO_B                   = $0C74;
  GL_PIXEL_MAP_I_TO_A                   = $0C75;
  GL_PIXEL_MAP_R_TO_R                   = $0C76;
  GL_PIXEL_MAP_G_TO_G                   = $0C77;
  GL_PIXEL_MAP_B_TO_B                   = $0C78;
  GL_PIXEL_MAP_A_TO_A                   = $0C79;
  GL_PACK_ALIGNMENT                     = $0D05;
  GL_PACK_LSB_FIRST                     = $0D01;
  GL_PACK_ROW_LENGTH                    = $0D02;
  GL_PACK_SKIP_PIXELS                   = $0D04;
  GL_PACK_SKIP_ROWS                     = $0D03;
  GL_PACK_SWAP_BYTES                    = $0D00;
  GL_UNPACK_ALIGNMENT                   = $0CF5;
  GL_UNPACK_LSB_FIRST                   = $0CF1;
  GL_UNPACK_ROW_LENGTH                  = $0CF2;
  GL_UNPACK_SKIP_PIXELS                 = $0CF4;
  GL_UNPACK_SKIP_ROWS                   = $0CF3;
  GL_UNPACK_SWAP_BYTES                  = $0CF0;
  GL_ZOOM_X                             = $0D16;
  GL_ZOOM_Y                             = $0D17;

  // Texture mapping
  GL_TEXTURE_ENV                        = $2300;
  GL_TEXTURE_ENV_MODE                   = $2200;
  GL_TEXTURE_1D                         = $0DE0;
  GL_TEXTURE_2D                         = $0DE1;
  GL_TEXTURE_WRAP_S                     = $2802;
  GL_TEXTURE_WRAP_T                     = $2803;
  GL_TEXTURE_MAG_FILTER                 = $2800;
  GL_TEXTURE_MIN_FILTER                 = $2801;
  GL_TEXTURE_ENV_COLOR                  = $2201;
  GL_TEXTURE_GEN_S                      = $0C60;
  GL_TEXTURE_GEN_T                      = $0C61;
  GL_TEXTURE_GEN_MODE                   = $2500;
  GL_TEXTURE_BORDER_COLOR               = $1004;
  GL_TEXTURE_WIDTH                      = $1000;
  GL_TEXTURE_HEIGHT                     = $1001;
  GL_TEXTURE_BORDER                     = $1005;
  GL_TEXTURE_COMPONENTS                 = $1003;
  GL_TEXTURE_RED_SIZE                   = $805C;
  GL_TEXTURE_GREEN_SIZE                 = $805D;
  GL_TEXTURE_BLUE_SIZE                  = $805E;
  GL_TEXTURE_ALPHA_SIZE                 = $805F;
  GL_TEXTURE_LUMINANCE_SIZE             = $8060;
  GL_TEXTURE_INTENSITY_SIZE             = $8061;
  GL_NEAREST_MIPMAP_NEAREST             = $2700;
  GL_NEAREST_MIPMAP_LINEAR              = $2702;
  GL_LINEAR_MIPMAP_NEAREST              = $2701;
  GL_LINEAR_MIPMAP_LINEAR               = $2703;
  GL_OBJECT_LINEAR                      = $2401;
  GL_OBJECT_PLANE                       = $2501;
  GL_EYE_LINEAR                         = $2400;
  GL_EYE_PLANE                          = $2502;
  GL_SPHERE_MAP                         = $2402;
  GL_DECAL                              = $2101;
  GL_MODULATE                           = $2100;
  GL_NEAREST                            = $2600;
  GL_REPEAT                             = $2901;
  GL_CLAMP                              = $2900;
  GL_S                                  = $2000;
  GL_T                                  = $2001;
  GL_R                                  = $2002;
  GL_Q                                  = $2003;
  GL_TEXTURE_GEN_R                      = $0C62;
  GL_TEXTURE_GEN_Q                      = $0C63;

  // GL 1.1 texturing
  GL_PROXY_TEXTURE_1D                   = $8063;
  GL_PROXY_TEXTURE_2D                   = $8064;
  GL_TEXTURE_PRIORITY                   = $8066;
  GL_TEXTURE_RESIDENT                   = $8067;
  GL_TEXTURE_BINDING_1D                 = $8068;
  GL_TEXTURE_BINDING_2D                 = $8069;
  GL_TEXTURE_INTERNAL_FORMAT            = $1003;


  // GL 1.2 texturing
  GL_PACK_SKIP_IMAGES                   = $806B;
  GL_PACK_IMAGE_HEIGHT                  = $806C;
  GL_UNPACK_SKIP_IMAGES                 = $806D;
  GL_UNPACK_IMAGE_HEIGHT                = $806E;
  GL_TEXTURE_3D                         = $806F;
  GL_PROXY_TEXTURE_3D                   = $8070;
  GL_TEXTURE_DEPTH                      = $8071;
  GL_TEXTURE_WRAP_R                     = $8072;
  GL_MAX_3D_TEXTURE_SIZE                = $8073;
  GL_TEXTURE_BINDING_3D                 = $806A;

  // Internal texture formats (GL 1.1)
  GL_ALPHA4                             = $803B;
  GL_ALPHA8                             = $803C;
  GL_ALPHA12                            = $803D;
  GL_ALPHA16                            = $803E;
  GL_LUMINANCE4                         = $803F;
  GL_LUMINANCE8                         = $8040;
  GL_LUMINANCE12                        = $8041;
  GL_LUMINANCE16                        = $8042;
  GL_LUMINANCE4_ALPHA4                  = $8043;
  GL_LUMINANCE6_ALPHA2                  = $8044;
  GL_LUMINANCE8_ALPHA8                  = $8045;
  GL_LUMINANCE12_ALPHA4                 = $8046;
  GL_LUMINANCE12_ALPHA12                = $8047;
  GL_LUMINANCE16_ALPHA16                = $8048;
  GL_INTENSITY                          = $8049;
  GL_INTENSITY4                         = $804A;
  GL_INTENSITY8                         = $804B;
  GL_INTENSITY12                        = $804C;
  GL_INTENSITY16                        = $804D;
  GL_R3_G3_B2                           = $2A10;
  GL_RGB4                               = $804F;
  GL_RGB5                               = $8050;
  GL_RGB8                               = $8051;
  GL_RGB10                              = $8052;
  GL_RGB12                              = $8053;
  GL_RGB16                              = $8054;
  GL_RGBA2                              = $8055;
  GL_RGBA4                              = $8056;
  GL_RGB5_A1                            = $8057;
  GL_RGBA8                              = $8058;
  GL_RGB10_A2                           = $8059;
  GL_RGBA12                             = $805A;
  GL_RGBA16                             = $805B;

  // Utility
  GL_VENDOR                             = $1F00;
  GL_RENDERER                           = $1F01;
  GL_VERSION                            = $1F02;
  GL_EXTENSIONS                         = $1F03;

  // Errors
  GL_INVALID_VALUE                      = $0501;
  GL_INVALID_ENUM                       = $0500;
  GL_INVALID_OPERATION                  = $0502;
  GL_STACK_OVERFLOW                     = $0503;
  GL_STACK_UNDERFLOW                    = $0504;
  GL_OUT_OF_MEMORY                      = $0505;

  // OpenGL 1.2
  GL_RESCALE_NORMAL                     = $803A;
  GL_CLAMP_TO_EDGE                      = $812F;
  GL_MAX_ELEMENTS_VERTICES              = $F0E8;
  GL_MAX_ELEMENTS_INDICES               = $F0E9;
  GL_BGR                                = $80E0;
  GL_BGRA                               = $80E1;
  GL_UNSIGNED_BYTE_3_3_2                = $8032;
  GL_UNSIGNED_BYTE_2_3_3_REV            = $8362;
  GL_UNSIGNED_SHORT_5_6_5               = $8363;
  GL_UNSIGNED_SHORT_5_6_5_REV           = $8364;
  GL_UNSIGNED_SHORT_4_4_4_4             = $8033;
  GL_UNSIGNED_SHORT_4_4_4_4_REV         = $8365;
  GL_UNSIGNED_SHORT_5_5_5_1             = $8034;
  GL_UNSIGNED_SHORT_1_5_5_5_REV         = $8366;
  GL_UNSIGNED_INT_8_8_8_8               = $8035;
  GL_UNSIGNED_INT_8_8_8_8_REV           = $8367;
  GL_UNSIGNED_INT_10_10_10_2            = $8036;
  GL_UNSIGNED_INT_2_10_10_10_REV        = $8368;
  GL_LIGHT_MODEL_COLOR_CONTROL          = $81F8;
  GL_SINGLE_COLOR                       = $81F9;
  GL_SEPARATE_SPECULAR_COLOR            = $81FA;
  GL_TEXTURE_MIN_LOD                    = $813A;
  GL_TEXTURE_MAX_LOD                    = $813B;
  GL_TEXTURE_BASE_LEVEL                 = $813C;
  GL_TEXTURE_MAX_LEVEL                  = $813D;


// -------------------------------------------------------------------
//   GL procedures and functions
// -------------------------------------------------------------------

var
%END


#=====================================================================
# Procedures and functions
#=====================================================================

%PROCS
  // Miscellaneous
  glClearIndex: procedure(c: GLfloat);
  glClearColor: procedure(red, green, blue, alpha: GLclampf);
  glClear: procedure(mask: GLbitfield);
  glIndexMask: procedure(mask: LongWord);
  glColorMask: procedure(red, green, blue, alpha: Boolean);
  glAlphaFunc: procedure(func: GLenum; ref: GLclampf);
  glBlendFunc: procedure(sfactor, dfactor: GLenum);
  glLogicOp: procedure(opcode: GLenum);
  glCullFace: procedure(mode: GLenum);
  glFrontFace: procedure(mode: GLenum);
  glPointSize: procedure(size: GLfloat);
  glLineWidth: procedure(width: GLfloat);
  glLineStipple: procedure(factor: LongInt; pattern: Word);
  glPolygonMode: procedure(face, mode: GLenum);
  glPolygonOffset: procedure(factor, units: GLfloat);
  glPolygonStipple: procedure(var mask: Byte);
  glGetPolygonStipple: procedure(var mask: Byte);
  glEdgeFlag: procedure(flag: Boolean);
  glEdgeFlagv: procedure(var flag: Boolean);
  glScissor: procedure(x, y, width, height: LongInt);
  glClipPlane: procedure(plane: GLenum; var equation: GLdouble);
  glGetClipPlane: procedure(plane: GLenum; var equation: GLdouble);
  glDrawBuffer: procedure(mode: GLenum);
  glReadBuffer: procedure(mode: GLenum);
  glEnable: procedure(cap: LongInt);
  glDisable: procedure(cap: LongInt);
  glIsEnabled: function(cap: GLenum): Boolean;
  glEnableClientState: procedure(cap: GLenum);  // 1.1
  glDisableClientState: procedure(cap: GLenum);  // 1.1
  glGetBooleanv: procedure(pname: GLenum; var params: Boolean);
  glGetDoublev: procedure(pname: GLenum; var params: GLdouble);
  glGetFloatv: procedure(pname: GLenum; var params: GLfloat);
  glGetIntegerv: procedure(pname: GLenum; var params: LongInt);
  glPushAttrib: procedure(mask: GLbitfield);
  glPopAttrib: procedure;
  glPushClientAttrib: procedure(mask: GLbitfield);  // 1.1
  glPopClientAttrib: procedure;  // 1.1
  glRenderMode: function(mode: GLenum): LongInt;
  glGetError: function: GLenum;
  glGetString: function(name: GLenum): PChar;
  glFinish: procedure;
  glFlush: procedure;
  glHint: procedure(target, mode: GLenum);


  // Depth Buffer
  glClearDepth: procedure(depth: GLclampd);
  glDepthFunc: procedure(func: LongInt);
  glDepthMask: procedure(flag: Boolean);
  glDepthRange: procedure(near_val, far_val: GLclampd);

  // Accumulation Buffer
  glClearAccum: procedure(red, green, blue, alpha: GLfloat);
  glAccum: procedure(op: GLenum; value: GLfloat);

  // Tranformation
  glMatrixMode: procedure(mode: GLenum);
  glOrtho: procedure(left, right, bottom, top, near_val, far_val: GLdouble);
  glFrustum: procedure(left, right, bottom, top, near_val, far_val: GLdouble);
  glViewport: procedure(x, y, width, height: LongInt);
  glPushMatrix: procedure;
  glPopMatrix: procedure;
  glLoadIdentity: procedure;
  glLoadMatrixd: procedure(var m: GLdouble);
  glLoadMatrixf: procedure(var m: PGLfloat);
  glMultMatrixd: procedure(var m: GLdouble);
  glMultMatrixf: procedure(var m: GLfloat);
  glRotated: procedure(angle, x, y, z: GLdouble);
  glRotatef: procedure(angle, x, y, z: GLfloat);
  glScaled: procedure(x, y, z: GLdouble);
  glScalef: procedure(x, y, z: GLfloat);
  glTranslated: procedure(x, y, z: GLdouble);
  glTranslatef: procedure(x, y, z: GLfloat);

  // Display Lists
  glIsList: function(list: LongWord): Boolean;
  glDeleteLists: procedure(list: LongWord; range: LongInt);
  glGenLists: function(range: LongInt): LongWord;
  glNewList: procedure(list: LongWord; mode: GLenum);
  glEndList: procedure;
  glCallList: procedure(list: LongWord);
  glCallLists: procedure(n: LongInt; AType: GLenum; var lists);
  glListBase: procedure(base: LongWord);

  // Drawing Functions
  glBegin: procedure(mode: GLenum);
  glEnd: procedure;
  glVertex2d: procedure(x, y: GLdouble);
  glVertex2f: procedure(x, y: GLfloat);
  glVertex2i: procedure(x, y: LongInt);
  glVertex2s: procedure(x, y: SmallInt);
  glVertex3d: procedure(x, y, z: GLdouble);
  glVertex3f: procedure(x, y, z: GLfloat);
  glVertex3i: procedure(x, y, z: LongInt);
  glVertex3s: procedure(x, y, z: SmallInt);
  glVertex4d: procedure(x, y, z, w: GLdouble);
  glVertex4f: procedure(x, y, z, w: GLfloat);
  glVertex4i: procedure(x, y, z, w: LongInt);
  glVertex4s: procedure(x, y, z, w: SmallInt);
  glVertex2dv: procedure(var v: GLdouble);
  glVertex2fv: procedure(var v: GLfloat);
  glVertex2iv: procedure(var v: LongInt);
  glVertex2sv: procedure(var v: SmallInt);
  glVertex3dv: procedure(var v: GLdouble);
  glVertex3fv: procedure(var v: GLfloat);
  glVertex3iv: procedure(var v: LongInt);
  glVertex3sv: procedure(var v: SmallInt);
  glVertex4dv: procedure(var v: GLdouble);
  glVertex4fv: procedure(var v: GLfloat);
  glVertex4iv: procedure(var v: LongInt);
  glVertex4sv: procedure(var v: SmallInt);
  glNormal3b: procedure(nx, ny, nz: Byte);
  glNormal3d: procedure(nx, ny, nz: GLdouble);
  glNormal3f: procedure(nx, ny, nz: GLfloat);
  glNormal3i: procedure(nx, ny, nz: LongInt);
  glNormal3s: procedure(nx, ny, nz: SmallInt);
  glNormal3bv: procedure(var v: ShortInt);
  glNormal3dv: procedure(var v: GLdouble);
  glNormal3fv: procedure(var v: GLfloat);
  glNormal3iv: procedure(var v: LongInt);
  glNormal3sv: procedure(var v: SmallInt);
  glIndexd: procedure(c: GLdouble);
  glIndexf: procedure(c: GLfloat);
  glIndexi: procedure(c: LongInt);
  glIndexs: procedure(c: SmallInt);
  glIndexub: procedure(c: Byte);  // 1.1
  glIndexdv: procedure(var c: GLdouble);
  glIndexfv: procedure(var c: GLfloat);
  glIndexiv: procedure(var c: LongInt);
  glIndexsv: procedure(var c: SmallInt);
  glIndexubv: procedure(var c: Byte);  // 1.1
  glColor3b : procedure(red, green, blue: ShortInt);
  glColor3d : procedure(red, green, blue: GLdouble);
  glColor3f : procedure(red, green, blue: GLfloat);
  glColor3i : procedure(red, green, blue: LongInt);
  glColor3s : procedure(red, green, blue: SmallInt);
  glColor3ub: procedure(red, green, blue: Byte);
  glColor3ui: procedure(red, green, blue: LongWord);
  glColor3us: procedure(red, green, blue: Word);
  glColor4b : procedure(red, green, blue, alpha: ShortInt);
  glColor4d : procedure(red, green, blue, alpha: GLdouble);
  glColor4f : procedure(red, green, blue, alpha: GLfloat);
  glColor4i : procedure(red, green, blue, alpha: LongInt);
  glColor4s : procedure(red, green, blue, alpha: SmallInt);
  glColor4ub: procedure(red, green, blue, alpha: Byte);
  glColor4ui: procedure(red, green, blue, alpha: LongWord);
  glColor4us: procedure(red, green, blue, alpha: Word);
  glColor3bv : procedure(var v: ShortInt);
  glColor3dv : procedure(var v: GLdouble);
  glColor3fv : procedure(var v: GLfloat);
  glColor3iv : procedure(var v: LongInt);
  glColor3sv : procedure(var v: SmallInt);
  glColor3ubv: procedure(var v: Byte);
  glColor3uiv: procedure(var v: LongWord);
  glColor3usv: procedure(var v: Word);
  glColor4bv : procedure(var v: ShortInt);
  glColor4dv : procedure(var v: GLdouble);
  glColor4fv : procedure(var v: GLfloat);
  glColor4iv : procedure(var v: LongInt);
  glColor4sv : procedure(var v: SmallInt);
  glColor4ubv: procedure(var v: Byte);
  glColor4uiv: procedure(var v: LongWord);
  glColor4usv: procedure(var v: Word);
  glTexCoord1d: procedure(s: GLdouble);
  glTexCoord1f: procedure(s: GLfloat);
  glTexCoord1i: procedure(s: LongInt);
  glTexCoord1s: procedure(s: SmallInt);
  glTexCoord2d: procedure(s, t: GLdouble);
  glTexCoord2f: procedure(s, t: GLfloat);
  glTexCoord2i: procedure(s, t: LongInt);
  glTexCoord2s: procedure(s, t: SmallInt);
  glTexCoord3d: procedure(s, t, r: GLdouble);
  glTexCoord3f: procedure(s, t, r: GLfloat);
  glTexCoord3i: procedure(s, t, r: LongInt);
  glTexCoord3s: procedure(s, t, r: SmallInt);
  glTexCoord4d: procedure(s, t, r, q: GLdouble);
  glTexCoord4f: procedure(s, t, r, q: GLfloat);
  glTexCoord4i: procedure(s, t, r, q: LongInt);
  glTexCoord4s: procedure(s, t, r, q: SmallInt);
  glTexCoord1dv: procedure(var v: GLdouble);
  glTexCoord1fv: procedure(var v: GLfloat);
  glTexCoord1iv: procedure(var v: LongInt);
  glTexCoord1sv: procedure(var v: SmallInt);
  glTexCoord2dv: procedure(var v: GLdouble);
  glTexCoord2fv: procedure(var v: GLfloat);
  glTexCoord2iv: procedure(var v: LongInt);
  glTexCoord2sv: procedure(var v: SmallInt);
  glTexCoord3dv: procedure(var v: GLdouble);
  glTexCoord3fv: procedure(var v: GLfloat);
  glTexCoord3iv: procedure(var v: LongInt);
  glTexCoord3sv: procedure(var v: SmallInt);
  glTexCoord4dv: procedure(var v: GLdouble);
  glTexCoord4fv: procedure(var v: GLfloat);
  glTexCoord4iv: procedure(var v: LongInt);
  glTexCoord4sv: procedure(var v: SmallInt);
  glRasterPos2d: procedure(x, y: GLdouble);
  glRasterPos2f: procedure(x, y: GLfloat);
  glRasterPos2i: procedure(x, y: LongInt);
  glRasterPos2s: procedure(x, y: SmallInt);
  glRasterPos3d: procedure(x, y, z: GLdouble);
  glRasterPos3f: procedure(x, y, z: GLfloat);
  glRasterPos3i: procedure(x, y, z: LongInt);
  glRasterPos3s: procedure(x, y, z: SmallInt);
  glRasterPos4d: procedure(x, y, z, w: GLdouble);
  glRasterPos4f: procedure(x, y, z, w: GLfloat);
  glRasterPos4i: procedure(x, y, z, w: LongInt);
  glRasterPos4s: procedure(x, y, z, w: SmallInt);
  glRasterPos2dv: procedure(var v: GLdouble);
  glRasterPos2fv: procedure(var v: GLfloat);
  glRasterPos2iv: procedure(var v: LongInt);
  glRasterPos2sv: procedure(var v: SmallInt);
  glRasterPos3dv: procedure(var v: GLdouble);
  glRasterPos3fv: procedure(var v: GLfloat);
  glRasterPos3iv: procedure(var v: LongInt);
  glRasterPos3sv: procedure(var v: SmallInt);
  glRasterPos4dv: procedure(var v: GLdouble);
  glRasterPos4fv: procedure(var v: GLfloat);
  glRasterPos4iv: procedure(var v: LongInt);
  glRasterPos4sv: procedure(var v: SmallInt);
  glRectd: procedure(x1, y1, x2, y2: GLdouble);
  glRectf: procedure(x1, y1, x2, y2: GLfloat);
  glRecti: procedure(x1, y1, x2, y2: LongInt);
  glRects: procedure(x1, y1, x2, y2: SmallInt);
  glRectdv: procedure(var v1, v2: GLdouble);
  glRectfv: procedure(var v1, v2: GLfloat);
  glRectiv: procedure(var v1, v2: LongInt);
  glRectsv: procedure(var v1, v2: SmallInt);

  // Vertex Arrays (1.1)
  glVertexPointer: procedure(size: LongInt; AType: GLenum; stride: LongInt; var ptr);
  glNormalPointer: procedure(AType: GLenum; stride: LongInt; var ptr);
  glColorPointer: procedure(size: LongInt; AType: GLenum; stride: LongInt; var ptr);
  glIndexPointer: procedure(AType: GLenum; stride: LongInt; var ptr);
  glTexCoordPointer: procedure(size: LongInt; AType: GLenum; stride: LongInt; var ptr);
  glEdgeFlagPointer: procedure(stride: LongInt; var ptr);
  glGetPointerv: procedure(pname: GLenum; var params: Pointer);
  glArrayElement: procedure(i: LongInt);
  glDrawArrays: procedure(mode: GLenum; first, count: LongInt);
  glDrawElements: procedure(mode: GLenum; count: Integer; AType: GLenum; var indices);
  glInterleavedArrays: procedure(format: GLenum; stride: LongInt; var pointer);

  // Lighting
  glShadeModel: procedure(mode: GLenum);
  glLightf: procedure(light, pname: GLenum; param: GLfloat);
  glLighti: procedure(light, pname: GLenum; param: LongInt);
  glLightfv: procedure(light, pname: GLenum; var params: GLfloat);
  glLightiv: procedure(light, pname: GLenum; var params: LongInt);
  glGetLightfv: procedure(light, pname: GLenum; var params: GLfloat);
  glGetLightiv: procedure(light, pname: GLenum; var params: LongInt);
  glLightModelf: procedure(pname: GLenum; param: GLfloat);
  glLightModeli: procedure(pname: GLenum; param: LongInt);
  glLightModelfv: procedure(pname: GLenum; var params: GLfloat);
  glLightModeliv: procedure(pname: GLenum; var param: LongInt);
  glMaterialf: procedure(face, pname: GLenum; param: GLfloat);
  glMateriali: procedure(face, pname: GLenum; param: LongInt);
  glMaterialfv: procedure(face, pname: GLenum; var params: GLfloat);
  glMaterialiv: procedure(face, pname: GLenum; var params: LongInt);
  glGetMaterialfv: procedure(face, pname: GLenum; var params: GLfloat);
  glGetMaterialiv: procedure(face, pname: GLenum; var params: LongInt);
  glColorMaterial: procedure(face, mode: GLenum);

  // Raster Functions
  glPixelZoom: procedure(xfactor, yfactor: GLfloat);
  glPixelStoref: procedure(pname: GLenum; param: GLfloat);
  glPixelStorei: procedure(pname: GLenum; param: LongInt);
  glPixelTransferf: procedure(pname: GLenum; param: GLfloat);
  glPixelTransferi: procedure(pname: GLenum; param: LongInt);
  glPixelMapfv: procedure(map: GLenum; mapsize: LongInt; var values: GLfloat);
  glPixelMapuiv: procedure(map: GLenum; mapsize: LongInt; var values: LongWord);
  glPixelMapusv: procedure(map: GLenum; mapsize: LongInt; var values: Word);
  glGetPixelMapfv: procedure(map: GLenum; var values: GLfloat);
  glGetPixelMapuiv: procedure(map: GLenum; var values: LongWord);
  glGetPixelMapusv: procedure(map: GLenum; var values: Word);
  glBitmap: procedure(width, height: LongInt; xorig, yorig, xmove, ymove: GLfloat; var bitmap);
  glReadPixels: procedure(x, y, width, height: LongInt; format, AType: GLenum; var pixels);
  glDrawPixels: procedure(width, height: LongInt; format, AType: GLenum; var pixels);
  glCopyPixels: procedure(x, y, width, height: LongInt; AType: GLenum);

  // Stenciling
  glStencilFunc: procedure(func: GLenum; ref: LongInt; mask: LongWord);
  glStencilMask: procedure(mask: LongWord);
  glStencilOp: procedure(fail, zfail, zpass: GLenum);
  glClearStencil: procedure(s: LongInt);

  // Texture Mapping
  glTexGend: procedure(cord, pname: GLenum; param: GLdouble);
  glTexGenf: procedure(cord, pname: GLenum; param: GLfloat);
  glTexGeni: procedure(cord, pname: GLenum; param: LongInt);
  glTexGendv: procedure(cord, pname: GLenum; var params: GLdouble);
  glTexGenfv: procedure(cord, pname: GLenum; var params: GLfloat);
  glTexGeniv: procedure(cord, pname: GLenum; var params: LongInt);
  glGetTexGendv: procedure(cord, pname: GLenum; var params: GLdouble);
  glGetTexGenfv: procedure(cord, pname: GLenum; var params: GLfloat);
  glGetTexGeniv: procedure(cord, pname: GLenum; var params: LongInt);
  glTexEnvf: procedure(target, pname: GLenum; param: GLfloat);
  glTexEnvi: procedure(target, pname: GLenum; param: LongInt);
  glTexEnvfv: procedure(target, pname: GLenum; var params: GLfloat);
  glTexEnviv: procedure(target, pname: GLenum; var params: LongInt);
  glGetTexEnvfv: procedure(target, pname: GLenum; var params: GLfloat);
  glGetTexEnviv: procedure(target, pname: GLenum; var params: LongInt);
  glTexParameterf: procedure(target, pname: GLenum; param: GLfloat);
  glTexParameteri: procedure(target, pname: GLenum; param: LongInt);
  glTexParameterfv: procedure(target, pname: GLenum; var params: GLfloat);
  glTexParameteriv: procedure(target, pname: GLenum; var params: LongInt);
  glGetTexParameterfv: procedure(target, pname: GLenum; var params: GLfloat);
  glGetTexParameteriv: procedure(target, pname: GLenum; var params: LongInt);
  glGetTexLevelParameterfv: procedure(target: GLenum; level: LongInt; pname: GLenum; var params: GLfloat);
  glGetTexLevelParameteriv: procedure(target: GLenum; level: LongInt; pname: GLenum; var params: LongInt);
  glTexImage1D: procedure(target: GLenum; level, internalFormat, width, border: LongInt; format, AType: GLenum; var pixels);
  glTexImage2D: procedure(target: GLenum; level, internalFormat, width, height, border: LongInt; format, AType: GLenum; var pixels);
  glGetTexImage: procedure(target: GLenum; level: LongInt; format, AType: GLenum; var pixels);
  // 1.1 functions:
  glGenTextures: procedure(n: LongInt; var textures: LongWord);
  glDeleteTextures: procedure(n: LongInt; var textures: LongWord);
  glBindTexture: procedure(target: GLenum; texture: LongWord);
  glPrioritizeTextures: procedure(n: LongInt; var textures: LongWord; var priorities: GLclampf);
  glAreTexturesResident: function(n: LongInt; var textures: LongWord; var residences: Boolean): Boolean;
  glIsTexture: function(texture: LongWord): Boolean;
  glTexSubImage1D: procedure(target: GLenum; level, xoffset, width: LongInt; format, AType: GLenum; var pixels);
  glTexSubImage2D: procedure(target: GLenum; level, xoffset, yoffset, width, height: LongInt; format, AType: GLenum; var pixels);
  glCopyTexImage1D: procedure(target: GLenum; level: LongInt; format: GLenum; x, y, width, border: LongInt);
  glCopyTexImage2D: procedure(target: GLenum; level: LongInt; format: GLenum; x, y, width, height, border: LongInt);
  glCopyTexSubImage1D: procedure(target: GLenum; level, xoffset, x, y, width: LongInt);
  glCopyTexSubImage2D: procedure(target: GLenum; level, xoffset, yoffset, x, y, width, height: LongInt);

  // Evaluators
  glMap1d: procedure(target: GLenum; u1, u2: GLdouble; stride, order: LongInt; var points: GLdouble);
  glMap1f: procedure(target: GLenum; u1, u2: GLfloat; stride, order: LongInt; var points: GLfloat);
  glMap2d: procedure(target: GLenum; u1, u2: GLdouble; ustride, uorder: LongInt; v1, v2: GLdouble; vstride, vorder: LongInt; var points: GLdouble);
  glMap2f: procedure(target: GLenum; u1, u2: GLfloat; ustride, uorder: LongInt; v1, v2: GLfloat; vstride, vorder: LongInt; var points: GLfloat);
  glGetMapdv: procedure(target, query: GLenum; var v: GLdouble);
  glGetMapfv: procedure(target, query: GLenum; var v: GLfloat);
  glGetMapiv: procedure(target, query: GLenum; var v: LongInt);
  glEvalCoord1d: procedure(u: GLdouble);
  glEvalCoord1f: procedure(u: GLfloat);
  glEvalCoord1dv: procedure(var u: GLdouble);
  glEvalCoord1fv: procedure(var u: GLfloat);
  glEvalCoord2d: procedure(u, v: GLdouble);
  glEvalCoord2f: procedure(u, v: GLfloat);
  glEvalCoord2dv: procedure(var u, v: GLdouble);
  glEvalCoord2fv: procedure(var u, v: GLfloat);
  glMapGrid1d: procedure(un: LongInt; u1, u2: GLdouble);
  glMapGrid1f: procedure(un: LongInt; u1, u2: GLfloat);
  glMapGrid2d: procedure(un: LongInt; u1, u2: GLdouble; vn: LongInt; v1, v2: GLdouble);
  glMapGrid2f: procedure(un: LongInt; u1, u2: GLfloat; vn: LongInt; v1, v2: GLfloat);
  glEvalPoint1: procedure(i: LongInt);
  glEvalPoint2: procedure(i, j: LongInt);
  glEvalMesh1: procedure(mode: GLenum; i1, i2: LongInt);
  glEvalMesh2: procedure(mode: GLenum; i1, i2, j1, j2: LongInt);

  // Fog
  glFogf: procedure(pname: GLenum; param: GLfloat);
  glFogi: procedure(pname: GLenum; param: LongInt);
  glFogfv: procedure(pname: GLenum; var params: GLfloat);
  glFogiv: procedure(pname: GLenum; var params: LongInt);

  // Selection and Feedback
  glFeedbackBuffer: procedure(size: LongInt; AType: GLenum; var buffer: GLfloat);
  glPassThrough: procedure(token: GLfloat);
  glSelectBuffer: procedure(size: LongInt; var buffer: LongWord);
  glInitNames: procedure;
  glLoadName: procedure(name: LongWord);
  glPushName: procedure(name: LongWord);
  glPopName: procedure;
%END
