-{$IFDEF GLB_NATIVE_OGL}
-const
- GL_TRUE = 1;
- GL_FALSE = 0;
-
- GL_ZERO = 0;
- GL_ONE = 1;
-
- GL_VERSION = $1F02;
- GL_EXTENSIONS = $1F03;
-
- GL_TEXTURE_1D = $0DE0;
- GL_TEXTURE_2D = $0DE1;
- GL_TEXTURE_RECTANGLE = $84F5;
-
- GL_NORMAL_MAP = $8511;
- GL_TEXTURE_CUBE_MAP = $8513;
- GL_REFLECTION_MAP = $8512;
- GL_TEXTURE_CUBE_MAP_POSITIVE_X = $8515;
- GL_TEXTURE_CUBE_MAP_NEGATIVE_X = $8516;
- GL_TEXTURE_CUBE_MAP_POSITIVE_Y = $8517;
- GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = $8518;
- GL_TEXTURE_CUBE_MAP_POSITIVE_Z = $8519;
- GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = $851A;
-
- GL_TEXTURE_WIDTH = $1000;
- GL_TEXTURE_HEIGHT = $1001;
- GL_TEXTURE_INTERNAL_FORMAT = $1003;
- GL_TEXTURE_SWIZZLE_RGBA = $8E46;
-
- GL_S = $2000;
- GL_T = $2001;
- GL_R = $2002;
- GL_Q = $2003;
-
- GL_TEXTURE_GEN_S = $0C60;
- GL_TEXTURE_GEN_T = $0C61;
- GL_TEXTURE_GEN_R = $0C62;
- GL_TEXTURE_GEN_Q = $0C63;
-
- GL_RED = $1903;
- GL_GREEN = $1904;
- GL_BLUE = $1905;
-
- GL_ALPHA = $1906;
- GL_ALPHA4 = $803B;
- GL_ALPHA8 = $803C;
- GL_ALPHA12 = $803D;
- GL_ALPHA16 = $803E;
-
- GL_LUMINANCE = $1909;
- GL_LUMINANCE4 = $803F;
- GL_LUMINANCE8 = $8040;
- GL_LUMINANCE12 = $8041;
- GL_LUMINANCE16 = $8042;
-
- GL_LUMINANCE_ALPHA = $190A;
- 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_RGB = $1907;
- GL_BGR = $80E0;
- GL_R3_G3_B2 = $2A10;
- GL_RGB4 = $804F;
- GL_RGB5 = $8050;
- GL_RGB565 = $8D62;
- GL_RGB8 = $8051;
- GL_RGB10 = $8052;
- GL_RGB12 = $8053;
- GL_RGB16 = $8054;
-
- GL_RGBA = $1908;
- GL_BGRA = $80E1;
- GL_RGBA2 = $8055;
- GL_RGBA4 = $8056;
- GL_RGB5_A1 = $8057;
- GL_RGBA8 = $8058;
- GL_RGB10_A2 = $8059;
- GL_RGBA12 = $805A;
- GL_RGBA16 = $805B;
-
- GL_DEPTH_COMPONENT = $1902;
- GL_DEPTH_COMPONENT16 = $81A5;
- GL_DEPTH_COMPONENT24 = $81A6;
- GL_DEPTH_COMPONENT32 = $81A7;
-
- GL_COMPRESSED_RGB = $84ED;
- GL_COMPRESSED_RGBA = $84EE;
- GL_COMPRESSED_RGB_S3TC_DXT1_EXT = $83F0;
- GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = $83F1;
- GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = $83F2;
- GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = $83F3;
-
- GL_UNSIGNED_BYTE = $1401;
- GL_UNSIGNED_BYTE_3_3_2 = $8032;
- GL_UNSIGNED_BYTE_2_3_3_REV = $8362;
-
- GL_UNSIGNED_SHORT = $1403;
- GL_UNSIGNED_SHORT_5_6_5 = $8363;
- GL_UNSIGNED_SHORT_4_4_4_4 = $8033;
- GL_UNSIGNED_SHORT_5_5_5_1 = $8034;
- GL_UNSIGNED_SHORT_5_6_5_REV = $8364;
- GL_UNSIGNED_SHORT_4_4_4_4_REV = $8365;
- GL_UNSIGNED_SHORT_1_5_5_5_REV = $8366;
-
- GL_UNSIGNED_INT = $1405;
- GL_UNSIGNED_INT_8_8_8_8 = $8035;
- GL_UNSIGNED_INT_10_10_10_2 = $8036;
- GL_UNSIGNED_INT_8_8_8_8_REV = $8367;
- GL_UNSIGNED_INT_2_10_10_10_REV = $8368;
-
- { Texture Filter }
- GL_TEXTURE_MAG_FILTER = $2800;
- GL_TEXTURE_MIN_FILTER = $2801;
- GL_NEAREST = $2600;
- GL_NEAREST_MIPMAP_NEAREST = $2700;
- GL_NEAREST_MIPMAP_LINEAR = $2702;
- GL_LINEAR = $2601;
- GL_LINEAR_MIPMAP_NEAREST = $2701;
- GL_LINEAR_MIPMAP_LINEAR = $2703;
-
- { Texture Wrap }
- GL_TEXTURE_WRAP_S = $2802;
- GL_TEXTURE_WRAP_T = $2803;
- GL_TEXTURE_WRAP_R = $8072;
- GL_CLAMP = $2900;
- GL_REPEAT = $2901;
- GL_CLAMP_TO_EDGE = $812F;
- GL_CLAMP_TO_BORDER = $812D;
- GL_MIRRORED_REPEAT = $8370;
-
- { Other }
- GL_GENERATE_MIPMAP = $8191;
- GL_TEXTURE_BORDER_COLOR = $1004;
- GL_MAX_TEXTURE_SIZE = $0D33;
- GL_PACK_ALIGNMENT = $0D05;
- GL_UNPACK_ALIGNMENT = $0CF5;
-
- GL_TEXTURE_MAX_ANISOTROPY_EXT = $84FE;
- GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = $84FF;
- GL_MAX_CUBE_MAP_TEXTURE_SIZE = $851C;
- GL_TEXTURE_GEN_MODE = $2500;
-
-{$IF DEFINED(GLB_WIN)}
- libglu = 'glu32.dll';
- libopengl = 'opengl32.dll';
-{$ELSEIF DEFINED(GLB_LINUX)}
- libglu = 'libGLU.so.1';
- libopengl = 'libGL.so.1';
-{$IFEND}
-
-type
- GLboolean = BYTEBOOL;
- GLint = Integer;
- GLsizei = Integer;
- GLuint = Cardinal;
- GLfloat = Single;
- GLenum = Cardinal;
-
- PGLvoid = Pointer;
- PGLboolean = ^GLboolean;
- PGLint = ^GLint;
- PGLuint = ^GLuint;
- PGLfloat = ^GLfloat;
-
- TglCompressedTexImage1D = procedure(target: GLenum; level: GLint; internalformat: GLenum; width: GLsizei; border: GLint; imageSize: GLsizei; const data: PGLvoid); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
- TglCompressedTexImage2D = procedure(target: GLenum; level: GLint; internalformat: GLenum; width: GLsizei; height: GLsizei; border: GLint; imageSize: GLsizei; const data: PGLvoid); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
- TglGetCompressedTexImage = procedure(target: GLenum; level: GLint; img: PGLvoid); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
-
-{$IF DEFINED(GLB_WIN)}
- TwglGetProcAddress = function (ProcName: PAnsiChar): Pointer; stdcall;
-{$ELSEIF DEFINED(GLB_LINUX)}
- TglXGetProcAddress = function(ProcName: PAnsiChar): Pointer; cdecl;
- TglXGetProcAddressARB = function(const name: PAnsiChar): pointer; cdecl;
-{$IFEND}
-
-{$IF DEFINED(GLB_NATIVE_OGL_DYNAMIC)}
- TglEnable = procedure(cap: GLenum); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
- TglDisable = procedure(cap: GLenum); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
-
- TglGetString = function(name: GLenum): PAnsiChar; {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
- TglGetIntegerv = procedure(pname: GLenum; params: PGLint); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
-
- TglTexParameteri = procedure(target: GLenum; pname: GLenum; param: GLint); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
- TglTexParameteriv = procedure(target: GLenum; pname: GLenum; const params: PGLint); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
- TglTexParameterfv = procedure(target: GLenum; pname: GLenum; const params: PGLfloat); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
- TglGetTexParameteriv = procedure(target: GLenum; pname: GLenum; params: PGLint); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
- TglGetTexParameterfv = procedure(target: GLenum; pname: GLenum; params: PGLfloat); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
- TglGetTexLevelParameteriv = procedure(target: GLenum; level: GLint; pname: GLenum; params: PGLint); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
- TglGetTexLevelParameterfv = procedure(target: GLenum; level: GLint; pname: GLenum; params: PGLfloat); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
-
- TglTexGeni = procedure(coord: GLenum; pname: GLenum; param: GLint); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
- TglGenTextures = procedure(n: GLsizei; textures: PGLuint); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
- TglBindTexture = procedure(target: GLenum; texture: GLuint); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
- TglDeleteTextures = procedure(n: GLsizei; const textures: PGLuint); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
-
- TglAreTexturesResident = function(n: GLsizei; const textures: PGLuint; residences: PGLboolean): GLboolean; {$IFDEF DGL_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
- TglReadPixels = procedure(x: GLint; y: GLint; width: GLsizei; height: GLsizei; format: GLenum; _type: GLenum; pixels: PGLvoid); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
- TglPixelStorei = procedure(pname: GLenum; param: GLint); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
-
- TglTexImage1D = procedure(target: GLenum; level: GLint; internalformat: GLint; width: GLsizei; border: GLint; format: GLenum; _type: GLenum; const pixels: PGLvoid); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
- TglTexImage2D = procedure(target: GLenum; level: GLint; internalformat: GLint; width: GLsizei; height: GLsizei; border: GLint; format: GLenum; _type: GLenum; const pixels: PGLvoid); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
- TglGetTexImage = procedure(target: GLenum; level: GLint; format: GLenum; _type: GLenum; pixels: PGLvoid); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
-
- TgluBuild1DMipmaps = function(target: GLEnum; components, width: GLint; format, atype: GLEnum; const data: Pointer): GLint; {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
- TgluBuild2DMipmaps = function(target: GLEnum; components, width, height: GLint; format, atype: GLEnum; const Data: Pointer): GLint; {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
-
-{$ELSEIF DEFINED(GLB_NATIVE_OGL_STATIC)}
- procedure glEnable(cap: GLenum); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF} external libopengl;
- procedure glDisable(cap: GLenum); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF} external libopengl;
-
- function glGetString(name: GLenum): PAnsiChar; {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF} external libopengl;
- procedure glGetIntegerv(pname: GLenum; params: PGLint); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF} external libopengl;
-
- procedure glTexParameteri(target: GLenum; pname: GLenum; param: GLint); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF} external libopengl;
- procedure glTexParameteriv(target: GLenum; pname: GLenum; const params: PGLint); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF} external libopengl;
- procedure glTexParameterfv(target: GLenum; pname: GLenum; const params: PGLfloat); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF} external libopengl;
- procedure glGetTexParameteriv(target: GLenum; pname: GLenum; params: PGLint); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF} external libopengl;
- procedure glGetTexParameterfv(target: GLenum; pname: GLenum; params: PGLfloat); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF} external libopengl;
- procedure glGetTexLevelParameteriv(target: GLenum; level: GLint; pname: GLenum; params: PGLint); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF} external libopengl;
- procedure glGetTexLevelParameterfv(target: GLenum; level: GLint; pname: GLenum; params: PGLfloat); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF} external libopengl;
-
- procedure glTexGeni(coord: GLenum; pname: GLenum; param: GLint); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF} external libopengl;
- procedure glGenTextures(n: GLsizei; textures: PGLuint); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF} external libopengl;
- procedure glBindTexture(target: GLenum; texture: GLuint); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF} external libopengl;
- procedure glDeleteTextures(n: GLsizei; const textures: PGLuint); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF} external libopengl;
-
- function glAreTexturesResident(n: GLsizei; const textures: PGLuint; residences: PGLboolean): GLboolean; {$IFDEF DGL_WIN}stdcall; {$ELSE}cdecl; {$ENDIF} external libopengl;
- procedure glReadPixels(x: GLint; y: GLint; width: GLsizei; height: GLsizei; format: GLenum; _type: GLenum; pixels: PGLvoid); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF} external libopengl;
- procedure glPixelStorei(pname: GLenum; param: GLint); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF} external libopengl;
-
- procedure glTexImage1D(target: GLenum; level: GLint; internalformat: GLint; width: GLsizei; border: GLint; format: GLenum; _type: GLenum; const pixels: PGLvoid); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF} external libopengl;
- procedure glTexImage2D(target: GLenum; level: GLint; internalformat: GLint; width: GLsizei; height: GLsizei; border: GLint; format: GLenum; _type: GLenum; const pixels: PGLvoid); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF} external libopengl;
- procedure glGetTexImage(target: GLenum; level: GLint; format: GLenum; _type: GLenum; pixels: PGLvoid); {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF} external libopengl;
-
- function gluBuild1DMipmaps(target: GLEnum; components, width: GLint; format, atype: GLEnum; const data: Pointer): GLint; {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF} external libglu;
- function gluBuild2DMipmaps(target: GLEnum; components, width, height: GLint; format, atype: GLEnum; const Data: Pointer): GLint; {$IFDEF GLB_WIN}stdcall; {$ELSE}cdecl; {$ENDIF} external libglu;
-{$IFEND}
-
-var
- GL_VERSION_1_2,
- GL_VERSION_1_3,
- GL_VERSION_1_4,
- GL_VERSION_2_0,
- GL_VERSION_3_3,
-
- GL_SGIS_generate_mipmap,
-
- GL_ARB_texture_border_clamp,
- GL_ARB_texture_mirrored_repeat,
- GL_ARB_texture_rectangle,
- GL_ARB_texture_non_power_of_two,
- GL_ARB_texture_swizzle,
- GL_ARB_texture_cube_map,
-
- GL_IBM_texture_mirrored_repeat,
-
- GL_NV_texture_rectangle,
-
- GL_EXT_texture_edge_clamp,
- GL_EXT_texture_rectangle,
- GL_EXT_texture_swizzle,
- GL_EXT_texture_cube_map,
- GL_EXT_texture_filter_anisotropic: Boolean;
-
- glCompressedTexImage1D: TglCompressedTexImage1D;
- glCompressedTexImage2D: TglCompressedTexImage2D;
- glGetCompressedTexImage: TglGetCompressedTexImage;
-
-{$IF DEFINED(GLB_WIN)}
- wglGetProcAddress: TwglGetProcAddress;
-{$ELSEIF DEFINED(GLB_LINUX)}
- glXGetProcAddress: TglXGetProcAddress;
- glXGetProcAddressARB: TglXGetProcAddress;
-{$IFEND}
-
-{$IFDEF GLB_NATIVE_OGL_DYNAMIC}
- glEnable: TglEnable;
- glDisable: TglDisable;
-
- glGetString: TglGetString;
- glGetIntegerv: TglGetIntegerv;
-
- glTexParameteri: TglTexParameteri;
- glTexParameteriv: TglTexParameteriv;
- glTexParameterfv: TglTexParameterfv;
- glGetTexParameteriv: TglGetTexParameteriv;
- glGetTexParameterfv: TglGetTexParameterfv;
- glGetTexLevelParameteriv: TglGetTexLevelParameteriv;
- glGetTexLevelParameterfv: TglGetTexLevelParameterfv;
-
- glTexGeni: TglTexGeni;
- glGenTextures: TglGenTextures;
- glBindTexture: TglBindTexture;
- glDeleteTextures: TglDeleteTextures;
-
- glAreTexturesResident: TglAreTexturesResident;
- glReadPixels: TglReadPixels;
- glPixelStorei: TglPixelStorei;
-
- glTexImage1D: TglTexImage1D;
- glTexImage2D: TglTexImage2D;
- glGetTexImage: TglGetTexImage;
-
- gluBuild1DMipmaps: TgluBuild1DMipmaps;
- gluBuild2DMipmaps: TgluBuild2DMipmaps;
-{$ENDIF}
-{$ENDIF}
-