# This is the definition file for all GL extension stuff

%COPY_INTERFACE
// -------------------------------------------------------
//   GL extensions constants
// -------------------------------------------------------

  // GL_EXT_blend_minmax and GL_EXT_blend_color
  GL_CONSTANT_COLOR_EXT                 = $8001;
  GL_ONE_MINUS_CONSTANT_COLOR_EXT       = $8002;
  GL_CONSTANT_ALPHA_EXT                 = $8003;
  GL_ONE_MINUS_CONSTANT_ALPHA_EXT       = $8004;
  GL_BLEND_EQUATION_EXT                 = $8009;
  GL_MIN_EXT                            = $8007;
  GL_MAX_EXT                            = $8008;
  GL_FUNC_ADD_EXT                       = $8006;
  GL_FUNC_SUBTRACT_EXT                  = $800A;
  GL_FUNC_REVERSE_SUBTRACT_EXT          = $800B;
  GL_BLEND_COLOR_EXT                    = $8005;

  // GL_EXT_polygon_offset
  GL_POLYGON_OFFSET_EXT                 = $8037;
  GL_POLYGON_OFFSET_FACTOR_EXT          = $8038;
  GL_POLYGON_OFFSET_BIAS_EXT            = $8039;

  // GL_EXT_vertex_array
  GL_VERTEX_ARRAY_EXT                   = $8074;
  GL_NORMAL_ARRAY_EXT                   = $8075;
  GL_COLOR_ARRAY_EXT                    = $8076;
  GL_INDEX_ARRAY_EXT                    = $8077;
  GL_TEXTURE_COORD_ARRAY_EXT            = $8078;
  GL_EDGE_FLAG_ARRAY_EXT                = $8079;
  GL_VERTEX_ARRAY_SIZE_EXT              = $807A;
  GL_VERTEX_ARRAY_TYPE_EXT              = $807B;
  GL_VERTEX_ARRAY_STRIDE_EXT            = $807C;
  GL_VERTEX_ARRAY_COUNT_EXT             = $807D;
  GL_NORMAL_ARRAY_TYPE_EXT              = $807E;
  GL_NORMAL_ARRAY_STRIDE_EXT            = $807F;
  GL_NORMAL_ARRAY_COUNT_EXT             = $8080;
  GL_COLOR_ARRAY_SIZE_EXT               = $8081;
  GL_COLOR_ARRAY_TYPE_EXT               = $8082;
  GL_COLOR_ARRAY_STRIDE_EXT             = $8083;
  GL_COLOR_ARRAY_COUNT_EXT              = $8084;
  GL_INDEX_ARRAY_TYPE_EXT               = $8085;
  GL_INDEX_ARRAY_STRIDE_EXT             = $8086;
  GL_INDEX_ARRAY_COUNT_EXT              = $8087;
  GL_TEXTURE_COORD_ARRAY_SIZE_EXT       = $8088;
  GL_TEXTURE_COORD_ARRAY_TYPE_EXT       = $8089;
  GL_TEXTURE_COORD_ARRAY_STRIDE_EXT     = $808A;
  GL_TEXTURE_COORD_ARRAY_COUNT_EXT      = $808B;
  GL_EDGE_FLAG_ARRAY_STRIDE_EXT         = $808C;
  GL_EDGE_FLAG_ARRAY_COUNT_EXT          = $808D;
  GL_VERTEX_ARRAY_POINTER_EXT           = $808E;
  GL_NORMAL_ARRAY_POINTER_EXT           = $808F;
  GL_COLOR_ARRAY_POINTER_EXT            = $8090;
  GL_INDEX_ARRAY_POINTER_EXT            = $8091;
  GL_TEXTURE_COORD_ARRAY_POINTER_EXT    = $8092;
  GL_EDGE_FLAG_ARRAY_POINTER_EXT        = $8093;

  // GL_EXT_texture_object
  GL_TEXTURE_PRIORITY_EXT               = $8066;
  GL_TEXTURE_RESIDENT_EXT               = $8067;
  GL_TEXTURE_1D_BINDING_EXT             = $8068;
  GL_TEXTURE_2D_BINDING_EXT             = $8069;

  // GL_EXT_texture3D
  GL_PACK_SKIP_IMAGES_EXT               = $806B;
  GL_PACK_IMAGE_HEIGHT_EXT              = $806C;
  GL_UNPACK_SKIP_IMAGES_EXT             = $806D;
  GL_UNPACK_IMAGE_HEIGHT_EXT            = $806E;
  GL_TEXTURE_3D_EXT                     = $806F;
  GL_PROXY_TEXTURE_3D_EXT               = $8070;
  GL_TEXTURE_DEPTH_EXT                  = $8071;
  GL_TEXTURE_WRAP_R_EXT                 = $8072;
  GL_MAX_3D_TEXTURE_SIZE_EXT            = $8073;
  GL_TEXTURE_3D_BINDING_EXT             = $806A;

  // GL_EXT_paletted_texture
  GL_TABLE_TOO_LARGE_EXT                = $8031;
  GL_COLOR_TABLE_FORMAT_EXT             = $80D8;
  GL_COLOR_TABLE_WIDTH_EXT              = $80D9;
  GL_COLOR_TABLE_RED_SIZE_EXT           = $80DA;
  GL_COLOR_TABLE_GREEN_SIZE_EXT         = $80DB;
  GL_COLOR_TABLE_BLUE_SIZE_EXT          = $80DC;
  GL_COLOR_TABLE_ALPHA_SIZE_EXT         = $80DD;
  GL_COLOR_TABLE_LUMINANCE_SIZE_EXT     = $80DE;
  GL_COLOR_TABLE_INTENSITY_SIZE_EXT     = $80DF;
  GL_TEXTURE_INDEX_SIZE_EXT             = $80ED;
  GL_COLOR_INDEX1_EXT                   = $80E2;
  GL_COLOR_INDEX2_EXT                   = $80E3;
  GL_COLOR_INDEX4_EXT                   = $80E4;
  GL_COLOR_INDEX8_EXT                   = $80E5;
  GL_COLOR_INDEX12_EXT                  = $80E6;
  GL_COLOR_INDEX16_EXT                  = $80E7;

  // GL_EXT_shared_texture_palette
  GL_SHARED_TEXTURE_PALETTE_EXT         = $81FB;

  // GL_EXT_point_parameters
  GL_POINT_SIZE_MIN_EXT                 = $8126;
  GL_POINT_SIZE_MAX_EXT                 = $8127;
  GL_POINT_FADE_THRESHOLD_SIZE_EXT      = $8128;
  GL_DISTANCE_ATTENUATION_EXT           = $8129;

  // GL_EXT_rescale_normal
  GL_RESCALE_NORMAL_EXT                 = $803A;

  // GL_EXT_abgr
  GL_ABGR_EXT                           = $8000;

  // GL_SGIS_multitexture
  GL_SELECTED_TEXTURE_SGIS              = $835C;
  GL_SELECTED_TEXTURE_COORD_SET_SGIS    = $835D;
  GL_MAX_TEXTURES_SGIS                  = $835E;
  GL_TEXTURE0_SGIS                      = $835F;
  GL_TEXTURE1_SGIS                      = $8360;
  GL_TEXTURE2_SGIS                      = $8361;
  GL_TEXTURE3_SGIS                      = $8362;
  GL_TEXTURE_COORD_SET_SOURCE_SGIS      = $8363;

  // GL_EXT_multitexture
  GL_SELECTED_TEXTURE_EXT               = $83C0;
  GL_SELECTED_TEXTURE_COORD_SET_EXT     = $83C1;
  GL_SELECTED_TEXTURE_TRANSFORM_EXT     = $83C2;
  GL_MAX_TEXTURES_EXT                   = $83C3;
  GL_MAX_TEXTURE_COORD_SETS_EXT         = $83C4;
  GL_TEXTURE_ENV_COORD_SET_EXT          = $83C5;
  GL_TEXTURE0_EXT                       = $83C6;
  GL_TEXTURE1_EXT                       = $83C7;
  GL_TEXTURE2_EXT                       = $83C8;
  GL_TEXTURE3_EXT                       = $83C9;

  // GL_SGIS_texture_edge_clamp
  GL_CLAMP_TO_EDGE_SGIS                 = $812F;


// -------------------------------------------------------
//   GL Extension Procedures
// -------------------------------------------------------

var
%END


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

%PROCS
  // === 1.0 Extensions ===

  // GL_EXT_blend_minmax
  glBlendEquationEXT: procedure(mode: GLenum);

  // GL_EXT_blend_color
  glBlendColorEXT: procedure(red, green, blue, alpha: GLclampf);

  // GL_EXT_polygon_offset
  glPolygonOffsetEXT: procedure(factor, bias: GLfloat);

  // GL_EXT_vertex_array
  glVertexPointerEXT: procedure(size: LongInt; AType: GLenum; stride, count: LongInt; var ptr);
  glNormalPointerEXT: procedure(AType: GLenum; stride, count: LongInt; var ptr);
  glColorPointerEXT: procedure(size: LongInt; AType: GLenum; stride, count: LongInt; var ptr);
  glIndexPointerEXT: procedure(AType: GLenum; stride, count: LongInt; var ptr);
  glTexCoordPointerEXT: procedure(size: LongInt; AType: GLenum; stride, count: LongInt; var ptr);
  glEdgeFlagPointerEXT: procedure(stride, count: LongInt; var ptr: Boolean);
  glGetPointervEXT: procedure(pname: GLenum; var params: Pointer);
  glArrayElementEXT: procedure(i: LongInt);
  glDrawArraysEXT: procedure(mode: GLEnum; first, count: LongInt);

  // GL_EXT_texture_object
  glGenTexturesEXT: procedure(n: LongInt; var textures: LongWord);
  glDeleteTexturesEXT: procedure(n: LongInt; var textures: LongWord);
  glBindTextureEXT: procedure(target: GLenum; texture: LongWord);
  glPrioritizeTexturesEXT: procedure(n: LongInt; var textures: LongWord; var priorities: GLClampf);
  glAreTexturesResidentEXT: function(n: LongInt; var textures: LongWord; var residences: Boolean): Boolean;
  glIsTextureEXT: function(texture: LongWord): Boolean;

  // GL_EXT_texture3D
  glTexImage3DEXT: procedure(target: GLenum; level: LongInt; internalFormat: GLenum; width, height, depth, border: LongInt; format, AType: GLenum; var pixels);
  glTexSubImage3DEXT: procedure(target: GLenum; level, xoffset, yoffset, zoffset, width, height, depth: LongInt; format, AType: GLenum; var pixels);
  glCopyTexSubImage3DEXT: procedure(target: GLenum; level, xoffset, yoffset, zoffset, x, y, width, height: LongInt);

  // GL_EXT_color_table
  glColorTableEXT: procedure(target, internalformat: GLenum; width: LongInt; format, AType: GLenum; var table);
  glColorSubTableEXT: procedure(target: GLenum; start, count: LongInt; format, AType: GLEnum; var data);
  glGetColorTableEXT: procedure(target, format, AType: GLenum; var table);
  glGetColorTableParameterfvEXT: procedure(target, pname: GLenum; var params: GLfloat);
  glGetColorTableParameterivEXT: procedure(target, pname: GLenum; var params: LongInt);

  // GL_SGIS_multitexture
  glMultiTexCoord1dSGIS: procedure(target: GLenum; s: GLdouble);
  glMultiTexCoord1dvSGIS: procedure(target: GLenum; var v: GLdouble);
  glMultiTexCoord1fSGIS: procedure(target: GLenum; s: GLfloat);
  glMultiTexCoord1fvSGIS: procedure(target: GLenum; var v: GLfloat);
  glMultiTexCoord1iSGIS: procedure(target: GLenum; s: LongInt);
  glMultiTexCoord1ivSGIS: procedure(target: GLenum; var v: LongInt);
  glMultiTexCoord1sSGIS: procedure(target: GLenum; s: ShortInt);
  glMultiTexCoord1svSGIS: procedure(target: GLenum; var v: ShortInt);
  glMultiTexCoord2dSGIS: procedure(target: GLenum; s, t: GLdouble);
  glMultiTexCoord2dvSGIS: procedure(target: GLenum; var v: GLdouble);
  glMultiTexCoord2fSGIS: procedure(target: GLenum; s, t: GLfloat);
  glMultiTexCoord2fvSGIS: procedure(target: GLenum; var v: GLfloat);
  glMultiTexCoord2iSGIS: procedure(target: GLenum; s, t: LongInt);
  glMultiTexCoord2ivSGIS: procedure(target: GLenum; var v: LongInt);
  glMultiTexCoord2sSGIS: procedure(target: GLenum; s, t: ShortInt);
  glMultiTexCoord2svSGIS: procedure(target: GLenum; var v: ShortInt);
  glMultiTexCoord3dSGIS: procedure(target: GLenum; s, t, r: GLdouble);
  glMultiTexCoord3dvSGIS: procedure(target: GLenum; var v: GLdouble);
  glMultiTexCoord3fSGIS: procedure(target: GLenum; s, t, r: GLfloat);
  glMultiTexCoord3fvSGIS: procedure(target: GLenum; var v: GLfloat);
  glMultiTexCoord3iSGIS: procedure(target: GLenum; s, t, r: LongInt);
  glMultiTexCoord3ivSGIS: procedure(target: GLenum; var v: LongInt);
  glMultiTexCoord3sSGIS: procedure(target: GLenum; s, t, r: ShortInt);
  glMultiTexCoord3svSGIS: procedure(target: GLenum; var v: ShortInt);
  glMultiTexCoord4dSGIS: procedure(target: GLenum; s, t, r, q: GLdouble);
  glMultiTexCoord4dvSGIS: procedure(target: GLenum; var v: GLdouble);
  glMultiTexCoord4fSGIS: procedure(target: GLenum; s, t, r, q: GLfloat);
  glMultiTexCoord4fvSGIS: procedure(target: GLenum; var v: GLfloat);
  glMultiTexCoord4iSGIS: procedure(target: GLenum; s, t, r, q: LongInt);
  glMultiTexCoord4ivSGIS: procedure(target: GLenum; var v: LongInt);
  glMultiTexCoord4sSGIS: procedure(target: GLenum; s, t, r, q: ShortInt);
  glMultiTexCoord4svSGIS: procedure(target: GLenum; var v: ShortInt);
  glMultiTexCoordPointerSGIS: procedure(target: GLenum; size: LongInt; AType: GLEnum; stride: LongInt; var APointer);
  glSelectTextureSGIS: procedure(target: GLenum);
  glSelectTextureCoordSetSGIS: procedure(target: GLenum);

  // GL_EXT_multitexture
  glMultiTexCoord1dEXT: procedure(target: GLenum; s: GLdouble);
  glMultiTexCoord1dvEXT: procedure(target: GLenum; var v: GLdouble);
  glMultiTexCoord1fEXT: procedure(target: GLenum; s: GLfloat);
  glMultiTexCoord1fvEXT: procedure(target: GLenum; var v: GLfloat);
  glMultiTexCoord1iEXT: procedure(target: GLenum; s: LongInt);
  glMultiTexCoord1ivEXT: procedure(target: GLenum; var v: LongInt);
  glMultiTexCoord1sEXT: procedure(target: GLenum; s: ShortInt);
  glMultiTexCoord1svEXT: procedure(target: GLenum; var v: ShortInt);
  glMultiTexCoord2dEXT: procedure(target: GLenum; s, t: GLdouble);
  glMultiTexCoord2dvEXT: procedure(target: GLenum; var v: GLdouble);
  glMultiTexCoord2fEXT: procedure(target: GLenum; s, t: GLfloat);
  glMultiTexCoord2fvEXT: procedure(target: GLenum; var v: GLfloat);
  glMultiTexCoord2iEXT: procedure(target: GLenum; s, t: LongInt);
  glMultiTexCoord2ivEXT: procedure(target: GLenum; var v: LongInt);
  glMultiTexCoord2sEXT: procedure(target: GLenum; s, t: ShortInt);
  glMultiTexCoord2svEXT: procedure(target: GLenum; var v: ShortInt);
  glMultiTexCoord3dEXT: procedure(target: GLenum; s, t, r: GLdouble);
  glMultiTexCoord3dvEXT: procedure(target: GLenum; var v: GLdouble);
  glMultiTexCoord3fEXT: procedure(target: GLenum; s, t, r: GLfloat);
  glMultiTexCoord3fvEXT: procedure(target: GLenum; var v: GLfloat);
  glMultiTexCoord3iEXT: procedure(target: GLenum; s, t, r: LongInt);
  glMultiTexCoord3ivEXT: procedure(target: GLenum; var v: LongInt);
  glMultiTexCoord3sEXT: procedure(target: GLenum; s, t, r: ShortInt);
  glMultiTexCoord3svEXT: procedure(target: GLenum; var v: ShortInt);
  glMultiTexCoord4dEXT: procedure(target: GLenum; s, t, r, q: GLdouble);
  glMultiTexCoord4dvEXT: procedure(target: GLenum; var v: GLdouble);
  glMultiTexCoord4fEXT: procedure(target: GLenum; s, t, r, q: GLfloat);
  glMultiTexCoord4fvEXT: procedure(target: GLenum; var v: GLfloat);
  glMultiTexCoord4iEXT: procedure(target: GLenum; s, t, r, q: LongInt);
  glMultiTexCoord4ivEXT: procedure(target: GLenum; var v: LongInt);
  glMultiTexCoord4sEXT: procedure(target: GLenum; s, t, r, q: ShortInt);
  glMultiTexCoord4svEXT: procedure(target: GLenum; var v: ShortInt);
  glInterleavedTextureCoordSetsEXT: procedure(factor: LongInt);
  glSelectTextureEXT: procedure(target: GLenum);
  glSelectTextureCoordSetEXT: procedure(target: GLenum);
  glSelectTextureTransformEXT: procedure(target: GLenum);

  // GL_EXT_point_parameters
  glPointParameterfEXT: procedure(pname: GLenum; param: GLfloat);
  glPointParameterfvEXT: procedure(pname: GLenum; var params: GLfloat);

  // GL_MESA_window_pos
  glWindowPos2iMESA: procedure(x, y: LongInt);
  glWindowPos2sMESA: procedure(x, y: ShortInt);
  glWindowPos2fMESA: procedure(x, y: GLfloat);
  glWindowPos2dMESA: procedure(x, y: GLdouble);
  glWindowPos2ivMESA: procedure(var p: LongInt);
  glWindowPos2svMESA: procedure(var p: ShortInt);
  glWindowPos2fvMESA: procedure(var p: GLfloat);
  glWindowPos2dvMESA: procedure(var p: GLdouble);
  glWindowPos3iMESA: procedure(x, y, z: LongInt);
  glWindowPos3sMESA: procedure(x, y, z: ShortInt);
  glWindowPos3fMESA: procedure(x, y, z: GLfloat);
  glWindowPos3dMESA: procedure(x, y, z: GLdouble);
  glWindowPos3ivMESA: procedure(var p: LongInt);
  glWindowPos3svMESA: procedure(var p: ShortInt);
  glWindowPos3fvMESA: procedure(var p: GLfloat);
  glWindowPos3dvMESA: procedure(var p: GLdouble);
  glWindowPos4iMESA: procedure(x, y, z, w: LongInt);
  glWindowPos4sMESA: procedure(x, y, z, w: ShortInt);
  glWindowPos4fMESA: procedure(x, y, z, w: GLfloat);
  glWindowPos4dMESA: procedure(x, y, z, w: GLdouble);
  glWindowPos4ivMESA: procedure(var p: LongInt);
  glWindowPos4svMESA: procedure(var p: ShortInt);
  glWindowPos4fvMESA: procedure(var p: GLfloat);
  glWindowPos4dvMESA: procedure(var p: GLdouble);

  // GL_MESA_resize_buffers
  glResizeBuffersMESA: procedure;
%END
