/*
 * Copyright (c) 2011-2024 Ross Cunniff
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

/*
 * OADL OGL ES 2.0 header file.  The original Khronos gl2.h from which this
 * was derived is licensed as follows:
 *
 *   This document is licensed under the SGI Free Software B License Version
 *   2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
 */

namespace gl2 {

/* OpenGL ES core versions */
const ES_VERSION_2_0 = 1;

/* ClearBufferMask */
const DEPTH_BUFFER_BIT = 0x00000100;
const STENCIL_BUFFER_BIT = 0x00000400;
const COLOR_BUFFER_BIT = 0x00004000;

/* Boolean */
const FALSE = 0;
const TRUE = 1;

/* BeginMode */
const POINTS = 0x0000;
const LINES = 0x0001;
const LINE_LOOP = 0x0002;
const LINE_STRIP = 0x0003;
const TRIANGLES = 0x0004;
const TRIANGLE_STRIP = 0x0005;
const TRIANGLE_FAN = 0x0006;

/* AlphaFunction (not supported in ES20) */
/*      NEVER */
/*      LESS */
/*      EQUAL */
/*      LEQUAL */
/*      GREATER */
/*      NOTEQUAL */
/*      GEQUAL */
/*      ALWAYS */

/* BlendingFactorDest */
const ZERO = 0;
const ONE = 1;
const SRC_COLOR = 0x0300;
const ONE_MINUS_SRC_COLOR = 0x0301;
const SRC_ALPHA = 0x0302;
const ONE_MINUS_SRC_ALPHA = 0x0303;
const DST_ALPHA = 0x0304;
const ONE_MINUS_DST_ALPHA = 0x0305;

/* BlendingFactorSrc */
/*      ZERO */
/*      ONE */
const DST_COLOR = 0x0306;
const ONE_MINUS_DST_COLOR = 0x0307;
const SRC_ALPHA_SATURATE = 0x0308;
/*      SRC_ALPHA */
/*      ONE_MINUS_SRC_ALPHA */
/*      DST_ALPHA */
/*      ONE_MINUS_DST_ALPHA */

/* BlendEquationSeparate */
const FUNC_ADD = 0x8006;
const BLEND_EQUATION = 0x8009;
const BLEND_EQUATION_RGB = 0x8009    /* same as BLEND_EQUATION */;
const BLEND_EQUATION_ALPHA = 0x883D;

/* BlendSubtract */
const FUNC_SUBTRACT = 0x800A;
const FUNC_REVERSE_SUBTRACT = 0x800B;

/* Separate Blend Functions */
const BLEND_DST_RGB = 0x80C8;
const BLEND_SRC_RGB = 0x80C9;
const BLEND_DST_ALPHA = 0x80CA;
const BLEND_SRC_ALPHA = 0x80CB;
const CONSTANT_COLOR = 0x8001;
const ONE_MINUS_CONSTANT_COLOR = 0x8002;
const CONSTANT_ALPHA = 0x8003;
const ONE_MINUS_CONSTANT_ALPHA = 0x8004;
const BLEND_COLOR = 0x8005;

/* Buffer Objects */
const ARRAY_BUFFER = 0x8892;
const ELEMENT_ARRAY_BUFFER = 0x8893;
const ARRAY_BUFFER_BINDING = 0x8894;
const ELEMENT_ARRAY_BUFFER_BINDING = 0x8895;

const STREAM_DRAW = 0x88E0;
const STATIC_DRAW = 0x88E4;
const DYNAMIC_DRAW = 0x88E8;

const BUFFER_SIZE = 0x8764;
const BUFFER_USAGE = 0x8765;

const CURRENT_VERTEX_ATTRIB = 0x8626;

/* CullFaceMode */
const FRONT = 0x0404;
const BACK = 0x0405;
const FRONT_AND_BACK = 0x0408;

/* DepthFunction */
/*      NEVER */
/*      LESS */
/*      EQUAL */
/*      LEQUAL */
/*      GREATER */
/*      NOTEQUAL */
/*      GEQUAL */
/*      ALWAYS */

/* EnableCap */
const TEXTURE_2D = 0x0DE1;
const CULL_FACE = 0x0B44;
const BLEND = 0x0BE2;
const DITHER = 0x0BD0;
const STENCIL_TEST = 0x0B90;
const DEPTH_TEST = 0x0B71;
const SCISSOR_TEST = 0x0C11;
const POLYGON_OFFSET_FILL = 0x8037;
const SAMPLE_ALPHA_TO_COVERAGE = 0x809E;
const SAMPLE_COVERAGE = 0x80A0;

/* ErrorCode */
const NO_ERROR = 0;
const INVALID_ENUM = 0x0500;
const INVALID_VALUE = 0x0501;
const INVALID_OPERATION = 0x0502;
const OUT_OF_MEMORY = 0x0505;

/* FrontFaceDirection */
const CW = 0x0900;
const CCW = 0x0901;

/* GetPName */
const LINE_WIDTH = 0x0B21;
const ALIASED_POINT_SIZE_RANGE = 0x846D;
const ALIASED_LINE_WIDTH_RANGE = 0x846E;
const CULL_FACE_MODE = 0x0B45;
const FRONT_FACE = 0x0B46;
const DEPTH_RANGE = 0x0B70;
const DEPTH_WRITEMASK = 0x0B72;
const DEPTH_CLEAR_VALUE = 0x0B73;
const DEPTH_FUNC = 0x0B74;
const STENCIL_CLEAR_VALUE = 0x0B91;
const STENCIL_FUNC = 0x0B92;
const STENCIL_FAIL = 0x0B94;
const STENCIL_PASS_DEPTH_FAIL = 0x0B95;
const STENCIL_PASS_DEPTH_PASS = 0x0B96;
const STENCIL_REF = 0x0B97;
const STENCIL_VALUE_MASK = 0x0B93;
const STENCIL_WRITEMASK = 0x0B98;
const STENCIL_BACK_FUNC = 0x8800;
const STENCIL_BACK_FAIL = 0x8801;
const STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802;
const STENCIL_BACK_PASS_DEPTH_PASS = 0x8803;
const STENCIL_BACK_REF = 0x8CA3;
const STENCIL_BACK_VALUE_MASK = 0x8CA4;
const STENCIL_BACK_WRITEMASK = 0x8CA5;
const VIEWPORT = 0x0BA2;
const SCISSOR_BOX = 0x0C10;
/*      SCISSOR_TEST */
const COLOR_CLEAR_VALUE = 0x0C22;
const COLOR_WRITEMASK = 0x0C23;
const UNPACK_ALIGNMENT = 0x0CF5;
const PACK_ALIGNMENT = 0x0D05;
const MAX_TEXTURE_SIZE = 0x0D33;
const MAX_VIEWPORT_DIMS = 0x0D3A;
const SUBPIXEL_BITS = 0x0D50;
const RED_BITS = 0x0D52;
const GREEN_BITS = 0x0D53;
const BLUE_BITS = 0x0D54;
const ALPHA_BITS = 0x0D55;
const DEPTH_BITS = 0x0D56;
const STENCIL_BITS = 0x0D57;
const POLYGON_OFFSET_UNITS = 0x2A00;
/*      POLYGON_OFFSET_FILL */
const POLYGON_OFFSET_FACTOR = 0x8038;
const TEXTURE_BINDING_2D = 0x8069;
const SAMPLE_BUFFERS = 0x80A8;
const SAMPLES = 0x80A9;
const SAMPLE_COVERAGE_VALUE = 0x80AA;
const SAMPLE_COVERAGE_INVERT = 0x80AB;

/* GetTextureParameter */
/*      TEXTURE_MAG_FILTER */
/*      TEXTURE_MIN_FILTER */
/*      TEXTURE_WRAP_S */
/*      TEXTURE_WRAP_T */

const NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2;
const COMPRESSED_TEXTURE_FORMATS = 0x86A3;

/* HintMode */
const DONT_CARE = 0x1100;
const FASTEST = 0x1101;
const NICEST = 0x1102;

/* HintTarget */
const GENERATE_MIPMAP_HINT = 0x8192;

/* DataType */
const BYTE = 0x1400;
const UNSIGNED_BYTE = 0x1401;
const SHORT = 0x1402;
const UNSIGNED_SHORT = 0x1403;
const INT = 0x1404;
const UNSIGNED_INT = 0x1405;
const FLOAT = 0x1406;
const FIXED = 0x140C;

/* PixelFormat */
const DEPTH_COMPONENT = 0x1902;
const ALPHA = 0x1906;
const RGB = 0x1907;
const RGBA = 0x1908;
const LUMINANCE = 0x1909;
const LUMINANCE_ALPHA = 0x190A;

/* PixelType */
/*      UNSIGNED_BYTE */
const UNSIGNED_SHORT_4_4_4_4 = 0x8033;
const UNSIGNED_SHORT_5_5_5_1 = 0x8034;
const UNSIGNED_SHORT_5_6_5 = 0x8363;

/* Shaders */
const FRAGMENT_SHADER = 0x8B30;
const VERTEX_SHADER = 0x8B31;
const MAX_VERTEX_ATTRIBS = 0x8869;
const MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB;
const MAX_VARYING_VECTORS = 0x8DFC;
const MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D;
const MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C;
const MAX_TEXTURE_IMAGE_UNITS = 0x8872;
const MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD;
const SHADER_TYPE = 0x8B4F;
const DELETE_STATUS = 0x8B80;
const LINK_STATUS = 0x8B82;
const VALIDATE_STATUS = 0x8B83;
const ATTACHED_SHADERS = 0x8B85;
const ACTIVE_UNIFORMS = 0x8B86;
const ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87;
const ACTIVE_ATTRIBUTES = 0x8B89;
const ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A;
const SHADING_LANGUAGE_VERSION = 0x8B8C;
const CURRENT_PROGRAM = 0x8B8D;

/* StencilFunction */
const NEVER = 0x0200;
const LESS = 0x0201;
const EQUAL = 0x0202;
const LEQUAL = 0x0203;
const GREATER = 0x0204;
const NOTEQUAL = 0x0205;
const GEQUAL = 0x0206;
const ALWAYS = 0x0207;

/* StencilOp */
/*      ZERO */
const KEEP = 0x1E00;
const REPLACE = 0x1E01;
const INCR = 0x1E02;
const DECR = 0x1E03;
const INVERT = 0x150A;
const INCR_WRAP = 0x8507;
const DECR_WRAP = 0x8508;

/* StringName */
const VENDOR = 0x1F00;
const RENDERER = 0x1F01;
const VERSION = 0x1F02;
const EXTENSIONS = 0x1F03;

/* TextureMagFilter */
const NEAREST = 0x2600;
const LINEAR = 0x2601;

/* TextureMinFilter */
/*      NEAREST */
/*      LINEAR */
const NEAREST_MIPMAP_NEAREST = 0x2700;
const LINEAR_MIPMAP_NEAREST = 0x2701;
const NEAREST_MIPMAP_LINEAR = 0x2702;
const LINEAR_MIPMAP_LINEAR = 0x2703;

/* TextureParameterName */
const TEXTURE_MAG_FILTER = 0x2800;
const TEXTURE_MIN_FILTER = 0x2801;
const TEXTURE_WRAP_S = 0x2802;
const TEXTURE_WRAP_T = 0x2803;

/* TextureTarget */
/*      TEXTURE_2D */
const TEXTURE = 0x1702;

const TEXTURE_CUBE_MAP = 0x8513;
const TEXTURE_BINDING_CUBE_MAP = 0x8514;
const TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;
const TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516;
const TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517;
const TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;
const TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
const TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A;
const MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C;

/* TextureUnit */
const TEXTURE0 = 0x84C0;
const TEXTURE1 = 0x84C1;
const TEXTURE2 = 0x84C2;
const TEXTURE3 = 0x84C3;
const TEXTURE4 = 0x84C4;
const TEXTURE5 = 0x84C5;
const TEXTURE6 = 0x84C6;
const TEXTURE7 = 0x84C7;
const TEXTURE8 = 0x84C8;
const TEXTURE9 = 0x84C9;
const TEXTURE10 = 0x84CA;
const TEXTURE11 = 0x84CB;
const TEXTURE12 = 0x84CC;
const TEXTURE13 = 0x84CD;
const TEXTURE14 = 0x84CE;
const TEXTURE15 = 0x84CF;
const TEXTURE16 = 0x84D0;
const TEXTURE17 = 0x84D1;
const TEXTURE18 = 0x84D2;
const TEXTURE19 = 0x84D3;
const TEXTURE20 = 0x84D4;
const TEXTURE21 = 0x84D5;
const TEXTURE22 = 0x84D6;
const TEXTURE23 = 0x84D7;
const TEXTURE24 = 0x84D8;
const TEXTURE25 = 0x84D9;
const TEXTURE26 = 0x84DA;
const TEXTURE27 = 0x84DB;
const TEXTURE28 = 0x84DC;
const TEXTURE29 = 0x84DD;
const TEXTURE30 = 0x84DE;
const TEXTURE31 = 0x84DF;
const ACTIVE_TEXTURE = 0x84E0;

/* TextureWrapMode */
const REPEAT = 0x2901;
const CLAMP_TO_EDGE = 0x812F;
const MIRRORED_REPEAT = 0x8370;

/* Uniform Types */
const FLOAT_VEC2 = 0x8B50;
const FLOAT_VEC3 = 0x8B51;
const FLOAT_VEC4 = 0x8B52;
const INT_VEC2 = 0x8B53;
const INT_VEC3 = 0x8B54;
const INT_VEC4 = 0x8B55;
const BOOL = 0x8B56;
const BOOL_VEC2 = 0x8B57;
const BOOL_VEC3 = 0x8B58;
const BOOL_VEC4 = 0x8B59;
const FLOAT_MAT2 = 0x8B5A;
const FLOAT_MAT3 = 0x8B5B;
const FLOAT_MAT4 = 0x8B5C;
const SAMPLER_2D = 0x8B5E;
const SAMPLER_CUBE = 0x8B60;

/* Vertex Arrays */
const VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622;
const VERTEX_ATTRIB_ARRAY_SIZE = 0x8623;
const VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624;
const VERTEX_ATTRIB_ARRAY_TYPE = 0x8625;
const VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A;
const VERTEX_ATTRIB_ARRAY_POINTER = 0x8645;
const VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F;

/* Read Format */
const IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A;
const IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B;

/* Shader Source */
const COMPILE_STATUS = 0x8B81;
const INFO_LOG_LENGTH = 0x8B84;
const SHADER_SOURCE_LENGTH = 0x8B88;
const SHADER_COMPILER = 0x8DFA;

/* Shader Binary */
const SHADER_BINARY_FORMATS = 0x8DF8;
const NUM_SHADER_BINARY_FORMATS = 0x8DF9;

/* Shader Precision-Specified Types */
const LOW_FLOAT = 0x8DF0;
const MEDIUM_FLOAT = 0x8DF1;
const HIGH_FLOAT = 0x8DF2;
const LOW_INT = 0x8DF3;
const MEDIUM_INT = 0x8DF4;
const HIGH_INT = 0x8DF5;

/* Framebuffer Object. */
const FRAMEBUFFER = 0x8D40;
const RENDERBUFFER = 0x8D41;

const RGBA4 = 0x8056;
const RGB5_A1 = 0x8057;
const RGB565 = 0x8D62;
const DEPTH_COMPONENT16 = 0x81A5;
const STENCIL_INDEX = 0x1901;
const STENCIL_INDEX8 = 0x8D48;

const RENDERBUFFER_WIDTH = 0x8D42;
const RENDERBUFFER_HEIGHT = 0x8D43;
const RENDERBUFFER_INTERNAL_FORMAT = 0x8D44;
const RENDERBUFFER_RED_SIZE = 0x8D50;
const RENDERBUFFER_GREEN_SIZE = 0x8D51;
const RENDERBUFFER_BLUE_SIZE = 0x8D52;
const RENDERBUFFER_ALPHA_SIZE = 0x8D53;
const RENDERBUFFER_DEPTH_SIZE = 0x8D54;
const RENDERBUFFER_STENCIL_SIZE = 0x8D55;

const FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0;
const FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1;
const FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2;
const FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3;

const COLOR_ATTACHMENT0 = 0x8CE0;
const DEPTH_ATTACHMENT = 0x8D00;
const STENCIL_ATTACHMENT = 0x8D20;

const NONE = 0;

const FRAMEBUFFER_COMPLETE = 0x8CD5;
const FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6;
const FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7;
const FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9;
const FRAMEBUFFER_UNSUPPORTED = 0x8CDD;

const FRAMEBUFFER_BINDING = 0x8CA6;
const RENDERBUFFER_BINDING = 0x8CA7;
const MAX_RENDERBUFFER_SIZE = 0x84E8;

const INVALID_FRAMEBUFFER_OPERATION = 0x0506;

/*-------------------------------------------------------------------------
 * GL core functions.
 *-----------------------------------------------------------------------*/

extern ActiveTexture; // enum texture
extern AttachShader; // uint program, uint shader
extern BindAttribLocation; // uint program, uint index, const char* name
extern BindBuffer; // enum target, uint buffer
extern BindFramebuffer; // enum target, uint framebuffer
extern BindRenderbuffer; // enum target, uint renderbuffer
extern BindTexture; // enum target, uint texture
extern BlendColor; // clampf red, clampf green, clampf blue, clampf alpha
extern BlendEquation; //  enum mode 
extern BlendEquationSeparate; // enum modeRGB, enum modeAlpha
extern BlendFunc; // enum sfactor, enum dfactor
extern BlendFuncSeparate; // enum srcRGB, enum dstRGB, enum srcAlpha, enum dstAlpha
extern BufferData; // enum target, sizeiptr size, const void* data, enum usage
extern BufferSubData; // enum target, intptr offset, sizeiptr size, const void* data
extern /*enum*/ CheckFramebufferStatus; // enum target
extern Clear; // bitfield mask
extern ClearColor; // clampf red, clampf green, clampf blue, clampf alpha
extern ClearDepthf; // clampf depth
extern ClearStencil; // int s
extern ColorMask; // boolean red, boolean green, boolean blue, boolean alpha
extern CompileShader; // uint shader
extern CompressedTexImage2D; // enum target, int level, enum internalformat, sizei width, sizei height, int border, sizei imageSize, const void* data
extern CompressedTexSubImage2D; // enum target, int level, int xoffset, int yoffset, sizei width, sizei height, enum format, sizei imageSize, const void* data
extern CopyTexImage2D; // enum target, int level, enum internalformat, int x, int y, sizei width, sizei height, int border
extern CopyTexSubImage2D; // enum target, int level, int xoffset, int yoffset, int x, int y, sizei width, sizei height
extern /*uint*/ CreateProgram; // void
extern /*uint*/ CreateShader; // enum type
extern CullFace; // enum mode
extern DeleteBuffers; // sizei n, const uint* buffers
extern DeleteFramebuffers; // sizei n, const uint* framebuffers
extern DeleteProgram; // uint program
extern DeleteRenderbuffers; // sizei n, const uint* renderbuffers
extern DeleteShader; // uint shader
extern DeleteTextures; // sizei n, const uint* textures
extern DepthFunc; // enum func
extern DepthMask; // boolean flag
extern DepthRangef; // clampf zNear, clampf zFar
extern DetachShader; // uint program, uint shader
extern Disable; // enum cap
extern DisableVertexAttribArray; // uint index
extern DrawArrays; // enum mode, int first, sizei count
extern DrawElements; // enum mode, sizei count, enum type, const void* indices
extern Enable; // enum cap
extern EnableVertexAttribArray; // uint index
extern Finish; // void
extern Flush; // void
extern FramebufferRenderbuffer; // enum target, enum attachment, enum renderbuffertarget, uint renderbuffer
extern FramebufferTexture2D; // enum target, enum attachment, enum textarget, uint texture, int level
extern FrontFace; // enum mode
extern GenBuffers; // sizei n, uint* buffers
extern GenerateMipmap; // enum target
extern GenFramebuffers; // sizei n, uint* framebuffers
extern GenRenderbuffers; // sizei n, uint* renderbuffers
extern GenTextures; // sizei n, uint* textures
extern GetActiveAttrib; // uint program, uint index, sizei bufsize, sizei* length, int* size, enum* type, char* name
extern GetActiveUniform; // uint program, uint index, sizei bufsize, sizei* length, int* size, enum* type, char* name
extern GetAttachedShaders; // uint program, sizei maxcount, sizei* count, uint* shaders
extern /*int*/ GetAttribLocation; // uint program, const char* name
extern GetBooleanv; // enum pname, boolean* params
extern GetBufferParameteriv; // enum target, enum pname, int* params
extern /*enum*/ GetError; // void
extern GetFloatv; // enum pname, float* params
extern GetFramebufferAttachmentParameteriv; // enum target, enum attachment, enum pname, int* params
extern GetIntegerv; // enum pname, int* params
extern GetProgramiv; // uint program, enum pname, int* params
extern GetProgramInfoLog; // uint program, sizei bufsize, sizei* length, char* infolog
extern GetRenderbufferParameteriv; // enum target, enum pname, int* params
extern GetShaderiv; // uint shader, enum pname, int* params
extern GetShaderInfoLog; // uint shader, sizei bufsize, sizei* length, char* infolog
extern GetShaderPrecisionFormat; // enum shadertype, enum precisiontype, int* range, int* precision
extern GetShaderSource; // uint shader, sizei bufsize, sizei* length, char* source
extern /*const ubyte* */ GetString; // enum name
extern GetTexParameterfv; // enum target, enum pname, float* params
extern GetTexParameteriv; // enum target, enum pname, int* params
extern GetUniformfv; // uint program, int location, float* params
extern GetUniformiv; // uint program, int location, int* params
extern /*int*/ GetUniformLocation; // uint program, const char* name
extern GetVertexAttribfv; // uint index, enum pname, float* params
extern GetVertexAttribiv; // uint index, enum pname, int* params
extern GetVertexAttribPointerv; // uint index, enum pname, void** pointer
extern Hint; // enum target, enum mode
extern /*boolean*/ IsBuffer; // uint buffer
extern /*boolean*/ IsEnabled; // enum cap
extern /*boolean*/ IsFramebuffer; // uint framebuffer
extern /*boolean*/ IsProgram; // uint program
extern /*boolean*/ IsRenderbuffer; // uint renderbuffer
extern /*boolean*/ IsShader; // uint shader
extern /*boolean*/ IsTexture; // uint texture
extern LineWidth; // float width
extern LinkProgram; // uint program
extern PixelStorei; // enum pname, int param
extern PolygonOffset; // float factor, float units
extern ReadPixels; // int x, int y, sizei width, sizei height, enum format, enum type, void* pixels
extern ReleaseShaderCompiler; // void
extern RenderbufferStorage; // enum target, enum internalformat, sizei width, sizei height
extern SampleCoverage; // clampf value, boolean invert
extern Scissor; // int x, int y, sizei width, sizei height
extern ShaderBinary; // sizei n, const uint* shaders, enum binaryformat, const void* binary, sizei length
extern ShaderSource; // uint shader, sizei count, const char** string, const int* length
extern StencilFunc; // enum func, int ref, uint mask
extern StencilFuncSeparate; // enum face, enum func, int ref, uint mask
extern StencilMask; // uint mask
extern StencilMaskSeparate; // enum face, uint mask
extern StencilOp; // enum fail, enum zfail, enum zpass
extern StencilOpSeparate; // enum face, enum fail, enum zfail, enum zpass
extern TexImage2D; // enum target, int level, int internalformat, sizei width, sizei height, int border, enum format, enum type, const void* pixels
extern TexParameterf; // enum target, enum pname, float param
extern TexParameterfv; // enum target, enum pname, const float* params
extern TexParameteri; // enum target, enum pname, int param
extern TexParameteriv; // enum target, enum pname, const int* params
extern TexSubImage2D; // enum target, int level, int xoffset, int yoffset, sizei width, sizei height, enum format, enum type, const void* pixels
extern Uniform1f; // int location, float x
extern Uniform1fv; // int location, sizei count, const float* v
extern Uniform1i; // int location, int x
extern Uniform1iv; // int location, sizei count, const int* v
extern Uniform2f; // int location, float x, float y
extern Uniform2fv; // int location, sizei count, const float* v
extern Uniform2i; // int location, int x, int y
extern Uniform2iv; // int location, sizei count, const int* v
extern Uniform3f; // int location, float x, float y, float z
extern Uniform3fv; // int location, sizei count, const float* v
extern Uniform3i; // int location, int x, int y, int z
extern Uniform3iv; // int location, sizei count, const int* v
extern Uniform4f; // int location, float x, float y, float z, float w
extern Uniform4fv; // int location, sizei count, const float* v
extern Uniform4i; // int location, int x, int y, int z, int w
extern Uniform4iv; // int location, sizei count, const int* v
extern UniformMatrix2fv; // int location, sizei count, boolean transpose, const float* value
extern UniformMatrix3fv; // int location, sizei count, boolean transpose, const float* value
extern UniformMatrix4fv; // int location, sizei count, boolean transpose, const float* value
extern UseProgram; // uint program
extern ValidateProgram; // uint program
extern VertexAttrib1f; // uint indx, float x
extern VertexAttrib1fv; // uint indx, const float* values
extern VertexAttrib2f; // uint indx, float x, float y
extern VertexAttrib2fv; // uint indx, const float* values
extern VertexAttrib3f; // uint indx, float x, float y, float z
extern VertexAttrib3fv; // uint indx, const float* values
extern VertexAttrib4f; // uint indx, float x, float y, float z, float w
extern VertexAttrib4fv; // uint indx, const float* values
extern VertexAttribPointer; // uint indx, int size, enum type, boolean normalized, sizei stride, const void* ptr
extern Viewport; // int x, int y, sizei width, sizei height

}

using extern "libgl2";