From 05d842bcd81ac5bb213ee34821c7df232dff55da Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Mon, 3 Dec 2012 13:11:06 +0400 Subject: [PATCH] a bit more opengl refactoring: * added Access parameter to GlBuffer::mapHost * added autoRelease parameter to all create methods * fixed indentation in gl_core_3_1 * minor improvments for opengl sample --- .../include/opencv2/core/opengl_interop.hpp | 33 +- modules/core/src/gl_core_3_1.cpp | 5371 ++++++++--------- modules/core/src/gl_core_3_1.hpp | 2429 ++++---- modules/core/src/opengl_interop.cpp | 74 +- modules/gpu/test/test_opengl.cpp | 25 +- samples/gpu/opengl.cpp | 13 +- 6 files changed, 3945 insertions(+), 4000 deletions(-) diff --git a/modules/core/include/opencv2/core/opengl_interop.hpp b/modules/core/include/opencv2/core/opengl_interop.hpp index 91fba7b7f9..cda1a8b5df 100644 --- a/modules/core/include/opencv2/core/opengl_interop.hpp +++ b/modules/core/include/opencv2/core/opengl_interop.hpp @@ -71,6 +71,13 @@ public: PIXEL_UNPACK_BUFFER = 0x88EC //!< The buffer will be used for writing to OpenGL textures }; + enum Access + { + READ_ONLY = 0x88B8, + WRITE_ONLY = 0x88B9, + READ_WRITE = 0x88BA + }; + //! create empty buffer GlBuffer(); @@ -79,15 +86,15 @@ public: GlBuffer(Size asize, int atype, unsigned int abufId, bool autoRelease = false); //! create buffer - GlBuffer(int arows, int acols, int atype, Target target = ARRAY_BUFFER); - GlBuffer(Size asize, int atype, Target target = ARRAY_BUFFER); + GlBuffer(int arows, int acols, int atype, Target target = ARRAY_BUFFER, bool autoRelease = false); + GlBuffer(Size asize, int atype, Target target = ARRAY_BUFFER, bool autoRelease = false); //! copy from host/device memory - explicit GlBuffer(InputArray arr, Target target = ARRAY_BUFFER); + explicit GlBuffer(InputArray arr, Target target = ARRAY_BUFFER, bool autoRelease = false); //! create buffer - void create(int arows, int acols, int atype, Target target = ARRAY_BUFFER); - void create(Size asize, int atype, Target target = ARRAY_BUFFER) { create(asize.height, asize.width, atype, target); } + void create(int arows, int acols, int atype, Target target = ARRAY_BUFFER, bool autoRelease = false); + void create(Size asize, int atype, Target target = ARRAY_BUFFER, bool autoRelease = false) { create(asize.height, asize.width, atype, target, autoRelease); } //! release memory and delete buffer object void release(); @@ -96,7 +103,7 @@ public: void setAutoRelease(bool flag); //! copy from host/device memory - void copyFrom(InputArray arr, Target target = ARRAY_BUFFER); + void copyFrom(InputArray arr, Target target = ARRAY_BUFFER, bool autoRelease = false); //! copy to host/device memory void copyTo(OutputArray arr, Target target = ARRAY_BUFFER) const; @@ -111,7 +118,7 @@ public: static void unbind(Target target); //! map to host memory - Mat mapHost(); + Mat mapHost(Access access); void unmapHost(); //! map to device memory @@ -162,15 +169,15 @@ public: GlTexture2D(Size asize, Format aformat, unsigned int atexId, bool autoRelease = false); //! create texture - GlTexture2D(int arows, int acols, Format aformat); - GlTexture2D(Size asize, Format aformat); + GlTexture2D(int arows, int acols, Format aformat, bool autoRelease = false); + GlTexture2D(Size asize, Format aformat, bool autoRelease = false); //! copy from host/device memory - explicit GlTexture2D(InputArray arr); + explicit GlTexture2D(InputArray arr, bool autoRelease = false); //! create texture - void create(int arows, int acols, Format aformat); - void create(Size asize, Format aformat) { create(asize.height, asize.width, aformat); } + void create(int arows, int acols, Format aformat, bool autoRelease = false); + void create(Size asize, Format aformat, bool autoRelease = false) { create(asize.height, asize.width, aformat, autoRelease); } //! release memory and delete texture object void release(); @@ -179,7 +186,7 @@ public: void setAutoRelease(bool flag); //! copy from host/device memory - void copyFrom(InputArray arr); + void copyFrom(InputArray arr, bool autoRelease = false); //! copy to host/device memory void copyTo(OutputArray arr, int ddepth = CV_32F) const; diff --git a/modules/core/src/gl_core_3_1.cpp b/modules/core/src/gl_core_3_1.cpp index 9e4865efb1..97c11d2e7d 100644 --- a/modules/core/src/gl_core_3_1.cpp +++ b/modules/core/src/gl_core_3_1.cpp @@ -2,88 +2,81 @@ #ifdef HAVE_OPENGL -#include -#include +#include #include "gl_core_3_1.hpp" #if defined(__APPLE__) -#include + #include -static void* AppleGLGetProcAddress (const GLubyte *name) -{ - static const struct mach_header* image = NULL; - NSSymbol symbol; - char* symbolName; - if (NULL == image) - { - image = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", NSADDIMAGE_OPTION_RETURN_ON_ERROR); - } - /* prepend a '_' for the Unix C symbol mangling convention */ - symbolName = malloc(strlen((const char*)name) + 2); - strcpy(symbolName+1, (const char*)name); - symbolName[0] = '_'; - symbol = NULL; - /* if (NSIsSymbolNameDefined(symbolName)) - symbol = NSLookupAndBindSymbol(symbolName); */ - symbol = image ? NSLookupSymbolInImage(image, symbolName, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) : NULL; - free(symbolName); - return symbol ? NSAddressOfSymbol(symbol) : NULL; -} -#endif /* __APPLE__ */ + static void* AppleGLGetProcAddress (const GLubyte *name) + { + static const struct mach_header* image = 0; + if (!image) + image = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", NSADDIMAGE_OPTION_RETURN_ON_ERROR); + + // prepend a '_' for the Unix C symbol mangling convention + std::string symbolName = "_"; + symbolName += std::string((const char*)name); + + NSSymbol symbol = image ? NSLookupSymbolInImage(image, &symbolName[0], NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) : 0; + + return symbol ? NSAddressOfSymbol(symbol) : 0; + } +#endif // __APPLE__ #if defined(__sgi) || defined (__sun) -#include -#include + #include + #include -static void* SunGetProcAddress (const GLubyte* name) -{ - static void* h = NULL; - static void* gpa; + static void* SunGetProcAddress (const GLubyte* name) + { + typedef void* (func_t*)(const GLubyte*); - if (h == NULL) - { - if ((h = dlopen(NULL, RTLD_LAZY | RTLD_LOCAL)) == NULL) return NULL; - gpa = dlsym(h, "glXGetProcAddress"); - } + static void* h = 0; + static func_t gpa = 0; - if (gpa != NULL) - return ((void*(*)(const GLubyte*))gpa)(name); - else - return dlsym(h, (const char*)name); -} + if (!h) + { + h = dlopen(NULL, RTLD_LAZY | RTLD_LOCAL); + if (!h) + return 0; + gpa = (func_t) dlsym(h, "glXGetProcAddress"); + } + + return gpa ? gpa(name) : dlsym(h, (const char*) name); + } #endif /* __sgi || __sun */ #if defined(_WIN32) + #ifdef _MSC_VER + #pragma warning(disable: 4055) + #pragma warning(disable: 4054) + #endif -#ifdef _MSC_VER -#pragma warning(disable: 4055) -#pragma warning(disable: 4054) -#endif - -static int TestPointer(const PROC pTest) -{ - ptrdiff_t iTest; - if(!pTest) return 0; - iTest = (ptrdiff_t)pTest; - - if(iTest == 1 || iTest == 2 || iTest == 3 || iTest == -1) return 0; - - return 1; -} - -static PROC WinGetProcAddress(const char *name) -{ - HMODULE glMod = NULL; - PROC pFunc = wglGetProcAddress((LPCSTR)name); - if(TestPointer(pFunc)) + static int TestPointer(const PROC pTest) { - return pFunc; - } - glMod = GetModuleHandleA("OpenGL32.dll"); - return (PROC)GetProcAddress(glMod, (LPCSTR)name); -} + if(!pTest) + return 0; -#define IntGetProcAddress(name) WinGetProcAddress(name) + ptrdiff_t iTest = (ptrdiff_t) pTest; + + if (iTest == 1 || iTest == 2 || iTest == 3 || iTest == -1) + return 0; + + return 1; + } + + static PROC WinGetProcAddress(const char* name) + { + PROC pFunc = wglGetProcAddress((LPCSTR) name); + if (TestPointer(pFunc)) + return pFunc; + + HMODULE glMod = GetModuleHandleA("OpenGL32.dll"); + return (PROC) GetProcAddress(glMod, (LPCSTR) name); + } + + #define IntGetProcAddress(name) WinGetProcAddress(name) #else #if defined(__APPLE__) #define IntGetProcAddress(name) AppleGLGetProcAddress(name) @@ -93,2688 +86,2618 @@ static PROC WinGetProcAddress(const char *name) #else /* GLX */ #include - #define IntGetProcAddress(name) (*glXGetProcAddressARB)((const GLubyte*)name) + #define IntGetProcAddress(name) (*glXGetProcAddressARB)((const GLubyte*) name) #endif #endif #endif namespace gl { - namespace exts - { - } - - // Extension: 1.1 - typedef void (CODEGEN_FUNCPTR *PFNCULLFACEPROC)(GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNFRONTFACEPROC)(GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNHINTPROC)(GLenum , GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNLINEWIDTHPROC)(GLfloat ); - typedef void (CODEGEN_FUNCPTR *PFNPOINTSIZEPROC)(GLfloat ); - typedef void (CODEGEN_FUNCPTR *PFNPOLYGONMODEPROC)(GLenum , GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNSCISSORPROC)(GLint , GLint , GLsizei , GLsizei ); - typedef void (CODEGEN_FUNCPTR *PFNTEXPARAMETERFPROC)(GLenum , GLenum , GLfloat ); - typedef void (CODEGEN_FUNCPTR *PFNTEXPARAMETERFVPROC)(GLenum , GLenum , const GLfloat *); - typedef void (CODEGEN_FUNCPTR *PFNTEXPARAMETERIPROC)(GLenum , GLenum , GLint ); - typedef void (CODEGEN_FUNCPTR *PFNTEXPARAMETERIVPROC)(GLenum , GLenum , const GLint *); - typedef void (CODEGEN_FUNCPTR *PFNTEXIMAGE1DPROC)(GLenum , GLint , GLint , GLsizei , GLint , GLenum , GLenum , const GLvoid *); - typedef void (CODEGEN_FUNCPTR *PFNTEXIMAGE2DPROC)(GLenum , GLint , GLint , GLsizei , GLsizei , GLint , GLenum , GLenum , const GLvoid *); - typedef void (CODEGEN_FUNCPTR *PFNDRAWBUFFERPROC)(GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNCLEARPROC)(GLbitfield ); - typedef void (CODEGEN_FUNCPTR *PFNCLEARCOLORPROC)(GLfloat , GLfloat , GLfloat , GLfloat ); - typedef void (CODEGEN_FUNCPTR *PFNCLEARSTENCILPROC)(GLint ); - typedef void (CODEGEN_FUNCPTR *PFNCLEARDEPTHPROC)(GLdouble ); - typedef void (CODEGEN_FUNCPTR *PFNSTENCILMASKPROC)(GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNCOLORMASKPROC)(GLboolean , GLboolean , GLboolean , GLboolean ); - typedef void (CODEGEN_FUNCPTR *PFNDEPTHMASKPROC)(GLboolean ); - typedef void (CODEGEN_FUNCPTR *PFNDISABLEPROC)(GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNENABLEPROC)(GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNFINISHPROC)(); - typedef void (CODEGEN_FUNCPTR *PFNFLUSHPROC)(); - typedef void (CODEGEN_FUNCPTR *PFNBLENDFUNCPROC)(GLenum , GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNLOGICOPPROC)(GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNSTENCILFUNCPROC)(GLenum , GLint , GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNSTENCILOPPROC)(GLenum , GLenum , GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNDEPTHFUNCPROC)(GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNPIXELSTOREFPROC)(GLenum , GLfloat ); - typedef void (CODEGEN_FUNCPTR *PFNPIXELSTOREIPROC)(GLenum , GLint ); - typedef void (CODEGEN_FUNCPTR *PFNREADBUFFERPROC)(GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNREADPIXELSPROC)(GLint , GLint , GLsizei , GLsizei , GLenum , GLenum , GLvoid *); - typedef void (CODEGEN_FUNCPTR *PFNGETBOOLEANVPROC)(GLenum , GLboolean *); - typedef void (CODEGEN_FUNCPTR *PFNGETDOUBLEVPROC)(GLenum , GLdouble *); - typedef GLenum (CODEGEN_FUNCPTR *PFNGETERRORPROC)(); - typedef void (CODEGEN_FUNCPTR *PFNGETFLOATVPROC)(GLenum , GLfloat *); - typedef void (CODEGEN_FUNCPTR *PFNGETINTEGERVPROC)(GLenum , GLint *); - typedef const GLubyte * (CODEGEN_FUNCPTR *PFNGETSTRINGPROC)(GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNGETTEXIMAGEPROC)(GLenum , GLint , GLenum , GLenum , GLvoid *); - typedef void (CODEGEN_FUNCPTR *PFNGETTEXPARAMETERFVPROC)(GLenum , GLenum , GLfloat *); - typedef void (CODEGEN_FUNCPTR *PFNGETTEXPARAMETERIVPROC)(GLenum , GLenum , GLint *); - typedef void (CODEGEN_FUNCPTR *PFNGETTEXLEVELPARAMETERFVPROC)(GLenum , GLint , GLenum , GLfloat *); - typedef void (CODEGEN_FUNCPTR *PFNGETTEXLEVELPARAMETERIVPROC)(GLenum , GLint , GLenum , GLint *); - typedef GLboolean (CODEGEN_FUNCPTR *PFNISENABLEDPROC)(GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNDEPTHRANGEPROC)(GLdouble , GLdouble ); - typedef void (CODEGEN_FUNCPTR *PFNVIEWPORTPROC)(GLint , GLint , GLsizei , GLsizei ); - typedef void (CODEGEN_FUNCPTR *PFNDRAWARRAYSPROC)(GLenum , GLint , GLsizei ); - typedef void (CODEGEN_FUNCPTR *PFNDRAWELEMENTSPROC)(GLenum , GLsizei , GLenum , const GLvoid *); - typedef void (CODEGEN_FUNCPTR *PFNGETPOINTERVPROC)(GLenum , GLvoid* *); - typedef void (CODEGEN_FUNCPTR *PFNPOLYGONOFFSETPROC)(GLfloat , GLfloat ); - typedef void (CODEGEN_FUNCPTR *PFNCOPYTEXIMAGE1DPROC)(GLenum , GLint , GLenum , GLint , GLint , GLsizei , GLint ); - typedef void (CODEGEN_FUNCPTR *PFNCOPYTEXIMAGE2DPROC)(GLenum , GLint , GLenum , GLint , GLint , GLsizei , GLsizei , GLint ); - typedef void (CODEGEN_FUNCPTR *PFNCOPYTEXSUBIMAGE1DPROC)(GLenum , GLint , GLint , GLint , GLint , GLsizei ); - typedef void (CODEGEN_FUNCPTR *PFNCOPYTEXSUBIMAGE2DPROC)(GLenum , GLint , GLint , GLint , GLint , GLint , GLsizei , GLsizei ); - typedef void (CODEGEN_FUNCPTR *PFNTEXSUBIMAGE1DPROC)(GLenum , GLint , GLint , GLsizei , GLenum , GLenum , const GLvoid *); - typedef void (CODEGEN_FUNCPTR *PFNTEXSUBIMAGE2DPROC)(GLenum , GLint , GLint , GLint , GLsizei , GLsizei , GLenum , GLenum , const GLvoid *); - typedef void (CODEGEN_FUNCPTR *PFNBINDTEXTUREPROC)(GLenum , GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNDELETETEXTURESPROC)(GLsizei , const GLuint *); - typedef void (CODEGEN_FUNCPTR *PFNGENTEXTURESPROC)(GLsizei , GLuint *); - typedef GLboolean (CODEGEN_FUNCPTR *PFNISTEXTUREPROC)(GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNINDEXUBPROC)(GLubyte ); - typedef void (CODEGEN_FUNCPTR *PFNINDEXUBVPROC)(const GLubyte *); - - // Extension: 1.2 - typedef void (CODEGEN_FUNCPTR *PFNBLENDCOLORPROC)(GLfloat , GLfloat , GLfloat , GLfloat ); - typedef void (CODEGEN_FUNCPTR *PFNBLENDEQUATIONPROC)(GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNDRAWRANGEELEMENTSPROC)(GLenum , GLuint , GLuint , GLsizei , GLenum , const GLvoid *); - typedef void (CODEGEN_FUNCPTR *PFNTEXSUBIMAGE3DPROC)(GLenum , GLint , GLint , GLint , GLint , GLsizei , GLsizei , GLsizei , GLenum , GLenum , const GLvoid *); - typedef void (CODEGEN_FUNCPTR *PFNCOPYTEXSUBIMAGE3DPROC)(GLenum , GLint , GLint , GLint , GLint , GLint , GLint , GLsizei , GLsizei ); - - // Extension: 1.3 - typedef void (CODEGEN_FUNCPTR *PFNACTIVETEXTUREPROC)(GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNSAMPLECOVERAGEPROC)(GLfloat , GLboolean ); - typedef void (CODEGEN_FUNCPTR *PFNCOMPRESSEDTEXIMAGE3DPROC)(GLenum , GLint , GLenum , GLsizei , GLsizei , GLsizei , GLint , GLsizei , const GLvoid *); - typedef void (CODEGEN_FUNCPTR *PFNCOMPRESSEDTEXIMAGE2DPROC)(GLenum , GLint , GLenum , GLsizei , GLsizei , GLint , GLsizei , const GLvoid *); - typedef void (CODEGEN_FUNCPTR *PFNCOMPRESSEDTEXIMAGE1DPROC)(GLenum , GLint , GLenum , GLsizei , GLint , GLsizei , const GLvoid *); - typedef void (CODEGEN_FUNCPTR *PFNCOMPRESSEDTEXSUBIMAGE3DPROC)(GLenum , GLint , GLint , GLint , GLint , GLsizei , GLsizei , GLsizei , GLenum , GLsizei , const GLvoid *); - typedef void (CODEGEN_FUNCPTR *PFNCOMPRESSEDTEXSUBIMAGE2DPROC)(GLenum , GLint , GLint , GLint , GLsizei , GLsizei , GLenum , GLsizei , const GLvoid *); - typedef void (CODEGEN_FUNCPTR *PFNCOMPRESSEDTEXSUBIMAGE1DPROC)(GLenum , GLint , GLint , GLsizei , GLenum , GLsizei , const GLvoid *); - typedef void (CODEGEN_FUNCPTR *PFNGETCOMPRESSEDTEXIMAGEPROC)(GLenum , GLint , GLvoid *); - - // Extension: 1.4 - typedef void (CODEGEN_FUNCPTR *PFNBLENDFUNCSEPARATEPROC)(GLenum , GLenum , GLenum , GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNMULTIDRAWARRAYSPROC)(GLenum , const GLint *, const GLsizei *, GLsizei ); - typedef void (CODEGEN_FUNCPTR *PFNMULTIDRAWELEMENTSPROC)(GLenum , const GLsizei *, GLenum , const GLvoid* const *, GLsizei ); - typedef void (CODEGEN_FUNCPTR *PFNPOINTPARAMETERFPROC)(GLenum , GLfloat ); - typedef void (CODEGEN_FUNCPTR *PFNPOINTPARAMETERFVPROC)(GLenum , const GLfloat *); - typedef void (CODEGEN_FUNCPTR *PFNPOINTPARAMETERIPROC)(GLenum , GLint ); - typedef void (CODEGEN_FUNCPTR *PFNPOINTPARAMETERIVPROC)(GLenum , const GLint *); - - // Extension: 1.5 - typedef void (CODEGEN_FUNCPTR *PFNGENQUERIESPROC)(GLsizei , GLuint *); - typedef void (CODEGEN_FUNCPTR *PFNDELETEQUERIESPROC)(GLsizei , const GLuint *); - typedef GLboolean (CODEGEN_FUNCPTR *PFNISQUERYPROC)(GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNBEGINQUERYPROC)(GLenum , GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNENDQUERYPROC)(GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNGETQUERYIVPROC)(GLenum , GLenum , GLint *); - typedef void (CODEGEN_FUNCPTR *PFNGETQUERYOBJECTIVPROC)(GLuint , GLenum , GLint *); - typedef void (CODEGEN_FUNCPTR *PFNGETQUERYOBJECTUIVPROC)(GLuint , GLenum , GLuint *); - typedef void (CODEGEN_FUNCPTR *PFNBINDBUFFERPROC)(GLenum , GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNDELETEBUFFERSPROC)(GLsizei , const GLuint *); - typedef void (CODEGEN_FUNCPTR *PFNGENBUFFERSPROC)(GLsizei , GLuint *); - typedef GLboolean (CODEGEN_FUNCPTR *PFNISBUFFERPROC)(GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNBUFFERDATAPROC)(GLenum , GLsizeiptr , const GLvoid *, GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNBUFFERSUBDATAPROC)(GLenum , GLintptr , GLsizeiptr , const GLvoid *); - typedef void (CODEGEN_FUNCPTR *PFNGETBUFFERSUBDATAPROC)(GLenum , GLintptr , GLsizeiptr , GLvoid *); - typedef GLvoid* (CODEGEN_FUNCPTR *PFNMAPBUFFERPROC)(GLenum , GLenum ); - typedef GLboolean (CODEGEN_FUNCPTR *PFNUNMAPBUFFERPROC)(GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNGETBUFFERPARAMETERIVPROC)(GLenum , GLenum , GLint *); - typedef void (CODEGEN_FUNCPTR *PFNGETBUFFERPOINTERVPROC)(GLenum , GLenum , GLvoid* *); - - // Extension: 2.0 - typedef void (CODEGEN_FUNCPTR *PFNBLENDEQUATIONSEPARATEPROC)(GLenum , GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNDRAWBUFFERSPROC)(GLsizei , const GLenum *); - typedef void (CODEGEN_FUNCPTR *PFNSTENCILOPSEPARATEPROC)(GLenum , GLenum , GLenum , GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNSTENCILFUNCSEPARATEPROC)(GLenum , GLenum , GLint , GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNSTENCILMASKSEPARATEPROC)(GLenum , GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNATTACHSHADERPROC)(GLuint , GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNBINDATTRIBLOCATIONPROC)(GLuint , GLuint , const GLchar *); - typedef void (CODEGEN_FUNCPTR *PFNCOMPILESHADERPROC)(GLuint ); - typedef GLuint (CODEGEN_FUNCPTR *PFNCREATEPROGRAMPROC)(); - typedef GLuint (CODEGEN_FUNCPTR *PFNCREATESHADERPROC)(GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNDELETEPROGRAMPROC)(GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNDELETESHADERPROC)(GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNDETACHSHADERPROC)(GLuint , GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNDISABLEVERTEXATTRIBARRAYPROC)(GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNENABLEVERTEXATTRIBARRAYPROC)(GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNGETACTIVEATTRIBPROC)(GLuint , GLuint , GLsizei , GLsizei *, GLint *, GLenum *, GLchar *); - typedef void (CODEGEN_FUNCPTR *PFNGETACTIVEUNIFORMPROC)(GLuint , GLuint , GLsizei , GLsizei *, GLint *, GLenum *, GLchar *); - typedef void (CODEGEN_FUNCPTR *PFNGETATTACHEDSHADERSPROC)(GLuint , GLsizei , GLsizei *, GLuint *); - typedef GLint (CODEGEN_FUNCPTR *PFNGETATTRIBLOCATIONPROC)(GLuint , const GLchar *); - typedef void (CODEGEN_FUNCPTR *PFNGETPROGRAMIVPROC)(GLuint , GLenum , GLint *); - typedef void (CODEGEN_FUNCPTR *PFNGETPROGRAMINFOLOGPROC)(GLuint , GLsizei , GLsizei *, GLchar *); - typedef void (CODEGEN_FUNCPTR *PFNGETSHADERIVPROC)(GLuint , GLenum , GLint *); - typedef void (CODEGEN_FUNCPTR *PFNGETSHADERINFOLOGPROC)(GLuint , GLsizei , GLsizei *, GLchar *); - typedef void (CODEGEN_FUNCPTR *PFNGETSHADERSOURCEPROC)(GLuint , GLsizei , GLsizei *, GLchar *); - typedef GLint (CODEGEN_FUNCPTR *PFNGETUNIFORMLOCATIONPROC)(GLuint , const GLchar *); - typedef void (CODEGEN_FUNCPTR *PFNGETUNIFORMFVPROC)(GLuint , GLint , GLfloat *); - typedef void (CODEGEN_FUNCPTR *PFNGETUNIFORMIVPROC)(GLuint , GLint , GLint *); - typedef void (CODEGEN_FUNCPTR *PFNGETVERTEXATTRIBDVPROC)(GLuint , GLenum , GLdouble *); - typedef void (CODEGEN_FUNCPTR *PFNGETVERTEXATTRIBFVPROC)(GLuint , GLenum , GLfloat *); - typedef void (CODEGEN_FUNCPTR *PFNGETVERTEXATTRIBIVPROC)(GLuint , GLenum , GLint *); - typedef void (CODEGEN_FUNCPTR *PFNGETVERTEXATTRIBPOINTERVPROC)(GLuint , GLenum , GLvoid* *); - typedef GLboolean (CODEGEN_FUNCPTR *PFNISPROGRAMPROC)(GLuint ); - typedef GLboolean (CODEGEN_FUNCPTR *PFNISSHADERPROC)(GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNLINKPROGRAMPROC)(GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNSHADERSOURCEPROC)(GLuint , GLsizei , const GLchar* const *, const GLint *); - typedef void (CODEGEN_FUNCPTR *PFNUSEPROGRAMPROC)(GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORM1FPROC)(GLint , GLfloat ); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORM2FPROC)(GLint , GLfloat , GLfloat ); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORM3FPROC)(GLint , GLfloat , GLfloat , GLfloat ); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORM4FPROC)(GLint , GLfloat , GLfloat , GLfloat , GLfloat ); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORM1IPROC)(GLint , GLint ); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORM2IPROC)(GLint , GLint , GLint ); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORM3IPROC)(GLint , GLint , GLint , GLint ); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORM4IPROC)(GLint , GLint , GLint , GLint , GLint ); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORM1FVPROC)(GLint , GLsizei , const GLfloat *); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORM2FVPROC)(GLint , GLsizei , const GLfloat *); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORM3FVPROC)(GLint , GLsizei , const GLfloat *); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORM4FVPROC)(GLint , GLsizei , const GLfloat *); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORM1IVPROC)(GLint , GLsizei , const GLint *); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORM2IVPROC)(GLint , GLsizei , const GLint *); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORM3IVPROC)(GLint , GLsizei , const GLint *); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORM4IVPROC)(GLint , GLsizei , const GLint *); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX2FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX3FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX4FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); - typedef void (CODEGEN_FUNCPTR *PFNVALIDATEPROGRAMPROC)(GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBPOINTERPROC)(GLuint , GLint , GLenum , GLboolean , GLsizei , const GLvoid *); - - // Extension: 2.1 - typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX2X3FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX3X2FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX2X4FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX4X2FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX3X4FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX4X3FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); - - // Extension: ARB_vertex_array_object - typedef void (CODEGEN_FUNCPTR *PFNBINDVERTEXARRAYPROC)(GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNDELETEVERTEXARRAYSPROC)(GLsizei , const GLuint *); - typedef void (CODEGEN_FUNCPTR *PFNGENVERTEXARRAYSPROC)(GLsizei , GLuint *); - typedef GLboolean (CODEGEN_FUNCPTR *PFNISVERTEXARRAYPROC)(GLuint ); - - // Extension: ARB_map_buffer_range - typedef GLvoid* (CODEGEN_FUNCPTR *PFNMAPBUFFERRANGEPROC)(GLenum , GLintptr , GLsizeiptr , GLbitfield ); - typedef void (CODEGEN_FUNCPTR *PFNFLUSHMAPPEDBUFFERRANGEPROC)(GLenum , GLintptr , GLsizeiptr ); - - // Extension: ARB_framebuffer_object - typedef GLboolean (CODEGEN_FUNCPTR *PFNISRENDERBUFFERPROC)(GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNBINDRENDERBUFFERPROC)(GLenum , GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNDELETERENDERBUFFERSPROC)(GLsizei , const GLuint *); - typedef void (CODEGEN_FUNCPTR *PFNGENRENDERBUFFERSPROC)(GLsizei , GLuint *); - typedef void (CODEGEN_FUNCPTR *PFNRENDERBUFFERSTORAGEPROC)(GLenum , GLenum , GLsizei , GLsizei ); - typedef void (CODEGEN_FUNCPTR *PFNGETRENDERBUFFERPARAMETERIVPROC)(GLenum , GLenum , GLint *); - typedef GLboolean (CODEGEN_FUNCPTR *PFNISFRAMEBUFFERPROC)(GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNBINDFRAMEBUFFERPROC)(GLenum , GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNDELETEFRAMEBUFFERSPROC)(GLsizei , const GLuint *); - typedef void (CODEGEN_FUNCPTR *PFNGENFRAMEBUFFERSPROC)(GLsizei , GLuint *); - typedef GLenum (CODEGEN_FUNCPTR *PFNCHECKFRAMEBUFFERSTATUSPROC)(GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNFRAMEBUFFERTEXTURE1DPROC)(GLenum , GLenum , GLenum , GLuint , GLint ); - typedef void (CODEGEN_FUNCPTR *PFNFRAMEBUFFERTEXTURE2DPROC)(GLenum , GLenum , GLenum , GLuint , GLint ); - typedef void (CODEGEN_FUNCPTR *PFNFRAMEBUFFERTEXTURE3DPROC)(GLenum , GLenum , GLenum , GLuint , GLint , GLint ); - typedef void (CODEGEN_FUNCPTR *PFNFRAMEBUFFERRENDERBUFFERPROC)(GLenum , GLenum , GLenum , GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLenum , GLenum , GLenum , GLint *); - typedef void (CODEGEN_FUNCPTR *PFNGENERATEMIPMAPPROC)(GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNBLITFRAMEBUFFERPROC)(GLint , GLint , GLint , GLint , GLint , GLint , GLint , GLint , GLbitfield , GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNRENDERBUFFERSTORAGEMULTISAMPLEPROC)(GLenum , GLsizei , GLenum , GLsizei , GLsizei ); - typedef void (CODEGEN_FUNCPTR *PFNFRAMEBUFFERTEXTURELAYERPROC)(GLenum , GLenum , GLuint , GLint , GLint ); - - // Extension: 3.0 - typedef void (CODEGEN_FUNCPTR *PFNCOLORMASKIPROC)(GLuint , GLboolean , GLboolean , GLboolean , GLboolean ); - typedef void (CODEGEN_FUNCPTR *PFNGETBOOLEANI_VPROC)(GLenum , GLuint , GLboolean *); - typedef void (CODEGEN_FUNCPTR *PFNGETINTEGERI_VPROC)(GLenum , GLuint , GLint *); - typedef void (CODEGEN_FUNCPTR *PFNENABLEIPROC)(GLenum , GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNDISABLEIPROC)(GLenum , GLuint ); - typedef GLboolean (CODEGEN_FUNCPTR *PFNISENABLEDIPROC)(GLenum , GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNBEGINTRANSFORMFEEDBACKPROC)(GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNENDTRANSFORMFEEDBACKPROC)(); - typedef void (CODEGEN_FUNCPTR *PFNBINDBUFFERRANGEPROC)(GLenum , GLuint , GLuint , GLintptr , GLsizeiptr ); - typedef void (CODEGEN_FUNCPTR *PFNBINDBUFFERBASEPROC)(GLenum , GLuint , GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNTRANSFORMFEEDBACKVARYINGSPROC)(GLuint , GLsizei , const GLchar* const *, GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNGETTRANSFORMFEEDBACKVARYINGPROC)(GLuint , GLuint , GLsizei , GLsizei *, GLsizei *, GLenum *, GLchar *); - typedef void (CODEGEN_FUNCPTR *PFNCLAMPCOLORPROC)(GLenum , GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNBEGINCONDITIONALRENDERPROC)(GLuint , GLenum ); - typedef void (CODEGEN_FUNCPTR *PFNENDCONDITIONALRENDERPROC)(); - typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBIPOINTERPROC)(GLuint , GLint , GLenum , GLsizei , const GLvoid *); - typedef void (CODEGEN_FUNCPTR *PFNGETVERTEXATTRIBIIVPROC)(GLuint , GLenum , GLint *); - typedef void (CODEGEN_FUNCPTR *PFNGETVERTEXATTRIBIUIVPROC)(GLuint , GLenum , GLuint *); - typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI1IPROC)(GLuint , GLint ); - typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI2IPROC)(GLuint , GLint , GLint ); - typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI3IPROC)(GLuint , GLint , GLint , GLint ); - typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI4IPROC)(GLuint , GLint , GLint , GLint , GLint ); - typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI1UIPROC)(GLuint , GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI2UIPROC)(GLuint , GLuint , GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI3UIPROC)(GLuint , GLuint , GLuint , GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI4UIPROC)(GLuint , GLuint , GLuint , GLuint , GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI1IVPROC)(GLuint , const GLint *); - typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI2IVPROC)(GLuint , const GLint *); - typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI3IVPROC)(GLuint , const GLint *); - typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI4IVPROC)(GLuint , const GLint *); - typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI1UIVPROC)(GLuint , const GLuint *); - typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI2UIVPROC)(GLuint , const GLuint *); - typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI3UIVPROC)(GLuint , const GLuint *); - typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI4UIVPROC)(GLuint , const GLuint *); - typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI4BVPROC)(GLuint , const GLbyte *); - typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI4SVPROC)(GLuint , const GLshort *); - typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI4UBVPROC)(GLuint , const GLubyte *); - typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI4USVPROC)(GLuint , const GLushort *); - typedef void (CODEGEN_FUNCPTR *PFNGETUNIFORMUIVPROC)(GLuint , GLint , GLuint *); - typedef void (CODEGEN_FUNCPTR *PFNBINDFRAGDATALOCATIONPROC)(GLuint , GLuint , const GLchar *); - typedef GLint (CODEGEN_FUNCPTR *PFNGETFRAGDATALOCATIONPROC)(GLuint , const GLchar *); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORM1UIPROC)(GLint , GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORM2UIPROC)(GLint , GLuint , GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORM3UIPROC)(GLint , GLuint , GLuint , GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORM4UIPROC)(GLint , GLuint , GLuint , GLuint , GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORM1UIVPROC)(GLint , GLsizei , const GLuint *); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORM2UIVPROC)(GLint , GLsizei , const GLuint *); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORM3UIVPROC)(GLint , GLsizei , const GLuint *); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORM4UIVPROC)(GLint , GLsizei , const GLuint *); - typedef void (CODEGEN_FUNCPTR *PFNTEXPARAMETERIIVPROC)(GLenum , GLenum , const GLint *); - typedef void (CODEGEN_FUNCPTR *PFNTEXPARAMETERIUIVPROC)(GLenum , GLenum , const GLuint *); - typedef void (CODEGEN_FUNCPTR *PFNGETTEXPARAMETERIIVPROC)(GLenum , GLenum , GLint *); - typedef void (CODEGEN_FUNCPTR *PFNGETTEXPARAMETERIUIVPROC)(GLenum , GLenum , GLuint *); - typedef void (CODEGEN_FUNCPTR *PFNCLEARBUFFERIVPROC)(GLenum , GLint , const GLint *); - typedef void (CODEGEN_FUNCPTR *PFNCLEARBUFFERUIVPROC)(GLenum , GLint , const GLuint *); - typedef void (CODEGEN_FUNCPTR *PFNCLEARBUFFERFVPROC)(GLenum , GLint , const GLfloat *); - typedef void (CODEGEN_FUNCPTR *PFNCLEARBUFFERFIPROC)(GLenum , GLint , GLfloat , GLint ); - typedef const GLubyte * (CODEGEN_FUNCPTR *PFNGETSTRINGIPROC)(GLenum , GLuint ); - - // Extension: ARB_uniform_buffer_object - typedef void (CODEGEN_FUNCPTR *PFNGETUNIFORMINDICESPROC)(GLuint , GLsizei , const GLchar* const *, GLuint *); - typedef void (CODEGEN_FUNCPTR *PFNGETACTIVEUNIFORMSIVPROC)(GLuint , GLsizei , const GLuint *, GLenum , GLint *); - typedef void (CODEGEN_FUNCPTR *PFNGETACTIVEUNIFORMNAMEPROC)(GLuint , GLuint , GLsizei , GLsizei *, GLchar *); - typedef GLuint (CODEGEN_FUNCPTR *PFNGETUNIFORMBLOCKINDEXPROC)(GLuint , const GLchar *); - typedef void (CODEGEN_FUNCPTR *PFNGETACTIVEUNIFORMBLOCKIVPROC)(GLuint , GLuint , GLenum , GLint *); - typedef void (CODEGEN_FUNCPTR *PFNGETACTIVEUNIFORMBLOCKNAMEPROC)(GLuint , GLuint , GLsizei , GLsizei *, GLchar *); - typedef void (CODEGEN_FUNCPTR *PFNUNIFORMBLOCKBINDINGPROC)(GLuint , GLuint , GLuint ); - - // Extension: ARB_copy_buffer - typedef void (CODEGEN_FUNCPTR *PFNCOPYBUFFERSUBDATAPROC)(GLenum , GLenum , GLintptr , GLintptr , GLsizeiptr ); - - // Extension: 3.1 - typedef void (CODEGEN_FUNCPTR *PFNDRAWARRAYSINSTANCEDPROC)(GLenum , GLint , GLsizei , GLsizei ); - typedef void (CODEGEN_FUNCPTR *PFNDRAWELEMENTSINSTANCEDPROC)(GLenum , GLsizei , GLenum , const GLvoid *, GLsizei ); - typedef void (CODEGEN_FUNCPTR *PFNTEXBUFFERPROC)(GLenum , GLenum , GLuint ); - typedef void (CODEGEN_FUNCPTR *PFNPRIMITIVERESTARTINDEXPROC)(GLuint ); - - // Legacy - typedef void (CODEGEN_FUNCPTR *PFNENABLECLIENTSTATEPROC)(GLenum cap); - typedef void (CODEGEN_FUNCPTR *PFNDISABLECLIENTSTATEPROC)(GLenum cap); - typedef void (CODEGEN_FUNCPTR *PFNVERTEXPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr); - typedef void (CODEGEN_FUNCPTR *PFNNORMALPOINTERPROC)(GLenum type, GLsizei stride, const GLvoid *ptr); - typedef void (CODEGEN_FUNCPTR *PFNCOLORPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr); - typedef void (CODEGEN_FUNCPTR *PFNTEXCOORDPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr); - - typedef void (CODEGEN_FUNCPTR *PFNTEXENVIPROC)(GLenum target, GLenum pname, GLint param); - - typedef void (CODEGEN_FUNCPTR *PFNMATRIXMODEPROC)(GLenum modem); - typedef void (CODEGEN_FUNCPTR *PFNLOADIDENTITYPROC)(void); - typedef void (CODEGEN_FUNCPTR *PFNORTHOPROC)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val); - - typedef void (CODEGEN_FUNCPTR *PFNCOLOR3DPROC)(GLdouble red, GLdouble green, GLdouble blue); - - - - // Extension: 1.1 - PFNCULLFACEPROC CullFace; - PFNFRONTFACEPROC FrontFace; - PFNHINTPROC Hint; - PFNLINEWIDTHPROC LineWidth; - PFNPOINTSIZEPROC PointSize; - PFNPOLYGONMODEPROC PolygonMode; - PFNSCISSORPROC Scissor; - PFNTEXPARAMETERFPROC TexParameterf; - PFNTEXPARAMETERFVPROC TexParameterfv; - PFNTEXPARAMETERIPROC TexParameteri; - PFNTEXPARAMETERIVPROC TexParameteriv; - PFNTEXIMAGE1DPROC TexImage1D; - PFNTEXIMAGE2DPROC TexImage2D; - PFNDRAWBUFFERPROC DrawBuffer; - PFNCLEARPROC Clear; - PFNCLEARCOLORPROC ClearColor; - PFNCLEARSTENCILPROC ClearStencil; - PFNCLEARDEPTHPROC ClearDepth; - PFNSTENCILMASKPROC StencilMask; - PFNCOLORMASKPROC ColorMask; - PFNDEPTHMASKPROC DepthMask; - PFNDISABLEPROC Disable; - PFNENABLEPROC Enable; - PFNFINISHPROC Finish; - PFNFLUSHPROC Flush; - PFNBLENDFUNCPROC BlendFunc; - PFNLOGICOPPROC LogicOp; - PFNSTENCILFUNCPROC StencilFunc; - PFNSTENCILOPPROC StencilOp; - PFNDEPTHFUNCPROC DepthFunc; - PFNPIXELSTOREFPROC PixelStoref; - PFNPIXELSTOREIPROC PixelStorei; - PFNREADBUFFERPROC ReadBuffer; - PFNREADPIXELSPROC ReadPixels; - PFNGETBOOLEANVPROC GetBooleanv; - PFNGETDOUBLEVPROC GetDoublev; - PFNGETERRORPROC GetError; - PFNGETFLOATVPROC GetFloatv; - PFNGETINTEGERVPROC GetIntegerv; - PFNGETSTRINGPROC GetString; - PFNGETTEXIMAGEPROC GetTexImage; - PFNGETTEXPARAMETERFVPROC GetTexParameterfv; - PFNGETTEXPARAMETERIVPROC GetTexParameteriv; - PFNGETTEXLEVELPARAMETERFVPROC GetTexLevelParameterfv; - PFNGETTEXLEVELPARAMETERIVPROC GetTexLevelParameteriv; - PFNISENABLEDPROC IsEnabled; - PFNDEPTHRANGEPROC DepthRange; - PFNVIEWPORTPROC Viewport; - PFNDRAWARRAYSPROC DrawArrays; - PFNDRAWELEMENTSPROC DrawElements; - PFNGETPOINTERVPROC GetPointerv; - PFNPOLYGONOFFSETPROC PolygonOffset; - PFNCOPYTEXIMAGE1DPROC CopyTexImage1D; - PFNCOPYTEXIMAGE2DPROC CopyTexImage2D; - PFNCOPYTEXSUBIMAGE1DPROC CopyTexSubImage1D; - PFNCOPYTEXSUBIMAGE2DPROC CopyTexSubImage2D; - PFNTEXSUBIMAGE1DPROC TexSubImage1D; - PFNTEXSUBIMAGE2DPROC TexSubImage2D; - PFNBINDTEXTUREPROC BindTexture; - PFNDELETETEXTURESPROC DeleteTextures; - PFNGENTEXTURESPROC GenTextures; - PFNISTEXTUREPROC IsTexture; - PFNINDEXUBPROC Indexub; - PFNINDEXUBVPROC Indexubv; - - // Extension: 1.2 - PFNBLENDCOLORPROC BlendColor; - PFNBLENDEQUATIONPROC BlendEquation; - PFNDRAWRANGEELEMENTSPROC DrawRangeElements; - PFNTEXSUBIMAGE3DPROC TexSubImage3D; - PFNCOPYTEXSUBIMAGE3DPROC CopyTexSubImage3D; - - // Extension: 1.3 - PFNACTIVETEXTUREPROC ActiveTexture; - PFNSAMPLECOVERAGEPROC SampleCoverage; - PFNCOMPRESSEDTEXIMAGE3DPROC CompressedTexImage3D; - PFNCOMPRESSEDTEXIMAGE2DPROC CompressedTexImage2D; - PFNCOMPRESSEDTEXIMAGE1DPROC CompressedTexImage1D; - PFNCOMPRESSEDTEXSUBIMAGE3DPROC CompressedTexSubImage3D; - PFNCOMPRESSEDTEXSUBIMAGE2DPROC CompressedTexSubImage2D; - PFNCOMPRESSEDTEXSUBIMAGE1DPROC CompressedTexSubImage1D; - PFNGETCOMPRESSEDTEXIMAGEPROC GetCompressedTexImage; - - // Extension: 1.4 - PFNBLENDFUNCSEPARATEPROC BlendFuncSeparate; - PFNMULTIDRAWARRAYSPROC MultiDrawArrays; - PFNMULTIDRAWELEMENTSPROC MultiDrawElements; - PFNPOINTPARAMETERFPROC PointParameterf; - PFNPOINTPARAMETERFVPROC PointParameterfv; - PFNPOINTPARAMETERIPROC PointParameteri; - PFNPOINTPARAMETERIVPROC PointParameteriv; - - // Extension: 1.5 - PFNGENQUERIESPROC GenQueries; - PFNDELETEQUERIESPROC DeleteQueries; - PFNISQUERYPROC IsQuery; - PFNBEGINQUERYPROC BeginQuery; - PFNENDQUERYPROC EndQuery; - PFNGETQUERYIVPROC GetQueryiv; - PFNGETQUERYOBJECTIVPROC GetQueryObjectiv; - PFNGETQUERYOBJECTUIVPROC GetQueryObjectuiv; - PFNBINDBUFFERPROC BindBuffer; - PFNDELETEBUFFERSPROC DeleteBuffers; - PFNGENBUFFERSPROC GenBuffers; - PFNISBUFFERPROC IsBuffer; - PFNBUFFERDATAPROC BufferData; - PFNBUFFERSUBDATAPROC BufferSubData; - PFNGETBUFFERSUBDATAPROC GetBufferSubData; - PFNMAPBUFFERPROC MapBuffer; - PFNUNMAPBUFFERPROC UnmapBuffer; - PFNGETBUFFERPARAMETERIVPROC GetBufferParameteriv; - PFNGETBUFFERPOINTERVPROC GetBufferPointerv; - - // Extension: 2.0 - PFNBLENDEQUATIONSEPARATEPROC BlendEquationSeparate; - PFNDRAWBUFFERSPROC DrawBuffers; - PFNSTENCILOPSEPARATEPROC StencilOpSeparate; - PFNSTENCILFUNCSEPARATEPROC StencilFuncSeparate; - PFNSTENCILMASKSEPARATEPROC StencilMaskSeparate; - PFNATTACHSHADERPROC AttachShader; - PFNBINDATTRIBLOCATIONPROC BindAttribLocation; - PFNCOMPILESHADERPROC CompileShader; - PFNCREATEPROGRAMPROC CreateProgram; - PFNCREATESHADERPROC CreateShader; - PFNDELETEPROGRAMPROC DeleteProgram; - PFNDELETESHADERPROC DeleteShader; - PFNDETACHSHADERPROC DetachShader; - PFNDISABLEVERTEXATTRIBARRAYPROC DisableVertexAttribArray; - PFNENABLEVERTEXATTRIBARRAYPROC EnableVertexAttribArray; - PFNGETACTIVEATTRIBPROC GetActiveAttrib; - PFNGETACTIVEUNIFORMPROC GetActiveUniform; - PFNGETATTACHEDSHADERSPROC GetAttachedShaders; - PFNGETATTRIBLOCATIONPROC GetAttribLocation; - PFNGETPROGRAMIVPROC GetProgramiv; - PFNGETPROGRAMINFOLOGPROC GetProgramInfoLog; - PFNGETSHADERIVPROC GetShaderiv; - PFNGETSHADERINFOLOGPROC GetShaderInfoLog; - PFNGETSHADERSOURCEPROC GetShaderSource; - PFNGETUNIFORMLOCATIONPROC GetUniformLocation; - PFNGETUNIFORMFVPROC GetUniformfv; - PFNGETUNIFORMIVPROC GetUniformiv; - PFNGETVERTEXATTRIBDVPROC GetVertexAttribdv; - PFNGETVERTEXATTRIBFVPROC GetVertexAttribfv; - PFNGETVERTEXATTRIBIVPROC GetVertexAttribiv; - PFNGETVERTEXATTRIBPOINTERVPROC GetVertexAttribPointerv; - PFNISPROGRAMPROC IsProgram; - PFNISSHADERPROC IsShader; - PFNLINKPROGRAMPROC LinkProgram; - PFNSHADERSOURCEPROC ShaderSource; - PFNUSEPROGRAMPROC UseProgram; - PFNUNIFORM1FPROC Uniform1f; - PFNUNIFORM2FPROC Uniform2f; - PFNUNIFORM3FPROC Uniform3f; - PFNUNIFORM4FPROC Uniform4f; - PFNUNIFORM1IPROC Uniform1i; - PFNUNIFORM2IPROC Uniform2i; - PFNUNIFORM3IPROC Uniform3i; - PFNUNIFORM4IPROC Uniform4i; - PFNUNIFORM1FVPROC Uniform1fv; - PFNUNIFORM2FVPROC Uniform2fv; - PFNUNIFORM3FVPROC Uniform3fv; - PFNUNIFORM4FVPROC Uniform4fv; - PFNUNIFORM1IVPROC Uniform1iv; - PFNUNIFORM2IVPROC Uniform2iv; - PFNUNIFORM3IVPROC Uniform3iv; - PFNUNIFORM4IVPROC Uniform4iv; - PFNUNIFORMMATRIX2FVPROC UniformMatrix2fv; - PFNUNIFORMMATRIX3FVPROC UniformMatrix3fv; - PFNUNIFORMMATRIX4FVPROC UniformMatrix4fv; - PFNVALIDATEPROGRAMPROC ValidateProgram; - PFNVERTEXATTRIBPOINTERPROC VertexAttribPointer; - - // Extension: 2.1 - PFNUNIFORMMATRIX2X3FVPROC UniformMatrix2x3fv; - PFNUNIFORMMATRIX3X2FVPROC UniformMatrix3x2fv; - PFNUNIFORMMATRIX2X4FVPROC UniformMatrix2x4fv; - PFNUNIFORMMATRIX4X2FVPROC UniformMatrix4x2fv; - PFNUNIFORMMATRIX3X4FVPROC UniformMatrix3x4fv; - PFNUNIFORMMATRIX4X3FVPROC UniformMatrix4x3fv; - - // Extension: ARB_vertex_array_object - PFNBINDVERTEXARRAYPROC BindVertexArray; - PFNDELETEVERTEXARRAYSPROC DeleteVertexArrays; - PFNGENVERTEXARRAYSPROC GenVertexArrays; - PFNISVERTEXARRAYPROC IsVertexArray; - - // Extension: ARB_map_buffer_range - PFNMAPBUFFERRANGEPROC MapBufferRange; - PFNFLUSHMAPPEDBUFFERRANGEPROC FlushMappedBufferRange; - - // Extension: ARB_framebuffer_object - PFNISRENDERBUFFERPROC IsRenderbuffer; - PFNBINDRENDERBUFFERPROC BindRenderbuffer; - PFNDELETERENDERBUFFERSPROC DeleteRenderbuffers; - PFNGENRENDERBUFFERSPROC GenRenderbuffers; - PFNRENDERBUFFERSTORAGEPROC RenderbufferStorage; - PFNGETRENDERBUFFERPARAMETERIVPROC GetRenderbufferParameteriv; - PFNISFRAMEBUFFERPROC IsFramebuffer; - PFNBINDFRAMEBUFFERPROC BindFramebuffer; - PFNDELETEFRAMEBUFFERSPROC DeleteFramebuffers; - PFNGENFRAMEBUFFERSPROC GenFramebuffers; - PFNCHECKFRAMEBUFFERSTATUSPROC CheckFramebufferStatus; - PFNFRAMEBUFFERTEXTURE1DPROC FramebufferTexture1D; - PFNFRAMEBUFFERTEXTURE2DPROC FramebufferTexture2D; - PFNFRAMEBUFFERTEXTURE3DPROC FramebufferTexture3D; - PFNFRAMEBUFFERRENDERBUFFERPROC FramebufferRenderbuffer; - PFNGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC GetFramebufferAttachmentParameteriv; - PFNGENERATEMIPMAPPROC GenerateMipmap; - PFNBLITFRAMEBUFFERPROC BlitFramebuffer; - PFNRENDERBUFFERSTORAGEMULTISAMPLEPROC RenderbufferStorageMultisample; - PFNFRAMEBUFFERTEXTURELAYERPROC FramebufferTextureLayer; - - // Extension: 3.0 - PFNCOLORMASKIPROC ColorMaski; - PFNGETBOOLEANI_VPROC GetBooleani_v; - PFNGETINTEGERI_VPROC GetIntegeri_v; - PFNENABLEIPROC Enablei; - PFNDISABLEIPROC Disablei; - PFNISENABLEDIPROC IsEnabledi; - PFNBEGINTRANSFORMFEEDBACKPROC BeginTransformFeedback; - PFNENDTRANSFORMFEEDBACKPROC EndTransformFeedback; - PFNBINDBUFFERRANGEPROC BindBufferRange; - PFNBINDBUFFERBASEPROC BindBufferBase; - PFNTRANSFORMFEEDBACKVARYINGSPROC TransformFeedbackVaryings; - PFNGETTRANSFORMFEEDBACKVARYINGPROC GetTransformFeedbackVarying; - PFNCLAMPCOLORPROC ClampColor; - PFNBEGINCONDITIONALRENDERPROC BeginConditionalRender; - PFNENDCONDITIONALRENDERPROC EndConditionalRender; - PFNVERTEXATTRIBIPOINTERPROC VertexAttribIPointer; - PFNGETVERTEXATTRIBIIVPROC GetVertexAttribIiv; - PFNGETVERTEXATTRIBIUIVPROC GetVertexAttribIuiv; - PFNVERTEXATTRIBI1IPROC VertexAttribI1i; - PFNVERTEXATTRIBI2IPROC VertexAttribI2i; - PFNVERTEXATTRIBI3IPROC VertexAttribI3i; - PFNVERTEXATTRIBI4IPROC VertexAttribI4i; - PFNVERTEXATTRIBI1UIPROC VertexAttribI1ui; - PFNVERTEXATTRIBI2UIPROC VertexAttribI2ui; - PFNVERTEXATTRIBI3UIPROC VertexAttribI3ui; - PFNVERTEXATTRIBI4UIPROC VertexAttribI4ui; - PFNVERTEXATTRIBI1IVPROC VertexAttribI1iv; - PFNVERTEXATTRIBI2IVPROC VertexAttribI2iv; - PFNVERTEXATTRIBI3IVPROC VertexAttribI3iv; - PFNVERTEXATTRIBI4IVPROC VertexAttribI4iv; - PFNVERTEXATTRIBI1UIVPROC VertexAttribI1uiv; - PFNVERTEXATTRIBI2UIVPROC VertexAttribI2uiv; - PFNVERTEXATTRIBI3UIVPROC VertexAttribI3uiv; - PFNVERTEXATTRIBI4UIVPROC VertexAttribI4uiv; - PFNVERTEXATTRIBI4BVPROC VertexAttribI4bv; - PFNVERTEXATTRIBI4SVPROC VertexAttribI4sv; - PFNVERTEXATTRIBI4UBVPROC VertexAttribI4ubv; - PFNVERTEXATTRIBI4USVPROC VertexAttribI4usv; - PFNGETUNIFORMUIVPROC GetUniformuiv; - PFNBINDFRAGDATALOCATIONPROC BindFragDataLocation; - PFNGETFRAGDATALOCATIONPROC GetFragDataLocation; - PFNUNIFORM1UIPROC Uniform1ui; - PFNUNIFORM2UIPROC Uniform2ui; - PFNUNIFORM3UIPROC Uniform3ui; - PFNUNIFORM4UIPROC Uniform4ui; - PFNUNIFORM1UIVPROC Uniform1uiv; - PFNUNIFORM2UIVPROC Uniform2uiv; - PFNUNIFORM3UIVPROC Uniform3uiv; - PFNUNIFORM4UIVPROC Uniform4uiv; - PFNTEXPARAMETERIIVPROC TexParameterIiv; - PFNTEXPARAMETERIUIVPROC TexParameterIuiv; - PFNGETTEXPARAMETERIIVPROC GetTexParameterIiv; - PFNGETTEXPARAMETERIUIVPROC GetTexParameterIuiv; - PFNCLEARBUFFERIVPROC ClearBufferiv; - PFNCLEARBUFFERUIVPROC ClearBufferuiv; - PFNCLEARBUFFERFVPROC ClearBufferfv; - PFNCLEARBUFFERFIPROC ClearBufferfi; - PFNGETSTRINGIPROC GetStringi; - - // Extension: ARB_uniform_buffer_object - PFNGETUNIFORMINDICESPROC GetUniformIndices; - PFNGETACTIVEUNIFORMSIVPROC GetActiveUniformsiv; - PFNGETACTIVEUNIFORMNAMEPROC GetActiveUniformName; - PFNGETUNIFORMBLOCKINDEXPROC GetUniformBlockIndex; - PFNGETACTIVEUNIFORMBLOCKIVPROC GetActiveUniformBlockiv; - PFNGETACTIVEUNIFORMBLOCKNAMEPROC GetActiveUniformBlockName; - PFNUNIFORMBLOCKBINDINGPROC UniformBlockBinding; - - // Extension: ARB_copy_buffer - PFNCOPYBUFFERSUBDATAPROC CopyBufferSubData; - - // Extension: 3.1 - PFNDRAWARRAYSINSTANCEDPROC DrawArraysInstanced; - PFNDRAWELEMENTSINSTANCEDPROC DrawElementsInstanced; - PFNTEXBUFFERPROC TexBuffer; - PFNPRIMITIVERESTARTINDEXPROC PrimitiveRestartIndex; - - // Legacy - PFNENABLECLIENTSTATEPROC EnableClientState; - PFNDISABLECLIENTSTATEPROC DisableClientState; - PFNVERTEXPOINTERPROC VertexPointer; - PFNNORMALPOINTERPROC NormalPointer; - PFNCOLORPOINTERPROC ColorPointer; - PFNTEXCOORDPOINTERPROC TexCoordPointer; - - PFNTEXENVIPROC TexEnvi; - - PFNMATRIXMODEPROC MatrixMode; - PFNLOADIDENTITYPROC LoadIdentity; - PFNORTHOPROC Ortho; - - PFNCOLOR3DPROC Color3d; - - - // Extension: 1.1 - static void CODEGEN_FUNCPTR Switch_CullFace(GLenum mode) - { - CullFace = (PFNCULLFACEPROC)IntGetProcAddress("glCullFace"); - CullFace(mode); - } - - static void CODEGEN_FUNCPTR Switch_FrontFace(GLenum mode) - { - FrontFace = (PFNFRONTFACEPROC)IntGetProcAddress("glFrontFace"); - FrontFace(mode); - } - - static void CODEGEN_FUNCPTR Switch_Hint(GLenum target, GLenum mode) - { - Hint = (PFNHINTPROC)IntGetProcAddress("glHint"); - Hint(target, mode); - } - - static void CODEGEN_FUNCPTR Switch_LineWidth(GLfloat width) - { - LineWidth = (PFNLINEWIDTHPROC)IntGetProcAddress("glLineWidth"); - LineWidth(width); - } - - static void CODEGEN_FUNCPTR Switch_PointSize(GLfloat size) - { - PointSize = (PFNPOINTSIZEPROC)IntGetProcAddress("glPointSize"); - PointSize(size); - } - - static void CODEGEN_FUNCPTR Switch_PolygonMode(GLenum face, GLenum mode) - { - PolygonMode = (PFNPOLYGONMODEPROC)IntGetProcAddress("glPolygonMode"); - PolygonMode(face, mode); - } - - static void CODEGEN_FUNCPTR Switch_Scissor(GLint x, GLint y, GLsizei width, GLsizei height) - { - Scissor = (PFNSCISSORPROC)IntGetProcAddress("glScissor"); - Scissor(x, y, width, height); - } - - static void CODEGEN_FUNCPTR Switch_TexParameterf(GLenum target, GLenum pname, GLfloat param) - { - TexParameterf = (PFNTEXPARAMETERFPROC)IntGetProcAddress("glTexParameterf"); - TexParameterf(target, pname, param); - } - - static void CODEGEN_FUNCPTR Switch_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) - { - TexParameterfv = (PFNTEXPARAMETERFVPROC)IntGetProcAddress("glTexParameterfv"); - TexParameterfv(target, pname, params); - } - - static void CODEGEN_FUNCPTR Switch_TexParameteri(GLenum target, GLenum pname, GLint param) - { - TexParameteri = (PFNTEXPARAMETERIPROC)IntGetProcAddress("glTexParameteri"); - TexParameteri(target, pname, param); - } - - static void CODEGEN_FUNCPTR Switch_TexParameteriv(GLenum target, GLenum pname, const GLint *params) - { - TexParameteriv = (PFNTEXPARAMETERIVPROC)IntGetProcAddress("glTexParameteriv"); - TexParameteriv(target, pname, params); - } - - static void CODEGEN_FUNCPTR Switch_TexImage1D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels) - { - TexImage1D = (PFNTEXIMAGE1DPROC)IntGetProcAddress("glTexImage1D"); - TexImage1D(target, level, internalformat, width, border, format, type, pixels); - } - - static void CODEGEN_FUNCPTR Switch_TexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) - { - TexImage2D = (PFNTEXIMAGE2DPROC)IntGetProcAddress("glTexImage2D"); - TexImage2D(target, level, internalformat, width, height, border, format, type, pixels); - } - - static void CODEGEN_FUNCPTR Switch_DrawBuffer(GLenum mode) - { - DrawBuffer = (PFNDRAWBUFFERPROC)IntGetProcAddress("glDrawBuffer"); - DrawBuffer(mode); - } - - static void CODEGEN_FUNCPTR Switch_Clear(GLbitfield mask) - { - Clear = (PFNCLEARPROC)IntGetProcAddress("glClear"); - Clear(mask); - } - - static void CODEGEN_FUNCPTR Switch_ClearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) - { - ClearColor = (PFNCLEARCOLORPROC)IntGetProcAddress("glClearColor"); - ClearColor(red, green, blue, alpha); - } - - static void CODEGEN_FUNCPTR Switch_ClearStencil(GLint s) - { - ClearStencil = (PFNCLEARSTENCILPROC)IntGetProcAddress("glClearStencil"); - ClearStencil(s); - } - - static void CODEGEN_FUNCPTR Switch_ClearDepth(GLdouble depth) - { - ClearDepth = (PFNCLEARDEPTHPROC)IntGetProcAddress("glClearDepth"); - ClearDepth(depth); - } - - static void CODEGEN_FUNCPTR Switch_StencilMask(GLuint mask) - { - StencilMask = (PFNSTENCILMASKPROC)IntGetProcAddress("glStencilMask"); - StencilMask(mask); - } - - static void CODEGEN_FUNCPTR Switch_ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) - { - ColorMask = (PFNCOLORMASKPROC)IntGetProcAddress("glColorMask"); - ColorMask(red, green, blue, alpha); - } - - static void CODEGEN_FUNCPTR Switch_DepthMask(GLboolean flag) - { - DepthMask = (PFNDEPTHMASKPROC)IntGetProcAddress("glDepthMask"); - DepthMask(flag); - } - - static void CODEGEN_FUNCPTR Switch_Disable(GLenum cap) - { - Disable = (PFNDISABLEPROC)IntGetProcAddress("glDisable"); - Disable(cap); - } - - static void CODEGEN_FUNCPTR Switch_Enable(GLenum cap) - { - Enable = (PFNENABLEPROC)IntGetProcAddress("glEnable"); - Enable(cap); - } - - static void CODEGEN_FUNCPTR Switch_Finish() - { - Finish = (PFNFINISHPROC)IntGetProcAddress("glFinish"); - Finish(); - } - - static void CODEGEN_FUNCPTR Switch_Flush() - { - Flush = (PFNFLUSHPROC)IntGetProcAddress("glFlush"); - Flush(); - } - - static void CODEGEN_FUNCPTR Switch_BlendFunc(GLenum sfactor, GLenum dfactor) - { - BlendFunc = (PFNBLENDFUNCPROC)IntGetProcAddress("glBlendFunc"); - BlendFunc(sfactor, dfactor); - } - - static void CODEGEN_FUNCPTR Switch_LogicOp(GLenum opcode) - { - LogicOp = (PFNLOGICOPPROC)IntGetProcAddress("glLogicOp"); - LogicOp(opcode); - } - - static void CODEGEN_FUNCPTR Switch_StencilFunc(GLenum func, GLint ref, GLuint mask) - { - StencilFunc = (PFNSTENCILFUNCPROC)IntGetProcAddress("glStencilFunc"); - StencilFunc(func, ref, mask); - } - - static void CODEGEN_FUNCPTR Switch_StencilOp(GLenum fail, GLenum zfail, GLenum zpass) - { - StencilOp = (PFNSTENCILOPPROC)IntGetProcAddress("glStencilOp"); - StencilOp(fail, zfail, zpass); - } - - static void CODEGEN_FUNCPTR Switch_DepthFunc(GLenum func) - { - DepthFunc = (PFNDEPTHFUNCPROC)IntGetProcAddress("glDepthFunc"); - DepthFunc(func); - } - - static void CODEGEN_FUNCPTR Switch_PixelStoref(GLenum pname, GLfloat param) - { - PixelStoref = (PFNPIXELSTOREFPROC)IntGetProcAddress("glPixelStoref"); - PixelStoref(pname, param); - } - - static void CODEGEN_FUNCPTR Switch_PixelStorei(GLenum pname, GLint param) - { - PixelStorei = (PFNPIXELSTOREIPROC)IntGetProcAddress("glPixelStorei"); - PixelStorei(pname, param); - } - - static void CODEGEN_FUNCPTR Switch_ReadBuffer(GLenum mode) - { - ReadBuffer = (PFNREADBUFFERPROC)IntGetProcAddress("glReadBuffer"); - ReadBuffer(mode); - } - - static void CODEGEN_FUNCPTR Switch_ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels) - { - ReadPixels = (PFNREADPIXELSPROC)IntGetProcAddress("glReadPixels"); - ReadPixels(x, y, width, height, format, type, pixels); - } - - static void CODEGEN_FUNCPTR Switch_GetBooleanv(GLenum pname, GLboolean *params) - { - GetBooleanv = (PFNGETBOOLEANVPROC)IntGetProcAddress("glGetBooleanv"); - GetBooleanv(pname, params); - } - - static void CODEGEN_FUNCPTR Switch_GetDoublev(GLenum pname, GLdouble *params) - { - GetDoublev = (PFNGETDOUBLEVPROC)IntGetProcAddress("glGetDoublev"); - GetDoublev(pname, params); - } - - static GLenum CODEGEN_FUNCPTR Switch_GetError() - { - GetError = (PFNGETERRORPROC)IntGetProcAddress("glGetError"); - return GetError(); - } - - static void CODEGEN_FUNCPTR Switch_GetFloatv(GLenum pname, GLfloat *params) - { - GetFloatv = (PFNGETFLOATVPROC)IntGetProcAddress("glGetFloatv"); - GetFloatv(pname, params); - } - - static void CODEGEN_FUNCPTR Switch_GetIntegerv(GLenum pname, GLint *params) - { - GetIntegerv = (PFNGETINTEGERVPROC)IntGetProcAddress("glGetIntegerv"); - GetIntegerv(pname, params); - } - - static const GLubyte * CODEGEN_FUNCPTR Switch_GetString(GLenum name) - { - GetString = (PFNGETSTRINGPROC)IntGetProcAddress("glGetString"); - return GetString(name); - } - - static void CODEGEN_FUNCPTR Switch_GetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels) - { - GetTexImage = (PFNGETTEXIMAGEPROC)IntGetProcAddress("glGetTexImage"); - GetTexImage(target, level, format, type, pixels); - } - - static void CODEGEN_FUNCPTR Switch_GetTexParameterfv(GLenum target, GLenum pname, GLfloat *params) - { - GetTexParameterfv = (PFNGETTEXPARAMETERFVPROC)IntGetProcAddress("glGetTexParameterfv"); - GetTexParameterfv(target, pname, params); - } - - static void CODEGEN_FUNCPTR Switch_GetTexParameteriv(GLenum target, GLenum pname, GLint *params) - { - GetTexParameteriv = (PFNGETTEXPARAMETERIVPROC)IntGetProcAddress("glGetTexParameteriv"); - GetTexParameteriv(target, pname, params); - } - - static void CODEGEN_FUNCPTR Switch_GetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params) - { - GetTexLevelParameterfv = (PFNGETTEXLEVELPARAMETERFVPROC)IntGetProcAddress("glGetTexLevelParameterfv"); - GetTexLevelParameterfv(target, level, pname, params); - } - - static void CODEGEN_FUNCPTR Switch_GetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params) - { - GetTexLevelParameteriv = (PFNGETTEXLEVELPARAMETERIVPROC)IntGetProcAddress("glGetTexLevelParameteriv"); - GetTexLevelParameteriv(target, level, pname, params); - } - - static GLboolean CODEGEN_FUNCPTR Switch_IsEnabled(GLenum cap) - { - IsEnabled = (PFNISENABLEDPROC)IntGetProcAddress("glIsEnabled"); - return IsEnabled(cap); - } - - static void CODEGEN_FUNCPTR Switch_DepthRange(GLdouble ren_near, GLdouble ren_far) - { - DepthRange = (PFNDEPTHRANGEPROC)IntGetProcAddress("glDepthRange"); - DepthRange(ren_near, ren_far); - } - - static void CODEGEN_FUNCPTR Switch_Viewport(GLint x, GLint y, GLsizei width, GLsizei height) - { - Viewport = (PFNVIEWPORTPROC)IntGetProcAddress("glViewport"); - Viewport(x, y, width, height); - } - - static void CODEGEN_FUNCPTR Switch_DrawArrays(GLenum mode, GLint first, GLsizei count) - { - DrawArrays = (PFNDRAWARRAYSPROC)IntGetProcAddress("glDrawArrays"); - DrawArrays(mode, first, count); - } - - static void CODEGEN_FUNCPTR Switch_DrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices) - { - DrawElements = (PFNDRAWELEMENTSPROC)IntGetProcAddress("glDrawElements"); - DrawElements(mode, count, type, indices); - } - - static void CODEGEN_FUNCPTR Switch_GetPointerv(GLenum pname, GLvoid* *params) - { - GetPointerv = (PFNGETPOINTERVPROC)IntGetProcAddress("glGetPointerv"); - GetPointerv(pname, params); - } - - static void CODEGEN_FUNCPTR Switch_PolygonOffset(GLfloat factor, GLfloat units) - { - PolygonOffset = (PFNPOLYGONOFFSETPROC)IntGetProcAddress("glPolygonOffset"); - PolygonOffset(factor, units); - } - - static void CODEGEN_FUNCPTR Switch_CopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) - { - CopyTexImage1D = (PFNCOPYTEXIMAGE1DPROC)IntGetProcAddress("glCopyTexImage1D"); - CopyTexImage1D(target, level, internalformat, x, y, width, border); - } - - static void CODEGEN_FUNCPTR Switch_CopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) - { - CopyTexImage2D = (PFNCOPYTEXIMAGE2DPROC)IntGetProcAddress("glCopyTexImage2D"); - CopyTexImage2D(target, level, internalformat, x, y, width, height, border); - } - - static void CODEGEN_FUNCPTR Switch_CopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) - { - CopyTexSubImage1D = (PFNCOPYTEXSUBIMAGE1DPROC)IntGetProcAddress("glCopyTexSubImage1D"); - CopyTexSubImage1D(target, level, xoffset, x, y, width); - } - - static void CODEGEN_FUNCPTR Switch_CopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) - { - CopyTexSubImage2D = (PFNCOPYTEXSUBIMAGE2DPROC)IntGetProcAddress("glCopyTexSubImage2D"); - CopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); - } - - static void CODEGEN_FUNCPTR Switch_TexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels) - { - TexSubImage1D = (PFNTEXSUBIMAGE1DPROC)IntGetProcAddress("glTexSubImage1D"); - TexSubImage1D(target, level, xoffset, width, format, type, pixels); - } - - static void CODEGEN_FUNCPTR Switch_TexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) - { - TexSubImage2D = (PFNTEXSUBIMAGE2DPROC)IntGetProcAddress("glTexSubImage2D"); - TexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); - } - - static void CODEGEN_FUNCPTR Switch_BindTexture(GLenum target, GLuint texture) - { - BindTexture = (PFNBINDTEXTUREPROC)IntGetProcAddress("glBindTexture"); - BindTexture(target, texture); - } - - static void CODEGEN_FUNCPTR Switch_DeleteTextures(GLsizei n, const GLuint *textures) - { - DeleteTextures = (PFNDELETETEXTURESPROC)IntGetProcAddress("glDeleteTextures"); - DeleteTextures(n, textures); - } - - static void CODEGEN_FUNCPTR Switch_GenTextures(GLsizei n, GLuint *textures) - { - GenTextures = (PFNGENTEXTURESPROC)IntGetProcAddress("glGenTextures"); - GenTextures(n, textures); - } - - static GLboolean CODEGEN_FUNCPTR Switch_IsTexture(GLuint texture) - { - IsTexture = (PFNISTEXTUREPROC)IntGetProcAddress("glIsTexture"); - return IsTexture(texture); - } - - static void CODEGEN_FUNCPTR Switch_Indexub(GLubyte c) - { - Indexub = (PFNINDEXUBPROC)IntGetProcAddress("glIndexub"); - Indexub(c); - } - - static void CODEGEN_FUNCPTR Switch_Indexubv(const GLubyte *c) - { - Indexubv = (PFNINDEXUBVPROC)IntGetProcAddress("glIndexubv"); - Indexubv(c); - } - - - // Extension: 1.2 - static void CODEGEN_FUNCPTR Switch_BlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) - { - BlendColor = (PFNBLENDCOLORPROC)IntGetProcAddress("glBlendColor"); - BlendColor(red, green, blue, alpha); - } - - static void CODEGEN_FUNCPTR Switch_BlendEquation(GLenum mode) - { - BlendEquation = (PFNBLENDEQUATIONPROC)IntGetProcAddress("glBlendEquation"); - BlendEquation(mode); - } - - static void CODEGEN_FUNCPTR Switch_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices) - { - DrawRangeElements = (PFNDRAWRANGEELEMENTSPROC)IntGetProcAddress("glDrawRangeElements"); - DrawRangeElements(mode, start, end, count, type, indices); - } - - static void CODEGEN_FUNCPTR Switch_TexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels) - { - TexSubImage3D = (PFNTEXSUBIMAGE3DPROC)IntGetProcAddress("glTexSubImage3D"); - TexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); - } - - static void CODEGEN_FUNCPTR Switch_CopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) - { - CopyTexSubImage3D = (PFNCOPYTEXSUBIMAGE3DPROC)IntGetProcAddress("glCopyTexSubImage3D"); - CopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height); - } - - - // Extension: 1.3 - static void CODEGEN_FUNCPTR Switch_ActiveTexture(GLenum texture) - { - ActiveTexture = (PFNACTIVETEXTUREPROC)IntGetProcAddress("glActiveTexture"); - ActiveTexture(texture); - } - - static void CODEGEN_FUNCPTR Switch_SampleCoverage(GLfloat value, GLboolean invert) - { - SampleCoverage = (PFNSAMPLECOVERAGEPROC)IntGetProcAddress("glSampleCoverage"); - SampleCoverage(value, invert); - } - - static void CODEGEN_FUNCPTR Switch_CompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) - { - CompressedTexImage3D = (PFNCOMPRESSEDTEXIMAGE3DPROC)IntGetProcAddress("glCompressedTexImage3D"); - CompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data); - } - - static void CODEGEN_FUNCPTR Switch_CompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) - { - CompressedTexImage2D = (PFNCOMPRESSEDTEXIMAGE2DPROC)IntGetProcAddress("glCompressedTexImage2D"); - CompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data); - } - - static void CODEGEN_FUNCPTR Switch_CompressedTexImage1D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) - { - CompressedTexImage1D = (PFNCOMPRESSEDTEXIMAGE1DPROC)IntGetProcAddress("glCompressedTexImage1D"); - CompressedTexImage1D(target, level, internalformat, width, border, imageSize, data); - } - - static void CODEGEN_FUNCPTR Switch_CompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) - { - CompressedTexSubImage3D = (PFNCOMPRESSEDTEXSUBIMAGE3DPROC)IntGetProcAddress("glCompressedTexSubImage3D"); - CompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); - } - - static void CODEGEN_FUNCPTR Switch_CompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) - { - CompressedTexSubImage2D = (PFNCOMPRESSEDTEXSUBIMAGE2DPROC)IntGetProcAddress("glCompressedTexSubImage2D"); - CompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data); - } - - static void CODEGEN_FUNCPTR Switch_CompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) - { - CompressedTexSubImage1D = (PFNCOMPRESSEDTEXSUBIMAGE1DPROC)IntGetProcAddress("glCompressedTexSubImage1D"); - CompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data); - } - - static void CODEGEN_FUNCPTR Switch_GetCompressedTexImage(GLenum target, GLint level, GLvoid *img) - { - GetCompressedTexImage = (PFNGETCOMPRESSEDTEXIMAGEPROC)IntGetProcAddress("glGetCompressedTexImage"); - GetCompressedTexImage(target, level, img); - } - - - // Extension: 1.4 - static void CODEGEN_FUNCPTR Switch_BlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) - { - BlendFuncSeparate = (PFNBLENDFUNCSEPARATEPROC)IntGetProcAddress("glBlendFuncSeparate"); - BlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); - } - - static void CODEGEN_FUNCPTR Switch_MultiDrawArrays(GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount) - { - MultiDrawArrays = (PFNMULTIDRAWARRAYSPROC)IntGetProcAddress("glMultiDrawArrays"); - MultiDrawArrays(mode, first, count, drawcount); - } - - static void CODEGEN_FUNCPTR Switch_MultiDrawElements(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount) - { - MultiDrawElements = (PFNMULTIDRAWELEMENTSPROC)IntGetProcAddress("glMultiDrawElements"); - MultiDrawElements(mode, count, type, indices, drawcount); - } - - static void CODEGEN_FUNCPTR Switch_PointParameterf(GLenum pname, GLfloat param) - { - PointParameterf = (PFNPOINTPARAMETERFPROC)IntGetProcAddress("glPointParameterf"); - PointParameterf(pname, param); - } - - static void CODEGEN_FUNCPTR Switch_PointParameterfv(GLenum pname, const GLfloat *params) - { - PointParameterfv = (PFNPOINTPARAMETERFVPROC)IntGetProcAddress("glPointParameterfv"); - PointParameterfv(pname, params); - } - - static void CODEGEN_FUNCPTR Switch_PointParameteri(GLenum pname, GLint param) - { - PointParameteri = (PFNPOINTPARAMETERIPROC)IntGetProcAddress("glPointParameteri"); - PointParameteri(pname, param); - } - - static void CODEGEN_FUNCPTR Switch_PointParameteriv(GLenum pname, const GLint *params) - { - PointParameteriv = (PFNPOINTPARAMETERIVPROC)IntGetProcAddress("glPointParameteriv"); - PointParameteriv(pname, params); - } - - - // Extension: 1.5 - static void CODEGEN_FUNCPTR Switch_GenQueries(GLsizei n, GLuint *ids) - { - GenQueries = (PFNGENQUERIESPROC)IntGetProcAddress("glGenQueries"); - GenQueries(n, ids); - } - - static void CODEGEN_FUNCPTR Switch_DeleteQueries(GLsizei n, const GLuint *ids) - { - DeleteQueries = (PFNDELETEQUERIESPROC)IntGetProcAddress("glDeleteQueries"); - DeleteQueries(n, ids); - } - - static GLboolean CODEGEN_FUNCPTR Switch_IsQuery(GLuint id) - { - IsQuery = (PFNISQUERYPROC)IntGetProcAddress("glIsQuery"); - return IsQuery(id); - } - - static void CODEGEN_FUNCPTR Switch_BeginQuery(GLenum target, GLuint id) - { - BeginQuery = (PFNBEGINQUERYPROC)IntGetProcAddress("glBeginQuery"); - BeginQuery(target, id); - } - - static void CODEGEN_FUNCPTR Switch_EndQuery(GLenum target) - { - EndQuery = (PFNENDQUERYPROC)IntGetProcAddress("glEndQuery"); - EndQuery(target); - } - - static void CODEGEN_FUNCPTR Switch_GetQueryiv(GLenum target, GLenum pname, GLint *params) - { - GetQueryiv = (PFNGETQUERYIVPROC)IntGetProcAddress("glGetQueryiv"); - GetQueryiv(target, pname, params); - } - - static void CODEGEN_FUNCPTR Switch_GetQueryObjectiv(GLuint id, GLenum pname, GLint *params) - { - GetQueryObjectiv = (PFNGETQUERYOBJECTIVPROC)IntGetProcAddress("glGetQueryObjectiv"); - GetQueryObjectiv(id, pname, params); - } - - static void CODEGEN_FUNCPTR Switch_GetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params) - { - GetQueryObjectuiv = (PFNGETQUERYOBJECTUIVPROC)IntGetProcAddress("glGetQueryObjectuiv"); - GetQueryObjectuiv(id, pname, params); - } - - static void CODEGEN_FUNCPTR Switch_BindBuffer(GLenum target, GLuint buffer) - { - BindBuffer = (PFNBINDBUFFERPROC)IntGetProcAddress("glBindBuffer"); - BindBuffer(target, buffer); - } - - static void CODEGEN_FUNCPTR Switch_DeleteBuffers(GLsizei n, const GLuint *buffers) - { - DeleteBuffers = (PFNDELETEBUFFERSPROC)IntGetProcAddress("glDeleteBuffers"); - DeleteBuffers(n, buffers); - } - - static void CODEGEN_FUNCPTR Switch_GenBuffers(GLsizei n, GLuint *buffers) - { - GenBuffers = (PFNGENBUFFERSPROC)IntGetProcAddress("glGenBuffers"); - GenBuffers(n, buffers); - } - - static GLboolean CODEGEN_FUNCPTR Switch_IsBuffer(GLuint buffer) - { - IsBuffer = (PFNISBUFFERPROC)IntGetProcAddress("glIsBuffer"); - return IsBuffer(buffer); - } - - static void CODEGEN_FUNCPTR Switch_BufferData(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage) - { - BufferData = (PFNBUFFERDATAPROC)IntGetProcAddress("glBufferData"); - BufferData(target, size, data, usage); - } - - static void CODEGEN_FUNCPTR Switch_BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data) - { - BufferSubData = (PFNBUFFERSUBDATAPROC)IntGetProcAddress("glBufferSubData"); - BufferSubData(target, offset, size, data); - } - - static void CODEGEN_FUNCPTR Switch_GetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data) - { - GetBufferSubData = (PFNGETBUFFERSUBDATAPROC)IntGetProcAddress("glGetBufferSubData"); - GetBufferSubData(target, offset, size, data); - } - - static GLvoid* CODEGEN_FUNCPTR Switch_MapBuffer(GLenum target, GLenum access) - { - MapBuffer = (PFNMAPBUFFERPROC)IntGetProcAddress("glMapBuffer"); - return MapBuffer(target, access); - } - - static GLboolean CODEGEN_FUNCPTR Switch_UnmapBuffer(GLenum target) - { - UnmapBuffer = (PFNUNMAPBUFFERPROC)IntGetProcAddress("glUnmapBuffer"); - return UnmapBuffer(target); - } - - static void CODEGEN_FUNCPTR Switch_GetBufferParameteriv(GLenum target, GLenum pname, GLint *params) - { - GetBufferParameteriv = (PFNGETBUFFERPARAMETERIVPROC)IntGetProcAddress("glGetBufferParameteriv"); - GetBufferParameteriv(target, pname, params); - } - - static void CODEGEN_FUNCPTR Switch_GetBufferPointerv(GLenum target, GLenum pname, GLvoid* *params) - { - GetBufferPointerv = (PFNGETBUFFERPOINTERVPROC)IntGetProcAddress("glGetBufferPointerv"); - GetBufferPointerv(target, pname, params); - } - - - // Extension: 2.0 - static void CODEGEN_FUNCPTR Switch_BlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) - { - BlendEquationSeparate = (PFNBLENDEQUATIONSEPARATEPROC)IntGetProcAddress("glBlendEquationSeparate"); - BlendEquationSeparate(modeRGB, modeAlpha); - } - - static void CODEGEN_FUNCPTR Switch_DrawBuffers(GLsizei n, const GLenum *bufs) - { - DrawBuffers = (PFNDRAWBUFFERSPROC)IntGetProcAddress("glDrawBuffers"); - DrawBuffers(n, bufs); - } - - static void CODEGEN_FUNCPTR Switch_StencilOpSeparate(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass) - { - StencilOpSeparate = (PFNSTENCILOPSEPARATEPROC)IntGetProcAddress("glStencilOpSeparate"); - StencilOpSeparate(face, sfail, dpfail, dppass); - } - - static void CODEGEN_FUNCPTR Switch_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) - { - StencilFuncSeparate = (PFNSTENCILFUNCSEPARATEPROC)IntGetProcAddress("glStencilFuncSeparate"); - StencilFuncSeparate(face, func, ref, mask); - } - - static void CODEGEN_FUNCPTR Switch_StencilMaskSeparate(GLenum face, GLuint mask) - { - StencilMaskSeparate = (PFNSTENCILMASKSEPARATEPROC)IntGetProcAddress("glStencilMaskSeparate"); - StencilMaskSeparate(face, mask); - } - - static void CODEGEN_FUNCPTR Switch_AttachShader(GLuint program, GLuint shader) - { - AttachShader = (PFNATTACHSHADERPROC)IntGetProcAddress("glAttachShader"); - AttachShader(program, shader); - } - - static void CODEGEN_FUNCPTR Switch_BindAttribLocation(GLuint program, GLuint index, const GLchar *name) - { - BindAttribLocation = (PFNBINDATTRIBLOCATIONPROC)IntGetProcAddress("glBindAttribLocation"); - BindAttribLocation(program, index, name); - } - - static void CODEGEN_FUNCPTR Switch_CompileShader(GLuint shader) - { - CompileShader = (PFNCOMPILESHADERPROC)IntGetProcAddress("glCompileShader"); - CompileShader(shader); - } - - static GLuint CODEGEN_FUNCPTR Switch_CreateProgram() - { - CreateProgram = (PFNCREATEPROGRAMPROC)IntGetProcAddress("glCreateProgram"); - return CreateProgram(); - } - - static GLuint CODEGEN_FUNCPTR Switch_CreateShader(GLenum type) - { - CreateShader = (PFNCREATESHADERPROC)IntGetProcAddress("glCreateShader"); - return CreateShader(type); - } - - static void CODEGEN_FUNCPTR Switch_DeleteProgram(GLuint program) - { - DeleteProgram = (PFNDELETEPROGRAMPROC)IntGetProcAddress("glDeleteProgram"); - DeleteProgram(program); - } - - static void CODEGEN_FUNCPTR Switch_DeleteShader(GLuint shader) - { - DeleteShader = (PFNDELETESHADERPROC)IntGetProcAddress("glDeleteShader"); - DeleteShader(shader); - } - - static void CODEGEN_FUNCPTR Switch_DetachShader(GLuint program, GLuint shader) - { - DetachShader = (PFNDETACHSHADERPROC)IntGetProcAddress("glDetachShader"); - DetachShader(program, shader); - } - - static void CODEGEN_FUNCPTR Switch_DisableVertexAttribArray(GLuint index) - { - DisableVertexAttribArray = (PFNDISABLEVERTEXATTRIBARRAYPROC)IntGetProcAddress("glDisableVertexAttribArray"); - DisableVertexAttribArray(index); - } - - static void CODEGEN_FUNCPTR Switch_EnableVertexAttribArray(GLuint index) - { - EnableVertexAttribArray = (PFNENABLEVERTEXATTRIBARRAYPROC)IntGetProcAddress("glEnableVertexAttribArray"); - EnableVertexAttribArray(index); - } - - static void CODEGEN_FUNCPTR Switch_GetActiveAttrib(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name) - { - GetActiveAttrib = (PFNGETACTIVEATTRIBPROC)IntGetProcAddress("glGetActiveAttrib"); - GetActiveAttrib(program, index, bufSize, length, size, type, name); - } - - static void CODEGEN_FUNCPTR Switch_GetActiveUniform(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name) - { - GetActiveUniform = (PFNGETACTIVEUNIFORMPROC)IntGetProcAddress("glGetActiveUniform"); - GetActiveUniform(program, index, bufSize, length, size, type, name); - } - - static void CODEGEN_FUNCPTR Switch_GetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj) - { - GetAttachedShaders = (PFNGETATTACHEDSHADERSPROC)IntGetProcAddress("glGetAttachedShaders"); - GetAttachedShaders(program, maxCount, count, obj); - } - - static GLint CODEGEN_FUNCPTR Switch_GetAttribLocation(GLuint program, const GLchar *name) - { - GetAttribLocation = (PFNGETATTRIBLOCATIONPROC)IntGetProcAddress("glGetAttribLocation"); - return GetAttribLocation(program, name); - } - - static void CODEGEN_FUNCPTR Switch_GetProgramiv(GLuint program, GLenum pname, GLint *params) - { - GetProgramiv = (PFNGETPROGRAMIVPROC)IntGetProcAddress("glGetProgramiv"); - GetProgramiv(program, pname, params); - } - - static void CODEGEN_FUNCPTR Switch_GetProgramInfoLog(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog) - { - GetProgramInfoLog = (PFNGETPROGRAMINFOLOGPROC)IntGetProcAddress("glGetProgramInfoLog"); - GetProgramInfoLog(program, bufSize, length, infoLog); - } - - static void CODEGEN_FUNCPTR Switch_GetShaderiv(GLuint shader, GLenum pname, GLint *params) - { - GetShaderiv = (PFNGETSHADERIVPROC)IntGetProcAddress("glGetShaderiv"); - GetShaderiv(shader, pname, params); - } - - static void CODEGEN_FUNCPTR Switch_GetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog) - { - GetShaderInfoLog = (PFNGETSHADERINFOLOGPROC)IntGetProcAddress("glGetShaderInfoLog"); - GetShaderInfoLog(shader, bufSize, length, infoLog); - } - - static void CODEGEN_FUNCPTR Switch_GetShaderSource(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source) - { - GetShaderSource = (PFNGETSHADERSOURCEPROC)IntGetProcAddress("glGetShaderSource"); - GetShaderSource(shader, bufSize, length, source); - } - - static GLint CODEGEN_FUNCPTR Switch_GetUniformLocation(GLuint program, const GLchar *name) - { - GetUniformLocation = (PFNGETUNIFORMLOCATIONPROC)IntGetProcAddress("glGetUniformLocation"); - return GetUniformLocation(program, name); - } - - static void CODEGEN_FUNCPTR Switch_GetUniformfv(GLuint program, GLint location, GLfloat *params) - { - GetUniformfv = (PFNGETUNIFORMFVPROC)IntGetProcAddress("glGetUniformfv"); - GetUniformfv(program, location, params); - } - - static void CODEGEN_FUNCPTR Switch_GetUniformiv(GLuint program, GLint location, GLint *params) - { - GetUniformiv = (PFNGETUNIFORMIVPROC)IntGetProcAddress("glGetUniformiv"); - GetUniformiv(program, location, params); - } - - static void CODEGEN_FUNCPTR Switch_GetVertexAttribdv(GLuint index, GLenum pname, GLdouble *params) - { - GetVertexAttribdv = (PFNGETVERTEXATTRIBDVPROC)IntGetProcAddress("glGetVertexAttribdv"); - GetVertexAttribdv(index, pname, params); - } - - static void CODEGEN_FUNCPTR Switch_GetVertexAttribfv(GLuint index, GLenum pname, GLfloat *params) - { - GetVertexAttribfv = (PFNGETVERTEXATTRIBFVPROC)IntGetProcAddress("glGetVertexAttribfv"); - GetVertexAttribfv(index, pname, params); - } - - static void CODEGEN_FUNCPTR Switch_GetVertexAttribiv(GLuint index, GLenum pname, GLint *params) - { - GetVertexAttribiv = (PFNGETVERTEXATTRIBIVPROC)IntGetProcAddress("glGetVertexAttribiv"); - GetVertexAttribiv(index, pname, params); - } - - static void CODEGEN_FUNCPTR Switch_GetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid* *pointer) - { - GetVertexAttribPointerv = (PFNGETVERTEXATTRIBPOINTERVPROC)IntGetProcAddress("glGetVertexAttribPointerv"); - GetVertexAttribPointerv(index, pname, pointer); - } - - static GLboolean CODEGEN_FUNCPTR Switch_IsProgram(GLuint program) - { - IsProgram = (PFNISPROGRAMPROC)IntGetProcAddress("glIsProgram"); - return IsProgram(program); - } - - static GLboolean CODEGEN_FUNCPTR Switch_IsShader(GLuint shader) - { - IsShader = (PFNISSHADERPROC)IntGetProcAddress("glIsShader"); - return IsShader(shader); - } - - static void CODEGEN_FUNCPTR Switch_LinkProgram(GLuint program) - { - LinkProgram = (PFNLINKPROGRAMPROC)IntGetProcAddress("glLinkProgram"); - LinkProgram(program); - } - - static void CODEGEN_FUNCPTR Switch_ShaderSource(GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length) - { - ShaderSource = (PFNSHADERSOURCEPROC)IntGetProcAddress("glShaderSource"); - ShaderSource(shader, count, string, length); - } - - static void CODEGEN_FUNCPTR Switch_UseProgram(GLuint program) - { - UseProgram = (PFNUSEPROGRAMPROC)IntGetProcAddress("glUseProgram"); - UseProgram(program); - } - - static void CODEGEN_FUNCPTR Switch_Uniform1f(GLint location, GLfloat v0) - { - Uniform1f = (PFNUNIFORM1FPROC)IntGetProcAddress("glUniform1f"); - Uniform1f(location, v0); - } - - static void CODEGEN_FUNCPTR Switch_Uniform2f(GLint location, GLfloat v0, GLfloat v1) - { - Uniform2f = (PFNUNIFORM2FPROC)IntGetProcAddress("glUniform2f"); - Uniform2f(location, v0, v1); - } - - static void CODEGEN_FUNCPTR Switch_Uniform3f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) - { - Uniform3f = (PFNUNIFORM3FPROC)IntGetProcAddress("glUniform3f"); - Uniform3f(location, v0, v1, v2); - } - - static void CODEGEN_FUNCPTR Switch_Uniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) - { - Uniform4f = (PFNUNIFORM4FPROC)IntGetProcAddress("glUniform4f"); - Uniform4f(location, v0, v1, v2, v3); - } - - static void CODEGEN_FUNCPTR Switch_Uniform1i(GLint location, GLint v0) - { - Uniform1i = (PFNUNIFORM1IPROC)IntGetProcAddress("glUniform1i"); - Uniform1i(location, v0); - } - - static void CODEGEN_FUNCPTR Switch_Uniform2i(GLint location, GLint v0, GLint v1) - { - Uniform2i = (PFNUNIFORM2IPROC)IntGetProcAddress("glUniform2i"); - Uniform2i(location, v0, v1); - } - - static void CODEGEN_FUNCPTR Switch_Uniform3i(GLint location, GLint v0, GLint v1, GLint v2) - { - Uniform3i = (PFNUNIFORM3IPROC)IntGetProcAddress("glUniform3i"); - Uniform3i(location, v0, v1, v2); - } - - static void CODEGEN_FUNCPTR Switch_Uniform4i(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) - { - Uniform4i = (PFNUNIFORM4IPROC)IntGetProcAddress("glUniform4i"); - Uniform4i(location, v0, v1, v2, v3); - } - - static void CODEGEN_FUNCPTR Switch_Uniform1fv(GLint location, GLsizei count, const GLfloat *value) - { - Uniform1fv = (PFNUNIFORM1FVPROC)IntGetProcAddress("glUniform1fv"); - Uniform1fv(location, count, value); - } - - static void CODEGEN_FUNCPTR Switch_Uniform2fv(GLint location, GLsizei count, const GLfloat *value) - { - Uniform2fv = (PFNUNIFORM2FVPROC)IntGetProcAddress("glUniform2fv"); - Uniform2fv(location, count, value); - } - - static void CODEGEN_FUNCPTR Switch_Uniform3fv(GLint location, GLsizei count, const GLfloat *value) - { - Uniform3fv = (PFNUNIFORM3FVPROC)IntGetProcAddress("glUniform3fv"); - Uniform3fv(location, count, value); - } - - static void CODEGEN_FUNCPTR Switch_Uniform4fv(GLint location, GLsizei count, const GLfloat *value) - { - Uniform4fv = (PFNUNIFORM4FVPROC)IntGetProcAddress("glUniform4fv"); - Uniform4fv(location, count, value); - } - - static void CODEGEN_FUNCPTR Switch_Uniform1iv(GLint location, GLsizei count, const GLint *value) - { - Uniform1iv = (PFNUNIFORM1IVPROC)IntGetProcAddress("glUniform1iv"); - Uniform1iv(location, count, value); - } - - static void CODEGEN_FUNCPTR Switch_Uniform2iv(GLint location, GLsizei count, const GLint *value) - { - Uniform2iv = (PFNUNIFORM2IVPROC)IntGetProcAddress("glUniform2iv"); - Uniform2iv(location, count, value); - } - - static void CODEGEN_FUNCPTR Switch_Uniform3iv(GLint location, GLsizei count, const GLint *value) - { - Uniform3iv = (PFNUNIFORM3IVPROC)IntGetProcAddress("glUniform3iv"); - Uniform3iv(location, count, value); - } - - static void CODEGEN_FUNCPTR Switch_Uniform4iv(GLint location, GLsizei count, const GLint *value) - { - Uniform4iv = (PFNUNIFORM4IVPROC)IntGetProcAddress("glUniform4iv"); - Uniform4iv(location, count, value); - } - - static void CODEGEN_FUNCPTR Switch_UniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) - { - UniformMatrix2fv = (PFNUNIFORMMATRIX2FVPROC)IntGetProcAddress("glUniformMatrix2fv"); - UniformMatrix2fv(location, count, transpose, value); - } - - static void CODEGEN_FUNCPTR Switch_UniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) - { - UniformMatrix3fv = (PFNUNIFORMMATRIX3FVPROC)IntGetProcAddress("glUniformMatrix3fv"); - UniformMatrix3fv(location, count, transpose, value); - } - - static void CODEGEN_FUNCPTR Switch_UniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) - { - UniformMatrix4fv = (PFNUNIFORMMATRIX4FVPROC)IntGetProcAddress("glUniformMatrix4fv"); - UniformMatrix4fv(location, count, transpose, value); - } - - static void CODEGEN_FUNCPTR Switch_ValidateProgram(GLuint program) - { - ValidateProgram = (PFNVALIDATEPROGRAMPROC)IntGetProcAddress("glValidateProgram"); - ValidateProgram(program); - } - - static void CODEGEN_FUNCPTR Switch_VertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer) - { - VertexAttribPointer = (PFNVERTEXATTRIBPOINTERPROC)IntGetProcAddress("glVertexAttribPointer"); - VertexAttribPointer(index, size, type, normalized, stride, pointer); - } - - - // Extension: 2.1 - static void CODEGEN_FUNCPTR Switch_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) - { - UniformMatrix2x3fv = (PFNUNIFORMMATRIX2X3FVPROC)IntGetProcAddress("glUniformMatrix2x3fv"); - UniformMatrix2x3fv(location, count, transpose, value); - } - - static void CODEGEN_FUNCPTR Switch_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) - { - UniformMatrix3x2fv = (PFNUNIFORMMATRIX3X2FVPROC)IntGetProcAddress("glUniformMatrix3x2fv"); - UniformMatrix3x2fv(location, count, transpose, value); - } - - static void CODEGEN_FUNCPTR Switch_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) - { - UniformMatrix2x4fv = (PFNUNIFORMMATRIX2X4FVPROC)IntGetProcAddress("glUniformMatrix2x4fv"); - UniformMatrix2x4fv(location, count, transpose, value); - } - - static void CODEGEN_FUNCPTR Switch_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) - { - UniformMatrix4x2fv = (PFNUNIFORMMATRIX4X2FVPROC)IntGetProcAddress("glUniformMatrix4x2fv"); - UniformMatrix4x2fv(location, count, transpose, value); - } - - static void CODEGEN_FUNCPTR Switch_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) - { - UniformMatrix3x4fv = (PFNUNIFORMMATRIX3X4FVPROC)IntGetProcAddress("glUniformMatrix3x4fv"); - UniformMatrix3x4fv(location, count, transpose, value); - } - - static void CODEGEN_FUNCPTR Switch_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) - { - UniformMatrix4x3fv = (PFNUNIFORMMATRIX4X3FVPROC)IntGetProcAddress("glUniformMatrix4x3fv"); - UniformMatrix4x3fv(location, count, transpose, value); - } - - - // Extension: ARB_vertex_array_object - static void CODEGEN_FUNCPTR Switch_BindVertexArray(GLuint ren_array) - { - BindVertexArray = (PFNBINDVERTEXARRAYPROC)IntGetProcAddress("glBindVertexArray"); - BindVertexArray(ren_array); - } - - static void CODEGEN_FUNCPTR Switch_DeleteVertexArrays(GLsizei n, const GLuint *arrays) - { - DeleteVertexArrays = (PFNDELETEVERTEXARRAYSPROC)IntGetProcAddress("glDeleteVertexArrays"); - DeleteVertexArrays(n, arrays); - } - - static void CODEGEN_FUNCPTR Switch_GenVertexArrays(GLsizei n, GLuint *arrays) - { - GenVertexArrays = (PFNGENVERTEXARRAYSPROC)IntGetProcAddress("glGenVertexArrays"); - GenVertexArrays(n, arrays); - } - - static GLboolean CODEGEN_FUNCPTR Switch_IsVertexArray(GLuint ren_array) - { - IsVertexArray = (PFNISVERTEXARRAYPROC)IntGetProcAddress("glIsVertexArray"); - return IsVertexArray(ren_array); - } - - - // Extension: ARB_map_buffer_range - static GLvoid* CODEGEN_FUNCPTR Switch_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access) - { - MapBufferRange = (PFNMAPBUFFERRANGEPROC)IntGetProcAddress("glMapBufferRange"); - return MapBufferRange(target, offset, length, access); - } - - static void CODEGEN_FUNCPTR Switch_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length) - { - FlushMappedBufferRange = (PFNFLUSHMAPPEDBUFFERRANGEPROC)IntGetProcAddress("glFlushMappedBufferRange"); - FlushMappedBufferRange(target, offset, length); - } - - - // Extension: ARB_framebuffer_object - static GLboolean CODEGEN_FUNCPTR Switch_IsRenderbuffer(GLuint renderbuffer) - { - IsRenderbuffer = (PFNISRENDERBUFFERPROC)IntGetProcAddress("glIsRenderbuffer"); - return IsRenderbuffer(renderbuffer); - } - - static void CODEGEN_FUNCPTR Switch_BindRenderbuffer(GLenum target, GLuint renderbuffer) - { - BindRenderbuffer = (PFNBINDRENDERBUFFERPROC)IntGetProcAddress("glBindRenderbuffer"); - BindRenderbuffer(target, renderbuffer); - } - - static void CODEGEN_FUNCPTR Switch_DeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers) - { - DeleteRenderbuffers = (PFNDELETERENDERBUFFERSPROC)IntGetProcAddress("glDeleteRenderbuffers"); - DeleteRenderbuffers(n, renderbuffers); - } - - static void CODEGEN_FUNCPTR Switch_GenRenderbuffers(GLsizei n, GLuint *renderbuffers) - { - GenRenderbuffers = (PFNGENRENDERBUFFERSPROC)IntGetProcAddress("glGenRenderbuffers"); - GenRenderbuffers(n, renderbuffers); - } - - static void CODEGEN_FUNCPTR Switch_RenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) - { - RenderbufferStorage = (PFNRENDERBUFFERSTORAGEPROC)IntGetProcAddress("glRenderbufferStorage"); - RenderbufferStorage(target, internalformat, width, height); - } - - static void CODEGEN_FUNCPTR Switch_GetRenderbufferParameteriv(GLenum target, GLenum pname, GLint *params) - { - GetRenderbufferParameteriv = (PFNGETRENDERBUFFERPARAMETERIVPROC)IntGetProcAddress("glGetRenderbufferParameteriv"); - GetRenderbufferParameteriv(target, pname, params); - } - - static GLboolean CODEGEN_FUNCPTR Switch_IsFramebuffer(GLuint framebuffer) - { - IsFramebuffer = (PFNISFRAMEBUFFERPROC)IntGetProcAddress("glIsFramebuffer"); - return IsFramebuffer(framebuffer); - } - - static void CODEGEN_FUNCPTR Switch_BindFramebuffer(GLenum target, GLuint framebuffer) - { - BindFramebuffer = (PFNBINDFRAMEBUFFERPROC)IntGetProcAddress("glBindFramebuffer"); - BindFramebuffer(target, framebuffer); - } - - static void CODEGEN_FUNCPTR Switch_DeleteFramebuffers(GLsizei n, const GLuint *framebuffers) - { - DeleteFramebuffers = (PFNDELETEFRAMEBUFFERSPROC)IntGetProcAddress("glDeleteFramebuffers"); - DeleteFramebuffers(n, framebuffers); - } - - static void CODEGEN_FUNCPTR Switch_GenFramebuffers(GLsizei n, GLuint *framebuffers) - { - GenFramebuffers = (PFNGENFRAMEBUFFERSPROC)IntGetProcAddress("glGenFramebuffers"); - GenFramebuffers(n, framebuffers); - } - - static GLenum CODEGEN_FUNCPTR Switch_CheckFramebufferStatus(GLenum target) - { - CheckFramebufferStatus = (PFNCHECKFRAMEBUFFERSTATUSPROC)IntGetProcAddress("glCheckFramebufferStatus"); - return CheckFramebufferStatus(target); - } - - static void CODEGEN_FUNCPTR Switch_FramebufferTexture1D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) - { - FramebufferTexture1D = (PFNFRAMEBUFFERTEXTURE1DPROC)IntGetProcAddress("glFramebufferTexture1D"); - FramebufferTexture1D(target, attachment, textarget, texture, level); - } - - static void CODEGEN_FUNCPTR Switch_FramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) - { - FramebufferTexture2D = (PFNFRAMEBUFFERTEXTURE2DPROC)IntGetProcAddress("glFramebufferTexture2D"); - FramebufferTexture2D(target, attachment, textarget, texture, level); - } - - static void CODEGEN_FUNCPTR Switch_FramebufferTexture3D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) - { - FramebufferTexture3D = (PFNFRAMEBUFFERTEXTURE3DPROC)IntGetProcAddress("glFramebufferTexture3D"); - FramebufferTexture3D(target, attachment, textarget, texture, level, zoffset); - } - - static void CODEGEN_FUNCPTR Switch_FramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) - { - FramebufferRenderbuffer = (PFNFRAMEBUFFERRENDERBUFFERPROC)IntGetProcAddress("glFramebufferRenderbuffer"); - FramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer); - } - - static void CODEGEN_FUNCPTR Switch_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint *params) - { - GetFramebufferAttachmentParameteriv = (PFNGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)IntGetProcAddress("glGetFramebufferAttachmentParameteriv"); - GetFramebufferAttachmentParameteriv(target, attachment, pname, params); - } - - static void CODEGEN_FUNCPTR Switch_GenerateMipmap(GLenum target) - { - GenerateMipmap = (PFNGENERATEMIPMAPPROC)IntGetProcAddress("glGenerateMipmap"); - GenerateMipmap(target); - } - - static void CODEGEN_FUNCPTR Switch_BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) - { - BlitFramebuffer = (PFNBLITFRAMEBUFFERPROC)IntGetProcAddress("glBlitFramebuffer"); - BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); - } - - static void CODEGEN_FUNCPTR Switch_RenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) - { - RenderbufferStorageMultisample = (PFNRENDERBUFFERSTORAGEMULTISAMPLEPROC)IntGetProcAddress("glRenderbufferStorageMultisample"); - RenderbufferStorageMultisample(target, samples, internalformat, width, height); - } - - static void CODEGEN_FUNCPTR Switch_FramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) - { - FramebufferTextureLayer = (PFNFRAMEBUFFERTEXTURELAYERPROC)IntGetProcAddress("glFramebufferTextureLayer"); - FramebufferTextureLayer(target, attachment, texture, level, layer); - } - - - // Extension: 3.0 - static void CODEGEN_FUNCPTR Switch_ColorMaski(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a) - { - ColorMaski = (PFNCOLORMASKIPROC)IntGetProcAddress("glColorMaski"); - ColorMaski(index, r, g, b, a); - } - - static void CODEGEN_FUNCPTR Switch_GetBooleani_v(GLenum target, GLuint index, GLboolean *data) - { - GetBooleani_v = (PFNGETBOOLEANI_VPROC)IntGetProcAddress("glGetBooleani_v"); - GetBooleani_v(target, index, data); - } - - static void CODEGEN_FUNCPTR Switch_GetIntegeri_v(GLenum target, GLuint index, GLint *data) - { - GetIntegeri_v = (PFNGETINTEGERI_VPROC)IntGetProcAddress("glGetIntegeri_v"); - GetIntegeri_v(target, index, data); - } - - static void CODEGEN_FUNCPTR Switch_Enablei(GLenum target, GLuint index) - { - Enablei = (PFNENABLEIPROC)IntGetProcAddress("glEnablei"); - Enablei(target, index); - } - - static void CODEGEN_FUNCPTR Switch_Disablei(GLenum target, GLuint index) - { - Disablei = (PFNDISABLEIPROC)IntGetProcAddress("glDisablei"); - Disablei(target, index); - } - - static GLboolean CODEGEN_FUNCPTR Switch_IsEnabledi(GLenum target, GLuint index) - { - IsEnabledi = (PFNISENABLEDIPROC)IntGetProcAddress("glIsEnabledi"); - return IsEnabledi(target, index); - } - - static void CODEGEN_FUNCPTR Switch_BeginTransformFeedback(GLenum primitiveMode) - { - BeginTransformFeedback = (PFNBEGINTRANSFORMFEEDBACKPROC)IntGetProcAddress("glBeginTransformFeedback"); - BeginTransformFeedback(primitiveMode); - } - - static void CODEGEN_FUNCPTR Switch_EndTransformFeedback() - { - EndTransformFeedback = (PFNENDTRANSFORMFEEDBACKPROC)IntGetProcAddress("glEndTransformFeedback"); - EndTransformFeedback(); - } - - static void CODEGEN_FUNCPTR Switch_BindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) - { - BindBufferRange = (PFNBINDBUFFERRANGEPROC)IntGetProcAddress("glBindBufferRange"); - BindBufferRange(target, index, buffer, offset, size); - } - - static void CODEGEN_FUNCPTR Switch_BindBufferBase(GLenum target, GLuint index, GLuint buffer) - { - BindBufferBase = (PFNBINDBUFFERBASEPROC)IntGetProcAddress("glBindBufferBase"); - BindBufferBase(target, index, buffer); - } - - static void CODEGEN_FUNCPTR Switch_TransformFeedbackVaryings(GLuint program, GLsizei count, const GLchar* const *varyings, GLenum bufferMode) - { - TransformFeedbackVaryings = (PFNTRANSFORMFEEDBACKVARYINGSPROC)IntGetProcAddress("glTransformFeedbackVaryings"); - TransformFeedbackVaryings(program, count, varyings, bufferMode); - } - - static void CODEGEN_FUNCPTR Switch_GetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name) - { - GetTransformFeedbackVarying = (PFNGETTRANSFORMFEEDBACKVARYINGPROC)IntGetProcAddress("glGetTransformFeedbackVarying"); - GetTransformFeedbackVarying(program, index, bufSize, length, size, type, name); - } - - static void CODEGEN_FUNCPTR Switch_ClampColor(GLenum target, GLenum clamp) - { - ClampColor = (PFNCLAMPCOLORPROC)IntGetProcAddress("glClampColor"); - ClampColor(target, clamp); - } - - static void CODEGEN_FUNCPTR Switch_BeginConditionalRender(GLuint id, GLenum mode) - { - BeginConditionalRender = (PFNBEGINCONDITIONALRENDERPROC)IntGetProcAddress("glBeginConditionalRender"); - BeginConditionalRender(id, mode); - } - - static void CODEGEN_FUNCPTR Switch_EndConditionalRender() - { - EndConditionalRender = (PFNENDCONDITIONALRENDERPROC)IntGetProcAddress("glEndConditionalRender"); - EndConditionalRender(); - } - - static void CODEGEN_FUNCPTR Switch_VertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) - { - VertexAttribIPointer = (PFNVERTEXATTRIBIPOINTERPROC)IntGetProcAddress("glVertexAttribIPointer"); - VertexAttribIPointer(index, size, type, stride, pointer); - } - - static void CODEGEN_FUNCPTR Switch_GetVertexAttribIiv(GLuint index, GLenum pname, GLint *params) - { - GetVertexAttribIiv = (PFNGETVERTEXATTRIBIIVPROC)IntGetProcAddress("glGetVertexAttribIiv"); - GetVertexAttribIiv(index, pname, params); - } - - static void CODEGEN_FUNCPTR Switch_GetVertexAttribIuiv(GLuint index, GLenum pname, GLuint *params) - { - GetVertexAttribIuiv = (PFNGETVERTEXATTRIBIUIVPROC)IntGetProcAddress("glGetVertexAttribIuiv"); - GetVertexAttribIuiv(index, pname, params); - } - - static void CODEGEN_FUNCPTR Switch_VertexAttribI1i(GLuint index, GLint x) - { - VertexAttribI1i = (PFNVERTEXATTRIBI1IPROC)IntGetProcAddress("glVertexAttribI1i"); - VertexAttribI1i(index, x); - } - - static void CODEGEN_FUNCPTR Switch_VertexAttribI2i(GLuint index, GLint x, GLint y) - { - VertexAttribI2i = (PFNVERTEXATTRIBI2IPROC)IntGetProcAddress("glVertexAttribI2i"); - VertexAttribI2i(index, x, y); - } - - static void CODEGEN_FUNCPTR Switch_VertexAttribI3i(GLuint index, GLint x, GLint y, GLint z) - { - VertexAttribI3i = (PFNVERTEXATTRIBI3IPROC)IntGetProcAddress("glVertexAttribI3i"); - VertexAttribI3i(index, x, y, z); - } - - static void CODEGEN_FUNCPTR Switch_VertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w) - { - VertexAttribI4i = (PFNVERTEXATTRIBI4IPROC)IntGetProcAddress("glVertexAttribI4i"); - VertexAttribI4i(index, x, y, z, w); - } - - static void CODEGEN_FUNCPTR Switch_VertexAttribI1ui(GLuint index, GLuint x) - { - VertexAttribI1ui = (PFNVERTEXATTRIBI1UIPROC)IntGetProcAddress("glVertexAttribI1ui"); - VertexAttribI1ui(index, x); - } - - static void CODEGEN_FUNCPTR Switch_VertexAttribI2ui(GLuint index, GLuint x, GLuint y) - { - VertexAttribI2ui = (PFNVERTEXATTRIBI2UIPROC)IntGetProcAddress("glVertexAttribI2ui"); - VertexAttribI2ui(index, x, y); - } - - static void CODEGEN_FUNCPTR Switch_VertexAttribI3ui(GLuint index, GLuint x, GLuint y, GLuint z) - { - VertexAttribI3ui = (PFNVERTEXATTRIBI3UIPROC)IntGetProcAddress("glVertexAttribI3ui"); - VertexAttribI3ui(index, x, y, z); - } - - static void CODEGEN_FUNCPTR Switch_VertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) - { - VertexAttribI4ui = (PFNVERTEXATTRIBI4UIPROC)IntGetProcAddress("glVertexAttribI4ui"); - VertexAttribI4ui(index, x, y, z, w); - } - - static void CODEGEN_FUNCPTR Switch_VertexAttribI1iv(GLuint index, const GLint *v) - { - VertexAttribI1iv = (PFNVERTEXATTRIBI1IVPROC)IntGetProcAddress("glVertexAttribI1iv"); - VertexAttribI1iv(index, v); - } - - static void CODEGEN_FUNCPTR Switch_VertexAttribI2iv(GLuint index, const GLint *v) - { - VertexAttribI2iv = (PFNVERTEXATTRIBI2IVPROC)IntGetProcAddress("glVertexAttribI2iv"); - VertexAttribI2iv(index, v); - } - - static void CODEGEN_FUNCPTR Switch_VertexAttribI3iv(GLuint index, const GLint *v) - { - VertexAttribI3iv = (PFNVERTEXATTRIBI3IVPROC)IntGetProcAddress("glVertexAttribI3iv"); - VertexAttribI3iv(index, v); - } - - static void CODEGEN_FUNCPTR Switch_VertexAttribI4iv(GLuint index, const GLint *v) - { - VertexAttribI4iv = (PFNVERTEXATTRIBI4IVPROC)IntGetProcAddress("glVertexAttribI4iv"); - VertexAttribI4iv(index, v); - } - - static void CODEGEN_FUNCPTR Switch_VertexAttribI1uiv(GLuint index, const GLuint *v) - { - VertexAttribI1uiv = (PFNVERTEXATTRIBI1UIVPROC)IntGetProcAddress("glVertexAttribI1uiv"); - VertexAttribI1uiv(index, v); - } - - static void CODEGEN_FUNCPTR Switch_VertexAttribI2uiv(GLuint index, const GLuint *v) - { - VertexAttribI2uiv = (PFNVERTEXATTRIBI2UIVPROC)IntGetProcAddress("glVertexAttribI2uiv"); - VertexAttribI2uiv(index, v); - } - - static void CODEGEN_FUNCPTR Switch_VertexAttribI3uiv(GLuint index, const GLuint *v) - { - VertexAttribI3uiv = (PFNVERTEXATTRIBI3UIVPROC)IntGetProcAddress("glVertexAttribI3uiv"); - VertexAttribI3uiv(index, v); - } - - static void CODEGEN_FUNCPTR Switch_VertexAttribI4uiv(GLuint index, const GLuint *v) - { - VertexAttribI4uiv = (PFNVERTEXATTRIBI4UIVPROC)IntGetProcAddress("glVertexAttribI4uiv"); - VertexAttribI4uiv(index, v); - } - - static void CODEGEN_FUNCPTR Switch_VertexAttribI4bv(GLuint index, const GLbyte *v) - { - VertexAttribI4bv = (PFNVERTEXATTRIBI4BVPROC)IntGetProcAddress("glVertexAttribI4bv"); - VertexAttribI4bv(index, v); - } - - static void CODEGEN_FUNCPTR Switch_VertexAttribI4sv(GLuint index, const GLshort *v) - { - VertexAttribI4sv = (PFNVERTEXATTRIBI4SVPROC)IntGetProcAddress("glVertexAttribI4sv"); - VertexAttribI4sv(index, v); - } - - static void CODEGEN_FUNCPTR Switch_VertexAttribI4ubv(GLuint index, const GLubyte *v) - { - VertexAttribI4ubv = (PFNVERTEXATTRIBI4UBVPROC)IntGetProcAddress("glVertexAttribI4ubv"); - VertexAttribI4ubv(index, v); - } - - static void CODEGEN_FUNCPTR Switch_VertexAttribI4usv(GLuint index, const GLushort *v) - { - VertexAttribI4usv = (PFNVERTEXATTRIBI4USVPROC)IntGetProcAddress("glVertexAttribI4usv"); - VertexAttribI4usv(index, v); - } - - static void CODEGEN_FUNCPTR Switch_GetUniformuiv(GLuint program, GLint location, GLuint *params) - { - GetUniformuiv = (PFNGETUNIFORMUIVPROC)IntGetProcAddress("glGetUniformuiv"); - GetUniformuiv(program, location, params); - } - - static void CODEGEN_FUNCPTR Switch_BindFragDataLocation(GLuint program, GLuint color, const GLchar *name) - { - BindFragDataLocation = (PFNBINDFRAGDATALOCATIONPROC)IntGetProcAddress("glBindFragDataLocation"); - BindFragDataLocation(program, color, name); - } - - static GLint CODEGEN_FUNCPTR Switch_GetFragDataLocation(GLuint program, const GLchar *name) - { - GetFragDataLocation = (PFNGETFRAGDATALOCATIONPROC)IntGetProcAddress("glGetFragDataLocation"); - return GetFragDataLocation(program, name); - } - - static void CODEGEN_FUNCPTR Switch_Uniform1ui(GLint location, GLuint v0) - { - Uniform1ui = (PFNUNIFORM1UIPROC)IntGetProcAddress("glUniform1ui"); - Uniform1ui(location, v0); - } - - static void CODEGEN_FUNCPTR Switch_Uniform2ui(GLint location, GLuint v0, GLuint v1) - { - Uniform2ui = (PFNUNIFORM2UIPROC)IntGetProcAddress("glUniform2ui"); - Uniform2ui(location, v0, v1); - } - - static void CODEGEN_FUNCPTR Switch_Uniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2) - { - Uniform3ui = (PFNUNIFORM3UIPROC)IntGetProcAddress("glUniform3ui"); - Uniform3ui(location, v0, v1, v2); - } - - static void CODEGEN_FUNCPTR Switch_Uniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) - { - Uniform4ui = (PFNUNIFORM4UIPROC)IntGetProcAddress("glUniform4ui"); - Uniform4ui(location, v0, v1, v2, v3); - } - - static void CODEGEN_FUNCPTR Switch_Uniform1uiv(GLint location, GLsizei count, const GLuint *value) - { - Uniform1uiv = (PFNUNIFORM1UIVPROC)IntGetProcAddress("glUniform1uiv"); - Uniform1uiv(location, count, value); - } - - static void CODEGEN_FUNCPTR Switch_Uniform2uiv(GLint location, GLsizei count, const GLuint *value) - { - Uniform2uiv = (PFNUNIFORM2UIVPROC)IntGetProcAddress("glUniform2uiv"); - Uniform2uiv(location, count, value); - } - - static void CODEGEN_FUNCPTR Switch_Uniform3uiv(GLint location, GLsizei count, const GLuint *value) - { - Uniform3uiv = (PFNUNIFORM3UIVPROC)IntGetProcAddress("glUniform3uiv"); - Uniform3uiv(location, count, value); - } - - static void CODEGEN_FUNCPTR Switch_Uniform4uiv(GLint location, GLsizei count, const GLuint *value) - { - Uniform4uiv = (PFNUNIFORM4UIVPROC)IntGetProcAddress("glUniform4uiv"); - Uniform4uiv(location, count, value); - } - - static void CODEGEN_FUNCPTR Switch_TexParameterIiv(GLenum target, GLenum pname, const GLint *params) - { - TexParameterIiv = (PFNTEXPARAMETERIIVPROC)IntGetProcAddress("glTexParameterIiv"); - TexParameterIiv(target, pname, params); - } - - static void CODEGEN_FUNCPTR Switch_TexParameterIuiv(GLenum target, GLenum pname, const GLuint *params) - { - TexParameterIuiv = (PFNTEXPARAMETERIUIVPROC)IntGetProcAddress("glTexParameterIuiv"); - TexParameterIuiv(target, pname, params); - } - - static void CODEGEN_FUNCPTR Switch_GetTexParameterIiv(GLenum target, GLenum pname, GLint *params) - { - GetTexParameterIiv = (PFNGETTEXPARAMETERIIVPROC)IntGetProcAddress("glGetTexParameterIiv"); - GetTexParameterIiv(target, pname, params); - } - - static void CODEGEN_FUNCPTR Switch_GetTexParameterIuiv(GLenum target, GLenum pname, GLuint *params) - { - GetTexParameterIuiv = (PFNGETTEXPARAMETERIUIVPROC)IntGetProcAddress("glGetTexParameterIuiv"); - GetTexParameterIuiv(target, pname, params); - } - - static void CODEGEN_FUNCPTR Switch_ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *value) - { - ClearBufferiv = (PFNCLEARBUFFERIVPROC)IntGetProcAddress("glClearBufferiv"); - ClearBufferiv(buffer, drawbuffer, value); - } - - static void CODEGEN_FUNCPTR Switch_ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint *value) - { - ClearBufferuiv = (PFNCLEARBUFFERUIVPROC)IntGetProcAddress("glClearBufferuiv"); - ClearBufferuiv(buffer, drawbuffer, value); - } - - static void CODEGEN_FUNCPTR Switch_ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *value) - { - ClearBufferfv = (PFNCLEARBUFFERFVPROC)IntGetProcAddress("glClearBufferfv"); - ClearBufferfv(buffer, drawbuffer, value); - } - - static void CODEGEN_FUNCPTR Switch_ClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil) - { - ClearBufferfi = (PFNCLEARBUFFERFIPROC)IntGetProcAddress("glClearBufferfi"); - ClearBufferfi(buffer, drawbuffer, depth, stencil); - } - - static const GLubyte * CODEGEN_FUNCPTR Switch_GetStringi(GLenum name, GLuint index) - { - GetStringi = (PFNGETSTRINGIPROC)IntGetProcAddress("glGetStringi"); - return GetStringi(name, index); - } - - - // Extension: ARB_uniform_buffer_object - static void CODEGEN_FUNCPTR Switch_GetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar* const *uniformNames, GLuint *uniformIndices) - { - GetUniformIndices = (PFNGETUNIFORMINDICESPROC)IntGetProcAddress("glGetUniformIndices"); - GetUniformIndices(program, uniformCount, uniformNames, uniformIndices); - } - - static void CODEGEN_FUNCPTR Switch_GetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params) - { - GetActiveUniformsiv = (PFNGETACTIVEUNIFORMSIVPROC)IntGetProcAddress("glGetActiveUniformsiv"); - GetActiveUniformsiv(program, uniformCount, uniformIndices, pname, params); - } - - static void CODEGEN_FUNCPTR Switch_GetActiveUniformName(GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName) - { - GetActiveUniformName = (PFNGETACTIVEUNIFORMNAMEPROC)IntGetProcAddress("glGetActiveUniformName"); - GetActiveUniformName(program, uniformIndex, bufSize, length, uniformName); - } - - static GLuint CODEGEN_FUNCPTR Switch_GetUniformBlockIndex(GLuint program, const GLchar *uniformBlockName) - { - GetUniformBlockIndex = (PFNGETUNIFORMBLOCKINDEXPROC)IntGetProcAddress("glGetUniformBlockIndex"); - return GetUniformBlockIndex(program, uniformBlockName); - } - - static void CODEGEN_FUNCPTR Switch_GetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params) - { - GetActiveUniformBlockiv = (PFNGETACTIVEUNIFORMBLOCKIVPROC)IntGetProcAddress("glGetActiveUniformBlockiv"); - GetActiveUniformBlockiv(program, uniformBlockIndex, pname, params); - } - - static void CODEGEN_FUNCPTR Switch_GetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName) - { - GetActiveUniformBlockName = (PFNGETACTIVEUNIFORMBLOCKNAMEPROC)IntGetProcAddress("glGetActiveUniformBlockName"); - GetActiveUniformBlockName(program, uniformBlockIndex, bufSize, length, uniformBlockName); - } - - static void CODEGEN_FUNCPTR Switch_UniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding) - { - UniformBlockBinding = (PFNUNIFORMBLOCKBINDINGPROC)IntGetProcAddress("glUniformBlockBinding"); - UniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding); - } - - - // Extension: ARB_copy_buffer - static void CODEGEN_FUNCPTR Switch_CopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size) - { - CopyBufferSubData = (PFNCOPYBUFFERSUBDATAPROC)IntGetProcAddress("glCopyBufferSubData"); - CopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size); - } - - - // Extension: 3.1 - static void CODEGEN_FUNCPTR Switch_DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instancecount) - { - DrawArraysInstanced = (PFNDRAWARRAYSINSTANCEDPROC)IntGetProcAddress("glDrawArraysInstanced"); - DrawArraysInstanced(mode, first, count, instancecount); - } - - static void CODEGEN_FUNCPTR Switch_DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount) - { - DrawElementsInstanced = (PFNDRAWELEMENTSINSTANCEDPROC)IntGetProcAddress("glDrawElementsInstanced"); - DrawElementsInstanced(mode, count, type, indices, instancecount); - } - - static void CODEGEN_FUNCPTR Switch_TexBuffer(GLenum target, GLenum internalformat, GLuint buffer) - { - TexBuffer = (PFNTEXBUFFERPROC)IntGetProcAddress("glTexBuffer"); - TexBuffer(target, internalformat, buffer); - } - - static void CODEGEN_FUNCPTR Switch_PrimitiveRestartIndex(GLuint index) - { - PrimitiveRestartIndex = (PFNPRIMITIVERESTARTINDEXPROC)IntGetProcAddress("glPrimitiveRestartIndex"); - PrimitiveRestartIndex(index); - } - - // Legacy - static void CODEGEN_FUNCPTR Switch_EnableClientState(GLenum cap) - { - EnableClientState = (PFNENABLECLIENTSTATEPROC)IntGetProcAddress("glEnableClientState"); - EnableClientState(cap); - } - - static void CODEGEN_FUNCPTR Switch_DisableClientState(GLenum cap) - { - DisableClientState = (PFNDISABLECLIENTSTATEPROC)IntGetProcAddress("glDisableClientState"); - DisableClientState(cap); - } - - static void CODEGEN_FUNCPTR Switch_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) - { - VertexPointer = (PFNVERTEXPOINTERPROC)IntGetProcAddress("glVertexPointer"); - VertexPointer(size, type, stride, ptr); - } - - static void CODEGEN_FUNCPTR Switch_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr) - { - NormalPointer = (PFNNORMALPOINTERPROC)IntGetProcAddress("glNormalPointer"); - NormalPointer(type, stride, ptr); - } - - static void CODEGEN_FUNCPTR Switch_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) - { - ColorPointer = (PFNCOLORPOINTERPROC)IntGetProcAddress("glColorPointer"); - ColorPointer(size, type, stride, ptr); - } - - static void CODEGEN_FUNCPTR Switch_TexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) - { - TexCoordPointer = (PFNTEXCOORDPOINTERPROC)IntGetProcAddress("glTexCoordPointer"); - TexCoordPointer(size, type, stride, ptr); - } - - static void CODEGEN_FUNCPTR Switch_TexEnvi(GLenum target, GLenum pname, GLint param) - { - TexEnvi = (PFNTEXENVIPROC)IntGetProcAddress("glTexEnvi"); - TexEnvi(target, pname, param); - } - - static void CODEGEN_FUNCPTR Switch_MatrixMode(GLenum mode) - { - MatrixMode = (PFNMATRIXMODEPROC)IntGetProcAddress("glMatrixMode"); - MatrixMode(mode); - } - - static void CODEGEN_FUNCPTR Switch_LoadIdentity(void) - { - LoadIdentity = (PFNLOADIDENTITYPROC)IntGetProcAddress("glLoadIdentity"); - LoadIdentity(); - } - - static void CODEGEN_FUNCPTR Switch_Ortho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val) - { - Ortho = (PFNORTHOPROC)IntGetProcAddress("glOrtho"); - Ortho(left, right, bottom, top, near_val, far_val); - } - - static void CODEGEN_FUNCPTR Switch_Color3d(GLdouble red, GLdouble green, GLdouble blue) - { - Color3d = (PFNCOLOR3DPROC)IntGetProcAddress("glColor3d"); - Color3d(red, green, blue); - } - - - - namespace - { + ////////////////////////////////////////////// + // Function pointer types + + // Extension: 1.1 + typedef void (CODEGEN_FUNCPTR *PFNCULLFACEPROC)(GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNFRONTFACEPROC)(GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNHINTPROC)(GLenum , GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNLINEWIDTHPROC)(GLfloat ); + typedef void (CODEGEN_FUNCPTR *PFNPOINTSIZEPROC)(GLfloat ); + typedef void (CODEGEN_FUNCPTR *PFNPOLYGONMODEPROC)(GLenum , GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNSCISSORPROC)(GLint , GLint , GLsizei , GLsizei ); + typedef void (CODEGEN_FUNCPTR *PFNTEXPARAMETERFPROC)(GLenum , GLenum , GLfloat ); + typedef void (CODEGEN_FUNCPTR *PFNTEXPARAMETERFVPROC)(GLenum , GLenum , const GLfloat *); + typedef void (CODEGEN_FUNCPTR *PFNTEXPARAMETERIPROC)(GLenum , GLenum , GLint ); + typedef void (CODEGEN_FUNCPTR *PFNTEXPARAMETERIVPROC)(GLenum , GLenum , const GLint *); + typedef void (CODEGEN_FUNCPTR *PFNTEXIMAGE1DPROC)(GLenum , GLint , GLint , GLsizei , GLint , GLenum , GLenum , const GLvoid *); + typedef void (CODEGEN_FUNCPTR *PFNTEXIMAGE2DPROC)(GLenum , GLint , GLint , GLsizei , GLsizei , GLint , GLenum , GLenum , const GLvoid *); + typedef void (CODEGEN_FUNCPTR *PFNDRAWBUFFERPROC)(GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNCLEARPROC)(GLbitfield ); + typedef void (CODEGEN_FUNCPTR *PFNCLEARCOLORPROC)(GLfloat , GLfloat , GLfloat , GLfloat ); + typedef void (CODEGEN_FUNCPTR *PFNCLEARSTENCILPROC)(GLint ); + typedef void (CODEGEN_FUNCPTR *PFNCLEARDEPTHPROC)(GLdouble ); + typedef void (CODEGEN_FUNCPTR *PFNSTENCILMASKPROC)(GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNCOLORMASKPROC)(GLboolean , GLboolean , GLboolean , GLboolean ); + typedef void (CODEGEN_FUNCPTR *PFNDEPTHMASKPROC)(GLboolean ); + typedef void (CODEGEN_FUNCPTR *PFNDISABLEPROC)(GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNENABLEPROC)(GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNFINISHPROC)(); + typedef void (CODEGEN_FUNCPTR *PFNFLUSHPROC)(); + typedef void (CODEGEN_FUNCPTR *PFNBLENDFUNCPROC)(GLenum , GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNLOGICOPPROC)(GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNSTENCILFUNCPROC)(GLenum , GLint , GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNSTENCILOPPROC)(GLenum , GLenum , GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNDEPTHFUNCPROC)(GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNPIXELSTOREFPROC)(GLenum , GLfloat ); + typedef void (CODEGEN_FUNCPTR *PFNPIXELSTOREIPROC)(GLenum , GLint ); + typedef void (CODEGEN_FUNCPTR *PFNREADBUFFERPROC)(GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNREADPIXELSPROC)(GLint , GLint , GLsizei , GLsizei , GLenum , GLenum , GLvoid *); + typedef void (CODEGEN_FUNCPTR *PFNGETBOOLEANVPROC)(GLenum , GLboolean *); + typedef void (CODEGEN_FUNCPTR *PFNGETDOUBLEVPROC)(GLenum , GLdouble *); + typedef GLenum (CODEGEN_FUNCPTR *PFNGETERRORPROC)(); + typedef void (CODEGEN_FUNCPTR *PFNGETFLOATVPROC)(GLenum , GLfloat *); + typedef void (CODEGEN_FUNCPTR *PFNGETINTEGERVPROC)(GLenum , GLint *); + typedef const GLubyte * (CODEGEN_FUNCPTR *PFNGETSTRINGPROC)(GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNGETTEXIMAGEPROC)(GLenum , GLint , GLenum , GLenum , GLvoid *); + typedef void (CODEGEN_FUNCPTR *PFNGETTEXPARAMETERFVPROC)(GLenum , GLenum , GLfloat *); + typedef void (CODEGEN_FUNCPTR *PFNGETTEXPARAMETERIVPROC)(GLenum , GLenum , GLint *); + typedef void (CODEGEN_FUNCPTR *PFNGETTEXLEVELPARAMETERFVPROC)(GLenum , GLint , GLenum , GLfloat *); + typedef void (CODEGEN_FUNCPTR *PFNGETTEXLEVELPARAMETERIVPROC)(GLenum , GLint , GLenum , GLint *); + typedef GLboolean (CODEGEN_FUNCPTR *PFNISENABLEDPROC)(GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNDEPTHRANGEPROC)(GLdouble , GLdouble ); + typedef void (CODEGEN_FUNCPTR *PFNVIEWPORTPROC)(GLint , GLint , GLsizei , GLsizei ); + typedef void (CODEGEN_FUNCPTR *PFNDRAWARRAYSPROC)(GLenum , GLint , GLsizei ); + typedef void (CODEGEN_FUNCPTR *PFNDRAWELEMENTSPROC)(GLenum , GLsizei , GLenum , const GLvoid *); + typedef void (CODEGEN_FUNCPTR *PFNGETPOINTERVPROC)(GLenum , GLvoid* *); + typedef void (CODEGEN_FUNCPTR *PFNPOLYGONOFFSETPROC)(GLfloat , GLfloat ); + typedef void (CODEGEN_FUNCPTR *PFNCOPYTEXIMAGE1DPROC)(GLenum , GLint , GLenum , GLint , GLint , GLsizei , GLint ); + typedef void (CODEGEN_FUNCPTR *PFNCOPYTEXIMAGE2DPROC)(GLenum , GLint , GLenum , GLint , GLint , GLsizei , GLsizei , GLint ); + typedef void (CODEGEN_FUNCPTR *PFNCOPYTEXSUBIMAGE1DPROC)(GLenum , GLint , GLint , GLint , GLint , GLsizei ); + typedef void (CODEGEN_FUNCPTR *PFNCOPYTEXSUBIMAGE2DPROC)(GLenum , GLint , GLint , GLint , GLint , GLint , GLsizei , GLsizei ); + typedef void (CODEGEN_FUNCPTR *PFNTEXSUBIMAGE1DPROC)(GLenum , GLint , GLint , GLsizei , GLenum , GLenum , const GLvoid *); + typedef void (CODEGEN_FUNCPTR *PFNTEXSUBIMAGE2DPROC)(GLenum , GLint , GLint , GLint , GLsizei , GLsizei , GLenum , GLenum , const GLvoid *); + typedef void (CODEGEN_FUNCPTR *PFNBINDTEXTUREPROC)(GLenum , GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNDELETETEXTURESPROC)(GLsizei , const GLuint *); + typedef void (CODEGEN_FUNCPTR *PFNGENTEXTURESPROC)(GLsizei , GLuint *); + typedef GLboolean (CODEGEN_FUNCPTR *PFNISTEXTUREPROC)(GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNINDEXUBPROC)(GLubyte ); + typedef void (CODEGEN_FUNCPTR *PFNINDEXUBVPROC)(const GLubyte *); + + // Extension: 1.2 + typedef void (CODEGEN_FUNCPTR *PFNBLENDCOLORPROC)(GLfloat , GLfloat , GLfloat , GLfloat ); + typedef void (CODEGEN_FUNCPTR *PFNBLENDEQUATIONPROC)(GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNDRAWRANGEELEMENTSPROC)(GLenum , GLuint , GLuint , GLsizei , GLenum , const GLvoid *); + typedef void (CODEGEN_FUNCPTR *PFNTEXSUBIMAGE3DPROC)(GLenum , GLint , GLint , GLint , GLint , GLsizei , GLsizei , GLsizei , GLenum , GLenum , const GLvoid *); + typedef void (CODEGEN_FUNCPTR *PFNCOPYTEXSUBIMAGE3DPROC)(GLenum , GLint , GLint , GLint , GLint , GLint , GLint , GLsizei , GLsizei ); + + // Extension: 1.3 + typedef void (CODEGEN_FUNCPTR *PFNACTIVETEXTUREPROC)(GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNSAMPLECOVERAGEPROC)(GLfloat , GLboolean ); + typedef void (CODEGEN_FUNCPTR *PFNCOMPRESSEDTEXIMAGE3DPROC)(GLenum , GLint , GLenum , GLsizei , GLsizei , GLsizei , GLint , GLsizei , const GLvoid *); + typedef void (CODEGEN_FUNCPTR *PFNCOMPRESSEDTEXIMAGE2DPROC)(GLenum , GLint , GLenum , GLsizei , GLsizei , GLint , GLsizei , const GLvoid *); + typedef void (CODEGEN_FUNCPTR *PFNCOMPRESSEDTEXIMAGE1DPROC)(GLenum , GLint , GLenum , GLsizei , GLint , GLsizei , const GLvoid *); + typedef void (CODEGEN_FUNCPTR *PFNCOMPRESSEDTEXSUBIMAGE3DPROC)(GLenum , GLint , GLint , GLint , GLint , GLsizei , GLsizei , GLsizei , GLenum , GLsizei , const GLvoid *); + typedef void (CODEGEN_FUNCPTR *PFNCOMPRESSEDTEXSUBIMAGE2DPROC)(GLenum , GLint , GLint , GLint , GLsizei , GLsizei , GLenum , GLsizei , const GLvoid *); + typedef void (CODEGEN_FUNCPTR *PFNCOMPRESSEDTEXSUBIMAGE1DPROC)(GLenum , GLint , GLint , GLsizei , GLenum , GLsizei , const GLvoid *); + typedef void (CODEGEN_FUNCPTR *PFNGETCOMPRESSEDTEXIMAGEPROC)(GLenum , GLint , GLvoid *); + + // Extension: 1.4 + typedef void (CODEGEN_FUNCPTR *PFNBLENDFUNCSEPARATEPROC)(GLenum , GLenum , GLenum , GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNMULTIDRAWARRAYSPROC)(GLenum , const GLint *, const GLsizei *, GLsizei ); + typedef void (CODEGEN_FUNCPTR *PFNMULTIDRAWELEMENTSPROC)(GLenum , const GLsizei *, GLenum , const GLvoid* const *, GLsizei ); + typedef void (CODEGEN_FUNCPTR *PFNPOINTPARAMETERFPROC)(GLenum , GLfloat ); + typedef void (CODEGEN_FUNCPTR *PFNPOINTPARAMETERFVPROC)(GLenum , const GLfloat *); + typedef void (CODEGEN_FUNCPTR *PFNPOINTPARAMETERIPROC)(GLenum , GLint ); + typedef void (CODEGEN_FUNCPTR *PFNPOINTPARAMETERIVPROC)(GLenum , const GLint *); + + // Extension: 1.5 + typedef void (CODEGEN_FUNCPTR *PFNGENQUERIESPROC)(GLsizei , GLuint *); + typedef void (CODEGEN_FUNCPTR *PFNDELETEQUERIESPROC)(GLsizei , const GLuint *); + typedef GLboolean (CODEGEN_FUNCPTR *PFNISQUERYPROC)(GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNBEGINQUERYPROC)(GLenum , GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNENDQUERYPROC)(GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNGETQUERYIVPROC)(GLenum , GLenum , GLint *); + typedef void (CODEGEN_FUNCPTR *PFNGETQUERYOBJECTIVPROC)(GLuint , GLenum , GLint *); + typedef void (CODEGEN_FUNCPTR *PFNGETQUERYOBJECTUIVPROC)(GLuint , GLenum , GLuint *); + typedef void (CODEGEN_FUNCPTR *PFNBINDBUFFERPROC)(GLenum , GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNDELETEBUFFERSPROC)(GLsizei , const GLuint *); + typedef void (CODEGEN_FUNCPTR *PFNGENBUFFERSPROC)(GLsizei , GLuint *); + typedef GLboolean (CODEGEN_FUNCPTR *PFNISBUFFERPROC)(GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNBUFFERDATAPROC)(GLenum , GLsizeiptr , const GLvoid *, GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNBUFFERSUBDATAPROC)(GLenum , GLintptr , GLsizeiptr , const GLvoid *); + typedef void (CODEGEN_FUNCPTR *PFNGETBUFFERSUBDATAPROC)(GLenum , GLintptr , GLsizeiptr , GLvoid *); + typedef GLvoid* (CODEGEN_FUNCPTR *PFNMAPBUFFERPROC)(GLenum , GLenum ); + typedef GLboolean (CODEGEN_FUNCPTR *PFNUNMAPBUFFERPROC)(GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNGETBUFFERPARAMETERIVPROC)(GLenum , GLenum , GLint *); + typedef void (CODEGEN_FUNCPTR *PFNGETBUFFERPOINTERVPROC)(GLenum , GLenum , GLvoid* *); + + // Extension: 2.0 + typedef void (CODEGEN_FUNCPTR *PFNBLENDEQUATIONSEPARATEPROC)(GLenum , GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNDRAWBUFFERSPROC)(GLsizei , const GLenum *); + typedef void (CODEGEN_FUNCPTR *PFNSTENCILOPSEPARATEPROC)(GLenum , GLenum , GLenum , GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNSTENCILFUNCSEPARATEPROC)(GLenum , GLenum , GLint , GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNSTENCILMASKSEPARATEPROC)(GLenum , GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNATTACHSHADERPROC)(GLuint , GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNBINDATTRIBLOCATIONPROC)(GLuint , GLuint , const GLchar *); + typedef void (CODEGEN_FUNCPTR *PFNCOMPILESHADERPROC)(GLuint ); + typedef GLuint (CODEGEN_FUNCPTR *PFNCREATEPROGRAMPROC)(); + typedef GLuint (CODEGEN_FUNCPTR *PFNCREATESHADERPROC)(GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNDELETEPROGRAMPROC)(GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNDELETESHADERPROC)(GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNDETACHSHADERPROC)(GLuint , GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNDISABLEVERTEXATTRIBARRAYPROC)(GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNENABLEVERTEXATTRIBARRAYPROC)(GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNGETACTIVEATTRIBPROC)(GLuint , GLuint , GLsizei , GLsizei *, GLint *, GLenum *, GLchar *); + typedef void (CODEGEN_FUNCPTR *PFNGETACTIVEUNIFORMPROC)(GLuint , GLuint , GLsizei , GLsizei *, GLint *, GLenum *, GLchar *); + typedef void (CODEGEN_FUNCPTR *PFNGETATTACHEDSHADERSPROC)(GLuint , GLsizei , GLsizei *, GLuint *); + typedef GLint (CODEGEN_FUNCPTR *PFNGETATTRIBLOCATIONPROC)(GLuint , const GLchar *); + typedef void (CODEGEN_FUNCPTR *PFNGETPROGRAMIVPROC)(GLuint , GLenum , GLint *); + typedef void (CODEGEN_FUNCPTR *PFNGETPROGRAMINFOLOGPROC)(GLuint , GLsizei , GLsizei *, GLchar *); + typedef void (CODEGEN_FUNCPTR *PFNGETSHADERIVPROC)(GLuint , GLenum , GLint *); + typedef void (CODEGEN_FUNCPTR *PFNGETSHADERINFOLOGPROC)(GLuint , GLsizei , GLsizei *, GLchar *); + typedef void (CODEGEN_FUNCPTR *PFNGETSHADERSOURCEPROC)(GLuint , GLsizei , GLsizei *, GLchar *); + typedef GLint (CODEGEN_FUNCPTR *PFNGETUNIFORMLOCATIONPROC)(GLuint , const GLchar *); + typedef void (CODEGEN_FUNCPTR *PFNGETUNIFORMFVPROC)(GLuint , GLint , GLfloat *); + typedef void (CODEGEN_FUNCPTR *PFNGETUNIFORMIVPROC)(GLuint , GLint , GLint *); + typedef void (CODEGEN_FUNCPTR *PFNGETVERTEXATTRIBDVPROC)(GLuint , GLenum , GLdouble *); + typedef void (CODEGEN_FUNCPTR *PFNGETVERTEXATTRIBFVPROC)(GLuint , GLenum , GLfloat *); + typedef void (CODEGEN_FUNCPTR *PFNGETVERTEXATTRIBIVPROC)(GLuint , GLenum , GLint *); + typedef void (CODEGEN_FUNCPTR *PFNGETVERTEXATTRIBPOINTERVPROC)(GLuint , GLenum , GLvoid* *); + typedef GLboolean (CODEGEN_FUNCPTR *PFNISPROGRAMPROC)(GLuint ); + typedef GLboolean (CODEGEN_FUNCPTR *PFNISSHADERPROC)(GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNLINKPROGRAMPROC)(GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNSHADERSOURCEPROC)(GLuint , GLsizei , const GLchar* const *, const GLint *); + typedef void (CODEGEN_FUNCPTR *PFNUSEPROGRAMPROC)(GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORM1FPROC)(GLint , GLfloat ); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORM2FPROC)(GLint , GLfloat , GLfloat ); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORM3FPROC)(GLint , GLfloat , GLfloat , GLfloat ); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORM4FPROC)(GLint , GLfloat , GLfloat , GLfloat , GLfloat ); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORM1IPROC)(GLint , GLint ); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORM2IPROC)(GLint , GLint , GLint ); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORM3IPROC)(GLint , GLint , GLint , GLint ); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORM4IPROC)(GLint , GLint , GLint , GLint , GLint ); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORM1FVPROC)(GLint , GLsizei , const GLfloat *); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORM2FVPROC)(GLint , GLsizei , const GLfloat *); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORM3FVPROC)(GLint , GLsizei , const GLfloat *); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORM4FVPROC)(GLint , GLsizei , const GLfloat *); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORM1IVPROC)(GLint , GLsizei , const GLint *); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORM2IVPROC)(GLint , GLsizei , const GLint *); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORM3IVPROC)(GLint , GLsizei , const GLint *); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORM4IVPROC)(GLint , GLsizei , const GLint *); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX2FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX3FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX4FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); + typedef void (CODEGEN_FUNCPTR *PFNVALIDATEPROGRAMPROC)(GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBPOINTERPROC)(GLuint , GLint , GLenum , GLboolean , GLsizei , const GLvoid *); + + // Extension: 2.1 + typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX2X3FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX3X2FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX2X4FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX4X2FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX3X4FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX4X3FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); + + // Extension: ARB_vertex_array_object + typedef void (CODEGEN_FUNCPTR *PFNBINDVERTEXARRAYPROC)(GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNDELETEVERTEXARRAYSPROC)(GLsizei , const GLuint *); + typedef void (CODEGEN_FUNCPTR *PFNGENVERTEXARRAYSPROC)(GLsizei , GLuint *); + typedef GLboolean (CODEGEN_FUNCPTR *PFNISVERTEXARRAYPROC)(GLuint ); + + // Extension: ARB_map_buffer_range + typedef GLvoid* (CODEGEN_FUNCPTR *PFNMAPBUFFERRANGEPROC)(GLenum , GLintptr , GLsizeiptr , GLbitfield ); + typedef void (CODEGEN_FUNCPTR *PFNFLUSHMAPPEDBUFFERRANGEPROC)(GLenum , GLintptr , GLsizeiptr ); + + // Extension: ARB_framebuffer_object + typedef GLboolean (CODEGEN_FUNCPTR *PFNISRENDERBUFFERPROC)(GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNBINDRENDERBUFFERPROC)(GLenum , GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNDELETERENDERBUFFERSPROC)(GLsizei , const GLuint *); + typedef void (CODEGEN_FUNCPTR *PFNGENRENDERBUFFERSPROC)(GLsizei , GLuint *); + typedef void (CODEGEN_FUNCPTR *PFNRENDERBUFFERSTORAGEPROC)(GLenum , GLenum , GLsizei , GLsizei ); + typedef void (CODEGEN_FUNCPTR *PFNGETRENDERBUFFERPARAMETERIVPROC)(GLenum , GLenum , GLint *); + typedef GLboolean (CODEGEN_FUNCPTR *PFNISFRAMEBUFFERPROC)(GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNBINDFRAMEBUFFERPROC)(GLenum , GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNDELETEFRAMEBUFFERSPROC)(GLsizei , const GLuint *); + typedef void (CODEGEN_FUNCPTR *PFNGENFRAMEBUFFERSPROC)(GLsizei , GLuint *); + typedef GLenum (CODEGEN_FUNCPTR *PFNCHECKFRAMEBUFFERSTATUSPROC)(GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNFRAMEBUFFERTEXTURE1DPROC)(GLenum , GLenum , GLenum , GLuint , GLint ); + typedef void (CODEGEN_FUNCPTR *PFNFRAMEBUFFERTEXTURE2DPROC)(GLenum , GLenum , GLenum , GLuint , GLint ); + typedef void (CODEGEN_FUNCPTR *PFNFRAMEBUFFERTEXTURE3DPROC)(GLenum , GLenum , GLenum , GLuint , GLint , GLint ); + typedef void (CODEGEN_FUNCPTR *PFNFRAMEBUFFERRENDERBUFFERPROC)(GLenum , GLenum , GLenum , GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLenum , GLenum , GLenum , GLint *); + typedef void (CODEGEN_FUNCPTR *PFNGENERATEMIPMAPPROC)(GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNBLITFRAMEBUFFERPROC)(GLint , GLint , GLint , GLint , GLint , GLint , GLint , GLint , GLbitfield , GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNRENDERBUFFERSTORAGEMULTISAMPLEPROC)(GLenum , GLsizei , GLenum , GLsizei , GLsizei ); + typedef void (CODEGEN_FUNCPTR *PFNFRAMEBUFFERTEXTURELAYERPROC)(GLenum , GLenum , GLuint , GLint , GLint ); + + // Extension: 3.0 + typedef void (CODEGEN_FUNCPTR *PFNCOLORMASKIPROC)(GLuint , GLboolean , GLboolean , GLboolean , GLboolean ); + typedef void (CODEGEN_FUNCPTR *PFNGETBOOLEANI_VPROC)(GLenum , GLuint , GLboolean *); + typedef void (CODEGEN_FUNCPTR *PFNGETINTEGERI_VPROC)(GLenum , GLuint , GLint *); + typedef void (CODEGEN_FUNCPTR *PFNENABLEIPROC)(GLenum , GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNDISABLEIPROC)(GLenum , GLuint ); + typedef GLboolean (CODEGEN_FUNCPTR *PFNISENABLEDIPROC)(GLenum , GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNBEGINTRANSFORMFEEDBACKPROC)(GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNENDTRANSFORMFEEDBACKPROC)(); + typedef void (CODEGEN_FUNCPTR *PFNBINDBUFFERRANGEPROC)(GLenum , GLuint , GLuint , GLintptr , GLsizeiptr ); + typedef void (CODEGEN_FUNCPTR *PFNBINDBUFFERBASEPROC)(GLenum , GLuint , GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNTRANSFORMFEEDBACKVARYINGSPROC)(GLuint , GLsizei , const GLchar* const *, GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNGETTRANSFORMFEEDBACKVARYINGPROC)(GLuint , GLuint , GLsizei , GLsizei *, GLsizei *, GLenum *, GLchar *); + typedef void (CODEGEN_FUNCPTR *PFNCLAMPCOLORPROC)(GLenum , GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNBEGINCONDITIONALRENDERPROC)(GLuint , GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNENDCONDITIONALRENDERPROC)(); + typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBIPOINTERPROC)(GLuint , GLint , GLenum , GLsizei , const GLvoid *); + typedef void (CODEGEN_FUNCPTR *PFNGETVERTEXATTRIBIIVPROC)(GLuint , GLenum , GLint *); + typedef void (CODEGEN_FUNCPTR *PFNGETVERTEXATTRIBIUIVPROC)(GLuint , GLenum , GLuint *); + typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI1IPROC)(GLuint , GLint ); + typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI2IPROC)(GLuint , GLint , GLint ); + typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI3IPROC)(GLuint , GLint , GLint , GLint ); + typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI4IPROC)(GLuint , GLint , GLint , GLint , GLint ); + typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI1UIPROC)(GLuint , GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI2UIPROC)(GLuint , GLuint , GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI3UIPROC)(GLuint , GLuint , GLuint , GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI4UIPROC)(GLuint , GLuint , GLuint , GLuint , GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI1IVPROC)(GLuint , const GLint *); + typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI2IVPROC)(GLuint , const GLint *); + typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI3IVPROC)(GLuint , const GLint *); + typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI4IVPROC)(GLuint , const GLint *); + typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI1UIVPROC)(GLuint , const GLuint *); + typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI2UIVPROC)(GLuint , const GLuint *); + typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI3UIVPROC)(GLuint , const GLuint *); + typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI4UIVPROC)(GLuint , const GLuint *); + typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI4BVPROC)(GLuint , const GLbyte *); + typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI4SVPROC)(GLuint , const GLshort *); + typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI4UBVPROC)(GLuint , const GLubyte *); + typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI4USVPROC)(GLuint , const GLushort *); + typedef void (CODEGEN_FUNCPTR *PFNGETUNIFORMUIVPROC)(GLuint , GLint , GLuint *); + typedef void (CODEGEN_FUNCPTR *PFNBINDFRAGDATALOCATIONPROC)(GLuint , GLuint , const GLchar *); + typedef GLint (CODEGEN_FUNCPTR *PFNGETFRAGDATALOCATIONPROC)(GLuint , const GLchar *); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORM1UIPROC)(GLint , GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORM2UIPROC)(GLint , GLuint , GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORM3UIPROC)(GLint , GLuint , GLuint , GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORM4UIPROC)(GLint , GLuint , GLuint , GLuint , GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORM1UIVPROC)(GLint , GLsizei , const GLuint *); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORM2UIVPROC)(GLint , GLsizei , const GLuint *); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORM3UIVPROC)(GLint , GLsizei , const GLuint *); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORM4UIVPROC)(GLint , GLsizei , const GLuint *); + typedef void (CODEGEN_FUNCPTR *PFNTEXPARAMETERIIVPROC)(GLenum , GLenum , const GLint *); + typedef void (CODEGEN_FUNCPTR *PFNTEXPARAMETERIUIVPROC)(GLenum , GLenum , const GLuint *); + typedef void (CODEGEN_FUNCPTR *PFNGETTEXPARAMETERIIVPROC)(GLenum , GLenum , GLint *); + typedef void (CODEGEN_FUNCPTR *PFNGETTEXPARAMETERIUIVPROC)(GLenum , GLenum , GLuint *); + typedef void (CODEGEN_FUNCPTR *PFNCLEARBUFFERIVPROC)(GLenum , GLint , const GLint *); + typedef void (CODEGEN_FUNCPTR *PFNCLEARBUFFERUIVPROC)(GLenum , GLint , const GLuint *); + typedef void (CODEGEN_FUNCPTR *PFNCLEARBUFFERFVPROC)(GLenum , GLint , const GLfloat *); + typedef void (CODEGEN_FUNCPTR *PFNCLEARBUFFERFIPROC)(GLenum , GLint , GLfloat , GLint ); + typedef const GLubyte * (CODEGEN_FUNCPTR *PFNGETSTRINGIPROC)(GLenum , GLuint ); + + // Extension: ARB_uniform_buffer_object + typedef void (CODEGEN_FUNCPTR *PFNGETUNIFORMINDICESPROC)(GLuint , GLsizei , const GLchar* const *, GLuint *); + typedef void (CODEGEN_FUNCPTR *PFNGETACTIVEUNIFORMSIVPROC)(GLuint , GLsizei , const GLuint *, GLenum , GLint *); + typedef void (CODEGEN_FUNCPTR *PFNGETACTIVEUNIFORMNAMEPROC)(GLuint , GLuint , GLsizei , GLsizei *, GLchar *); + typedef GLuint (CODEGEN_FUNCPTR *PFNGETUNIFORMBLOCKINDEXPROC)(GLuint , const GLchar *); + typedef void (CODEGEN_FUNCPTR *PFNGETACTIVEUNIFORMBLOCKIVPROC)(GLuint , GLuint , GLenum , GLint *); + typedef void (CODEGEN_FUNCPTR *PFNGETACTIVEUNIFORMBLOCKNAMEPROC)(GLuint , GLuint , GLsizei , GLsizei *, GLchar *); + typedef void (CODEGEN_FUNCPTR *PFNUNIFORMBLOCKBINDINGPROC)(GLuint , GLuint , GLuint ); + + // Extension: ARB_copy_buffer + typedef void (CODEGEN_FUNCPTR *PFNCOPYBUFFERSUBDATAPROC)(GLenum , GLenum , GLintptr , GLintptr , GLsizeiptr ); + + // Extension: 3.1 + typedef void (CODEGEN_FUNCPTR *PFNDRAWARRAYSINSTANCEDPROC)(GLenum , GLint , GLsizei , GLsizei ); + typedef void (CODEGEN_FUNCPTR *PFNDRAWELEMENTSINSTANCEDPROC)(GLenum , GLsizei , GLenum , const GLvoid *, GLsizei ); + typedef void (CODEGEN_FUNCPTR *PFNTEXBUFFERPROC)(GLenum , GLenum , GLuint ); + typedef void (CODEGEN_FUNCPTR *PFNPRIMITIVERESTARTINDEXPROC)(GLuint ); + + // Legacy + typedef void (CODEGEN_FUNCPTR *PFNENABLECLIENTSTATEPROC)(GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNDISABLECLIENTSTATEPROC)(GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNVERTEXPOINTERPROC)(GLint , GLenum , GLsizei , const GLvoid *); + typedef void (CODEGEN_FUNCPTR *PFNNORMALPOINTERPROC)(GLenum , GLsizei , const GLvoid *); + typedef void (CODEGEN_FUNCPTR *PFNCOLORPOINTERPROC)(GLint , GLenum , GLsizei , const GLvoid *); + typedef void (CODEGEN_FUNCPTR *PFNTEXCOORDPOINTERPROC)(GLint , GLenum , GLsizei , const GLvoid *); + typedef void (CODEGEN_FUNCPTR *PFNTEXENVIPROC)(GLenum , GLenum , GLint ); + typedef void (CODEGEN_FUNCPTR *PFNMATRIXMODEPROC)(GLenum ); + typedef void (CODEGEN_FUNCPTR *PFNLOADIDENTITYPROC)(void); + typedef void (CODEGEN_FUNCPTR *PFNORTHOPROC)(GLdouble , GLdouble , GLdouble , GLdouble , GLdouble , GLdouble ); + typedef void (CODEGEN_FUNCPTR *PFNCOLOR3DPROC)(GLdouble , GLdouble , GLdouble ); + + ////////////////////////////////////////////// + // Function pointers + + // Extension: 1.1 + PFNCULLFACEPROC CullFace; + PFNFRONTFACEPROC FrontFace; + PFNHINTPROC Hint; + PFNLINEWIDTHPROC LineWidth; + PFNPOINTSIZEPROC PointSize; + PFNPOLYGONMODEPROC PolygonMode; + PFNSCISSORPROC Scissor; + PFNTEXPARAMETERFPROC TexParameterf; + PFNTEXPARAMETERFVPROC TexParameterfv; + PFNTEXPARAMETERIPROC TexParameteri; + PFNTEXPARAMETERIVPROC TexParameteriv; + PFNTEXIMAGE1DPROC TexImage1D; + PFNTEXIMAGE2DPROC TexImage2D; + PFNDRAWBUFFERPROC DrawBuffer; + PFNCLEARPROC Clear; + PFNCLEARCOLORPROC ClearColor; + PFNCLEARSTENCILPROC ClearStencil; + PFNCLEARDEPTHPROC ClearDepth; + PFNSTENCILMASKPROC StencilMask; + PFNCOLORMASKPROC ColorMask; + PFNDEPTHMASKPROC DepthMask; + PFNDISABLEPROC Disable; + PFNENABLEPROC Enable; + PFNFINISHPROC Finish; + PFNFLUSHPROC Flush; + PFNBLENDFUNCPROC BlendFunc; + PFNLOGICOPPROC LogicOp; + PFNSTENCILFUNCPROC StencilFunc; + PFNSTENCILOPPROC StencilOp; + PFNDEPTHFUNCPROC DepthFunc; + PFNPIXELSTOREFPROC PixelStoref; + PFNPIXELSTOREIPROC PixelStorei; + PFNREADBUFFERPROC ReadBuffer; + PFNREADPIXELSPROC ReadPixels; + PFNGETBOOLEANVPROC GetBooleanv; + PFNGETDOUBLEVPROC GetDoublev; + PFNGETERRORPROC GetError; + PFNGETFLOATVPROC GetFloatv; + PFNGETINTEGERVPROC GetIntegerv; + PFNGETSTRINGPROC GetString; + PFNGETTEXIMAGEPROC GetTexImage; + PFNGETTEXPARAMETERFVPROC GetTexParameterfv; + PFNGETTEXPARAMETERIVPROC GetTexParameteriv; + PFNGETTEXLEVELPARAMETERFVPROC GetTexLevelParameterfv; + PFNGETTEXLEVELPARAMETERIVPROC GetTexLevelParameteriv; + PFNISENABLEDPROC IsEnabled; + PFNDEPTHRANGEPROC DepthRange; + PFNVIEWPORTPROC Viewport; + PFNDRAWARRAYSPROC DrawArrays; + PFNDRAWELEMENTSPROC DrawElements; + PFNGETPOINTERVPROC GetPointerv; + PFNPOLYGONOFFSETPROC PolygonOffset; + PFNCOPYTEXIMAGE1DPROC CopyTexImage1D; + PFNCOPYTEXIMAGE2DPROC CopyTexImage2D; + PFNCOPYTEXSUBIMAGE1DPROC CopyTexSubImage1D; + PFNCOPYTEXSUBIMAGE2DPROC CopyTexSubImage2D; + PFNTEXSUBIMAGE1DPROC TexSubImage1D; + PFNTEXSUBIMAGE2DPROC TexSubImage2D; + PFNBINDTEXTUREPROC BindTexture; + PFNDELETETEXTURESPROC DeleteTextures; + PFNGENTEXTURESPROC GenTextures; + PFNISTEXTUREPROC IsTexture; + PFNINDEXUBPROC Indexub; + PFNINDEXUBVPROC Indexubv; + + // Extension: 1.2 + PFNBLENDCOLORPROC BlendColor; + PFNBLENDEQUATIONPROC BlendEquation; + PFNDRAWRANGEELEMENTSPROC DrawRangeElements; + PFNTEXSUBIMAGE3DPROC TexSubImage3D; + PFNCOPYTEXSUBIMAGE3DPROC CopyTexSubImage3D; + + // Extension: 1.3 + PFNACTIVETEXTUREPROC ActiveTexture; + PFNSAMPLECOVERAGEPROC SampleCoverage; + PFNCOMPRESSEDTEXIMAGE3DPROC CompressedTexImage3D; + PFNCOMPRESSEDTEXIMAGE2DPROC CompressedTexImage2D; + PFNCOMPRESSEDTEXIMAGE1DPROC CompressedTexImage1D; + PFNCOMPRESSEDTEXSUBIMAGE3DPROC CompressedTexSubImage3D; + PFNCOMPRESSEDTEXSUBIMAGE2DPROC CompressedTexSubImage2D; + PFNCOMPRESSEDTEXSUBIMAGE1DPROC CompressedTexSubImage1D; + PFNGETCOMPRESSEDTEXIMAGEPROC GetCompressedTexImage; + + // Extension: 1.4 + PFNBLENDFUNCSEPARATEPROC BlendFuncSeparate; + PFNMULTIDRAWARRAYSPROC MultiDrawArrays; + PFNMULTIDRAWELEMENTSPROC MultiDrawElements; + PFNPOINTPARAMETERFPROC PointParameterf; + PFNPOINTPARAMETERFVPROC PointParameterfv; + PFNPOINTPARAMETERIPROC PointParameteri; + PFNPOINTPARAMETERIVPROC PointParameteriv; + + // Extension: 1.5 + PFNGENQUERIESPROC GenQueries; + PFNDELETEQUERIESPROC DeleteQueries; + PFNISQUERYPROC IsQuery; + PFNBEGINQUERYPROC BeginQuery; + PFNENDQUERYPROC EndQuery; + PFNGETQUERYIVPROC GetQueryiv; + PFNGETQUERYOBJECTIVPROC GetQueryObjectiv; + PFNGETQUERYOBJECTUIVPROC GetQueryObjectuiv; + PFNBINDBUFFERPROC BindBuffer; + PFNDELETEBUFFERSPROC DeleteBuffers; + PFNGENBUFFERSPROC GenBuffers; + PFNISBUFFERPROC IsBuffer; + PFNBUFFERDATAPROC BufferData; + PFNBUFFERSUBDATAPROC BufferSubData; + PFNGETBUFFERSUBDATAPROC GetBufferSubData; + PFNMAPBUFFERPROC MapBuffer; + PFNUNMAPBUFFERPROC UnmapBuffer; + PFNGETBUFFERPARAMETERIVPROC GetBufferParameteriv; + PFNGETBUFFERPOINTERVPROC GetBufferPointerv; + + // Extension: 2.0 + PFNBLENDEQUATIONSEPARATEPROC BlendEquationSeparate; + PFNDRAWBUFFERSPROC DrawBuffers; + PFNSTENCILOPSEPARATEPROC StencilOpSeparate; + PFNSTENCILFUNCSEPARATEPROC StencilFuncSeparate; + PFNSTENCILMASKSEPARATEPROC StencilMaskSeparate; + PFNATTACHSHADERPROC AttachShader; + PFNBINDATTRIBLOCATIONPROC BindAttribLocation; + PFNCOMPILESHADERPROC CompileShader; + PFNCREATEPROGRAMPROC CreateProgram; + PFNCREATESHADERPROC CreateShader; + PFNDELETEPROGRAMPROC DeleteProgram; + PFNDELETESHADERPROC DeleteShader; + PFNDETACHSHADERPROC DetachShader; + PFNDISABLEVERTEXATTRIBARRAYPROC DisableVertexAttribArray; + PFNENABLEVERTEXATTRIBARRAYPROC EnableVertexAttribArray; + PFNGETACTIVEATTRIBPROC GetActiveAttrib; + PFNGETACTIVEUNIFORMPROC GetActiveUniform; + PFNGETATTACHEDSHADERSPROC GetAttachedShaders; + PFNGETATTRIBLOCATIONPROC GetAttribLocation; + PFNGETPROGRAMIVPROC GetProgramiv; + PFNGETPROGRAMINFOLOGPROC GetProgramInfoLog; + PFNGETSHADERIVPROC GetShaderiv; + PFNGETSHADERINFOLOGPROC GetShaderInfoLog; + PFNGETSHADERSOURCEPROC GetShaderSource; + PFNGETUNIFORMLOCATIONPROC GetUniformLocation; + PFNGETUNIFORMFVPROC GetUniformfv; + PFNGETUNIFORMIVPROC GetUniformiv; + PFNGETVERTEXATTRIBDVPROC GetVertexAttribdv; + PFNGETVERTEXATTRIBFVPROC GetVertexAttribfv; + PFNGETVERTEXATTRIBIVPROC GetVertexAttribiv; + PFNGETVERTEXATTRIBPOINTERVPROC GetVertexAttribPointerv; + PFNISPROGRAMPROC IsProgram; + PFNISSHADERPROC IsShader; + PFNLINKPROGRAMPROC LinkProgram; + PFNSHADERSOURCEPROC ShaderSource; + PFNUSEPROGRAMPROC UseProgram; + PFNUNIFORM1FPROC Uniform1f; + PFNUNIFORM2FPROC Uniform2f; + PFNUNIFORM3FPROC Uniform3f; + PFNUNIFORM4FPROC Uniform4f; + PFNUNIFORM1IPROC Uniform1i; + PFNUNIFORM2IPROC Uniform2i; + PFNUNIFORM3IPROC Uniform3i; + PFNUNIFORM4IPROC Uniform4i; + PFNUNIFORM1FVPROC Uniform1fv; + PFNUNIFORM2FVPROC Uniform2fv; + PFNUNIFORM3FVPROC Uniform3fv; + PFNUNIFORM4FVPROC Uniform4fv; + PFNUNIFORM1IVPROC Uniform1iv; + PFNUNIFORM2IVPROC Uniform2iv; + PFNUNIFORM3IVPROC Uniform3iv; + PFNUNIFORM4IVPROC Uniform4iv; + PFNUNIFORMMATRIX2FVPROC UniformMatrix2fv; + PFNUNIFORMMATRIX3FVPROC UniformMatrix3fv; + PFNUNIFORMMATRIX4FVPROC UniformMatrix4fv; + PFNVALIDATEPROGRAMPROC ValidateProgram; + PFNVERTEXATTRIBPOINTERPROC VertexAttribPointer; + + // Extension: 2.1 + PFNUNIFORMMATRIX2X3FVPROC UniformMatrix2x3fv; + PFNUNIFORMMATRIX3X2FVPROC UniformMatrix3x2fv; + PFNUNIFORMMATRIX2X4FVPROC UniformMatrix2x4fv; + PFNUNIFORMMATRIX4X2FVPROC UniformMatrix4x2fv; + PFNUNIFORMMATRIX3X4FVPROC UniformMatrix3x4fv; + PFNUNIFORMMATRIX4X3FVPROC UniformMatrix4x3fv; + + // Extension: ARB_vertex_array_object + PFNBINDVERTEXARRAYPROC BindVertexArray; + PFNDELETEVERTEXARRAYSPROC DeleteVertexArrays; + PFNGENVERTEXARRAYSPROC GenVertexArrays; + PFNISVERTEXARRAYPROC IsVertexArray; + + // Extension: ARB_map_buffer_range + PFNMAPBUFFERRANGEPROC MapBufferRange; + PFNFLUSHMAPPEDBUFFERRANGEPROC FlushMappedBufferRange; + + // Extension: ARB_framebuffer_object + PFNISRENDERBUFFERPROC IsRenderbuffer; + PFNBINDRENDERBUFFERPROC BindRenderbuffer; + PFNDELETERENDERBUFFERSPROC DeleteRenderbuffers; + PFNGENRENDERBUFFERSPROC GenRenderbuffers; + PFNRENDERBUFFERSTORAGEPROC RenderbufferStorage; + PFNGETRENDERBUFFERPARAMETERIVPROC GetRenderbufferParameteriv; + PFNISFRAMEBUFFERPROC IsFramebuffer; + PFNBINDFRAMEBUFFERPROC BindFramebuffer; + PFNDELETEFRAMEBUFFERSPROC DeleteFramebuffers; + PFNGENFRAMEBUFFERSPROC GenFramebuffers; + PFNCHECKFRAMEBUFFERSTATUSPROC CheckFramebufferStatus; + PFNFRAMEBUFFERTEXTURE1DPROC FramebufferTexture1D; + PFNFRAMEBUFFERTEXTURE2DPROC FramebufferTexture2D; + PFNFRAMEBUFFERTEXTURE3DPROC FramebufferTexture3D; + PFNFRAMEBUFFERRENDERBUFFERPROC FramebufferRenderbuffer; + PFNGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC GetFramebufferAttachmentParameteriv; + PFNGENERATEMIPMAPPROC GenerateMipmap; + PFNBLITFRAMEBUFFERPROC BlitFramebuffer; + PFNRENDERBUFFERSTORAGEMULTISAMPLEPROC RenderbufferStorageMultisample; + PFNFRAMEBUFFERTEXTURELAYERPROC FramebufferTextureLayer; + + // Extension: 3.0 + PFNCOLORMASKIPROC ColorMaski; + PFNGETBOOLEANI_VPROC GetBooleani_v; + PFNGETINTEGERI_VPROC GetIntegeri_v; + PFNENABLEIPROC Enablei; + PFNDISABLEIPROC Disablei; + PFNISENABLEDIPROC IsEnabledi; + PFNBEGINTRANSFORMFEEDBACKPROC BeginTransformFeedback; + PFNENDTRANSFORMFEEDBACKPROC EndTransformFeedback; + PFNBINDBUFFERRANGEPROC BindBufferRange; + PFNBINDBUFFERBASEPROC BindBufferBase; + PFNTRANSFORMFEEDBACKVARYINGSPROC TransformFeedbackVaryings; + PFNGETTRANSFORMFEEDBACKVARYINGPROC GetTransformFeedbackVarying; + PFNCLAMPCOLORPROC ClampColor; + PFNBEGINCONDITIONALRENDERPROC BeginConditionalRender; + PFNENDCONDITIONALRENDERPROC EndConditionalRender; + PFNVERTEXATTRIBIPOINTERPROC VertexAttribIPointer; + PFNGETVERTEXATTRIBIIVPROC GetVertexAttribIiv; + PFNGETVERTEXATTRIBIUIVPROC GetVertexAttribIuiv; + PFNVERTEXATTRIBI1IPROC VertexAttribI1i; + PFNVERTEXATTRIBI2IPROC VertexAttribI2i; + PFNVERTEXATTRIBI3IPROC VertexAttribI3i; + PFNVERTEXATTRIBI4IPROC VertexAttribI4i; + PFNVERTEXATTRIBI1UIPROC VertexAttribI1ui; + PFNVERTEXATTRIBI2UIPROC VertexAttribI2ui; + PFNVERTEXATTRIBI3UIPROC VertexAttribI3ui; + PFNVERTEXATTRIBI4UIPROC VertexAttribI4ui; + PFNVERTEXATTRIBI1IVPROC VertexAttribI1iv; + PFNVERTEXATTRIBI2IVPROC VertexAttribI2iv; + PFNVERTEXATTRIBI3IVPROC VertexAttribI3iv; + PFNVERTEXATTRIBI4IVPROC VertexAttribI4iv; + PFNVERTEXATTRIBI1UIVPROC VertexAttribI1uiv; + PFNVERTEXATTRIBI2UIVPROC VertexAttribI2uiv; + PFNVERTEXATTRIBI3UIVPROC VertexAttribI3uiv; + PFNVERTEXATTRIBI4UIVPROC VertexAttribI4uiv; + PFNVERTEXATTRIBI4BVPROC VertexAttribI4bv; + PFNVERTEXATTRIBI4SVPROC VertexAttribI4sv; + PFNVERTEXATTRIBI4UBVPROC VertexAttribI4ubv; + PFNVERTEXATTRIBI4USVPROC VertexAttribI4usv; + PFNGETUNIFORMUIVPROC GetUniformuiv; + PFNBINDFRAGDATALOCATIONPROC BindFragDataLocation; + PFNGETFRAGDATALOCATIONPROC GetFragDataLocation; + PFNUNIFORM1UIPROC Uniform1ui; + PFNUNIFORM2UIPROC Uniform2ui; + PFNUNIFORM3UIPROC Uniform3ui; + PFNUNIFORM4UIPROC Uniform4ui; + PFNUNIFORM1UIVPROC Uniform1uiv; + PFNUNIFORM2UIVPROC Uniform2uiv; + PFNUNIFORM3UIVPROC Uniform3uiv; + PFNUNIFORM4UIVPROC Uniform4uiv; + PFNTEXPARAMETERIIVPROC TexParameterIiv; + PFNTEXPARAMETERIUIVPROC TexParameterIuiv; + PFNGETTEXPARAMETERIIVPROC GetTexParameterIiv; + PFNGETTEXPARAMETERIUIVPROC GetTexParameterIuiv; + PFNCLEARBUFFERIVPROC ClearBufferiv; + PFNCLEARBUFFERUIVPROC ClearBufferuiv; + PFNCLEARBUFFERFVPROC ClearBufferfv; + PFNCLEARBUFFERFIPROC ClearBufferfi; + PFNGETSTRINGIPROC GetStringi; + + // Extension: ARB_uniform_buffer_object + PFNGETUNIFORMINDICESPROC GetUniformIndices; + PFNGETACTIVEUNIFORMSIVPROC GetActiveUniformsiv; + PFNGETACTIVEUNIFORMNAMEPROC GetActiveUniformName; + PFNGETUNIFORMBLOCKINDEXPROC GetUniformBlockIndex; + PFNGETACTIVEUNIFORMBLOCKIVPROC GetActiveUniformBlockiv; + PFNGETACTIVEUNIFORMBLOCKNAMEPROC GetActiveUniformBlockName; + PFNUNIFORMBLOCKBINDINGPROC UniformBlockBinding; + + // Extension: ARB_copy_buffer + PFNCOPYBUFFERSUBDATAPROC CopyBufferSubData; + + // Extension: 3.1 + PFNDRAWARRAYSINSTANCEDPROC DrawArraysInstanced; + PFNDRAWELEMENTSINSTANCEDPROC DrawElementsInstanced; + PFNTEXBUFFERPROC TexBuffer; + PFNPRIMITIVERESTARTINDEXPROC PrimitiveRestartIndex; + + // Legacy + PFNENABLECLIENTSTATEPROC EnableClientState; + PFNDISABLECLIENTSTATEPROC DisableClientState; + PFNVERTEXPOINTERPROC VertexPointer; + PFNNORMALPOINTERPROC NormalPointer; + PFNCOLORPOINTERPROC ColorPointer; + PFNTEXCOORDPOINTERPROC TexCoordPointer; + + PFNTEXENVIPROC TexEnvi; + + PFNMATRIXMODEPROC MatrixMode; + PFNLOADIDENTITYPROC LoadIdentity; + PFNORTHOPROC Ortho; + + PFNCOLOR3DPROC Color3d; + + ////////////////////////////////////////////// + // Switch functions + + // Extension: 1.1 + + static void CODEGEN_FUNCPTR Switch_CullFace(GLenum mode) + { + CullFace = (PFNCULLFACEPROC)IntGetProcAddress("glCullFace"); + CullFace(mode); + } + + static void CODEGEN_FUNCPTR Switch_FrontFace(GLenum mode) + { + FrontFace = (PFNFRONTFACEPROC)IntGetProcAddress("glFrontFace"); + FrontFace(mode); + } + + static void CODEGEN_FUNCPTR Switch_Hint(GLenum target, GLenum mode) + { + Hint = (PFNHINTPROC)IntGetProcAddress("glHint"); + Hint(target, mode); + } + + static void CODEGEN_FUNCPTR Switch_LineWidth(GLfloat width) + { + LineWidth = (PFNLINEWIDTHPROC)IntGetProcAddress("glLineWidth"); + LineWidth(width); + } + + static void CODEGEN_FUNCPTR Switch_PointSize(GLfloat size) + { + PointSize = (PFNPOINTSIZEPROC)IntGetProcAddress("glPointSize"); + PointSize(size); + } + + static void CODEGEN_FUNCPTR Switch_PolygonMode(GLenum face, GLenum mode) + { + PolygonMode = (PFNPOLYGONMODEPROC)IntGetProcAddress("glPolygonMode"); + PolygonMode(face, mode); + } + + static void CODEGEN_FUNCPTR Switch_Scissor(GLint x, GLint y, GLsizei width, GLsizei height) + { + Scissor = (PFNSCISSORPROC)IntGetProcAddress("glScissor"); + Scissor(x, y, width, height); + } + + static void CODEGEN_FUNCPTR Switch_TexParameterf(GLenum target, GLenum pname, GLfloat param) + { + TexParameterf = (PFNTEXPARAMETERFPROC)IntGetProcAddress("glTexParameterf"); + TexParameterf(target, pname, param); + } + + static void CODEGEN_FUNCPTR Switch_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) + { + TexParameterfv = (PFNTEXPARAMETERFVPROC)IntGetProcAddress("glTexParameterfv"); + TexParameterfv(target, pname, params); + } + + static void CODEGEN_FUNCPTR Switch_TexParameteri(GLenum target, GLenum pname, GLint param) + { + TexParameteri = (PFNTEXPARAMETERIPROC)IntGetProcAddress("glTexParameteri"); + TexParameteri(target, pname, param); + } + + static void CODEGEN_FUNCPTR Switch_TexParameteriv(GLenum target, GLenum pname, const GLint *params) + { + TexParameteriv = (PFNTEXPARAMETERIVPROC)IntGetProcAddress("glTexParameteriv"); + TexParameteriv(target, pname, params); + } + + static void CODEGEN_FUNCPTR Switch_TexImage1D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels) + { + TexImage1D = (PFNTEXIMAGE1DPROC)IntGetProcAddress("glTexImage1D"); + TexImage1D(target, level, internalformat, width, border, format, type, pixels); + } + + static void CODEGEN_FUNCPTR Switch_TexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) + { + TexImage2D = (PFNTEXIMAGE2DPROC)IntGetProcAddress("glTexImage2D"); + TexImage2D(target, level, internalformat, width, height, border, format, type, pixels); + } + + static void CODEGEN_FUNCPTR Switch_DrawBuffer(GLenum mode) + { + DrawBuffer = (PFNDRAWBUFFERPROC)IntGetProcAddress("glDrawBuffer"); + DrawBuffer(mode); + } + + static void CODEGEN_FUNCPTR Switch_Clear(GLbitfield mask) + { + Clear = (PFNCLEARPROC)IntGetProcAddress("glClear"); + Clear(mask); + } + + static void CODEGEN_FUNCPTR Switch_ClearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) + { + ClearColor = (PFNCLEARCOLORPROC)IntGetProcAddress("glClearColor"); + ClearColor(red, green, blue, alpha); + } + + static void CODEGEN_FUNCPTR Switch_ClearStencil(GLint s) + { + ClearStencil = (PFNCLEARSTENCILPROC)IntGetProcAddress("glClearStencil"); + ClearStencil(s); + } + + static void CODEGEN_FUNCPTR Switch_ClearDepth(GLdouble depth) + { + ClearDepth = (PFNCLEARDEPTHPROC)IntGetProcAddress("glClearDepth"); + ClearDepth(depth); + } + + static void CODEGEN_FUNCPTR Switch_StencilMask(GLuint mask) + { + StencilMask = (PFNSTENCILMASKPROC)IntGetProcAddress("glStencilMask"); + StencilMask(mask); + } + + static void CODEGEN_FUNCPTR Switch_ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) + { + ColorMask = (PFNCOLORMASKPROC)IntGetProcAddress("glColorMask"); + ColorMask(red, green, blue, alpha); + } + + static void CODEGEN_FUNCPTR Switch_DepthMask(GLboolean flag) + { + DepthMask = (PFNDEPTHMASKPROC)IntGetProcAddress("glDepthMask"); + DepthMask(flag); + } + + static void CODEGEN_FUNCPTR Switch_Disable(GLenum cap) + { + Disable = (PFNDISABLEPROC)IntGetProcAddress("glDisable"); + Disable(cap); + } + + static void CODEGEN_FUNCPTR Switch_Enable(GLenum cap) + { + Enable = (PFNENABLEPROC)IntGetProcAddress("glEnable"); + Enable(cap); + } + + static void CODEGEN_FUNCPTR Switch_Finish() + { + Finish = (PFNFINISHPROC)IntGetProcAddress("glFinish"); + Finish(); + } + + static void CODEGEN_FUNCPTR Switch_Flush() + { + Flush = (PFNFLUSHPROC)IntGetProcAddress("glFlush"); + Flush(); + } + + static void CODEGEN_FUNCPTR Switch_BlendFunc(GLenum sfactor, GLenum dfactor) + { + BlendFunc = (PFNBLENDFUNCPROC)IntGetProcAddress("glBlendFunc"); + BlendFunc(sfactor, dfactor); + } + + static void CODEGEN_FUNCPTR Switch_LogicOp(GLenum opcode) + { + LogicOp = (PFNLOGICOPPROC)IntGetProcAddress("glLogicOp"); + LogicOp(opcode); + } + + static void CODEGEN_FUNCPTR Switch_StencilFunc(GLenum func, GLint ref, GLuint mask) + { + StencilFunc = (PFNSTENCILFUNCPROC)IntGetProcAddress("glStencilFunc"); + StencilFunc(func, ref, mask); + } + + static void CODEGEN_FUNCPTR Switch_StencilOp(GLenum fail, GLenum zfail, GLenum zpass) + { + StencilOp = (PFNSTENCILOPPROC)IntGetProcAddress("glStencilOp"); + StencilOp(fail, zfail, zpass); + } + + static void CODEGEN_FUNCPTR Switch_DepthFunc(GLenum func) + { + DepthFunc = (PFNDEPTHFUNCPROC)IntGetProcAddress("glDepthFunc"); + DepthFunc(func); + } + + static void CODEGEN_FUNCPTR Switch_PixelStoref(GLenum pname, GLfloat param) + { + PixelStoref = (PFNPIXELSTOREFPROC)IntGetProcAddress("glPixelStoref"); + PixelStoref(pname, param); + } + + static void CODEGEN_FUNCPTR Switch_PixelStorei(GLenum pname, GLint param) + { + PixelStorei = (PFNPIXELSTOREIPROC)IntGetProcAddress("glPixelStorei"); + PixelStorei(pname, param); + } + + static void CODEGEN_FUNCPTR Switch_ReadBuffer(GLenum mode) + { + ReadBuffer = (PFNREADBUFFERPROC)IntGetProcAddress("glReadBuffer"); + ReadBuffer(mode); + } + + static void CODEGEN_FUNCPTR Switch_ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels) + { + ReadPixels = (PFNREADPIXELSPROC)IntGetProcAddress("glReadPixels"); + ReadPixels(x, y, width, height, format, type, pixels); + } + + static void CODEGEN_FUNCPTR Switch_GetBooleanv(GLenum pname, GLboolean *params) + { + GetBooleanv = (PFNGETBOOLEANVPROC)IntGetProcAddress("glGetBooleanv"); + GetBooleanv(pname, params); + } + + static void CODEGEN_FUNCPTR Switch_GetDoublev(GLenum pname, GLdouble *params) + { + GetDoublev = (PFNGETDOUBLEVPROC)IntGetProcAddress("glGetDoublev"); + GetDoublev(pname, params); + } + + static GLenum CODEGEN_FUNCPTR Switch_GetError() + { + GetError = (PFNGETERRORPROC)IntGetProcAddress("glGetError"); + return GetError(); + } + + static void CODEGEN_FUNCPTR Switch_GetFloatv(GLenum pname, GLfloat *params) + { + GetFloatv = (PFNGETFLOATVPROC)IntGetProcAddress("glGetFloatv"); + GetFloatv(pname, params); + } + + static void CODEGEN_FUNCPTR Switch_GetIntegerv(GLenum pname, GLint *params) + { + GetIntegerv = (PFNGETINTEGERVPROC)IntGetProcAddress("glGetIntegerv"); + GetIntegerv(pname, params); + } + + static const GLubyte * CODEGEN_FUNCPTR Switch_GetString(GLenum name) + { + GetString = (PFNGETSTRINGPROC)IntGetProcAddress("glGetString"); + return GetString(name); + } + + static void CODEGEN_FUNCPTR Switch_GetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels) + { + GetTexImage = (PFNGETTEXIMAGEPROC)IntGetProcAddress("glGetTexImage"); + GetTexImage(target, level, format, type, pixels); + } + + static void CODEGEN_FUNCPTR Switch_GetTexParameterfv(GLenum target, GLenum pname, GLfloat *params) + { + GetTexParameterfv = (PFNGETTEXPARAMETERFVPROC)IntGetProcAddress("glGetTexParameterfv"); + GetTexParameterfv(target, pname, params); + } + + static void CODEGEN_FUNCPTR Switch_GetTexParameteriv(GLenum target, GLenum pname, GLint *params) + { + GetTexParameteriv = (PFNGETTEXPARAMETERIVPROC)IntGetProcAddress("glGetTexParameteriv"); + GetTexParameteriv(target, pname, params); + } + + static void CODEGEN_FUNCPTR Switch_GetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params) + { + GetTexLevelParameterfv = (PFNGETTEXLEVELPARAMETERFVPROC)IntGetProcAddress("glGetTexLevelParameterfv"); + GetTexLevelParameterfv(target, level, pname, params); + } + + static void CODEGEN_FUNCPTR Switch_GetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params) + { + GetTexLevelParameteriv = (PFNGETTEXLEVELPARAMETERIVPROC)IntGetProcAddress("glGetTexLevelParameteriv"); + GetTexLevelParameteriv(target, level, pname, params); + } + + static GLboolean CODEGEN_FUNCPTR Switch_IsEnabled(GLenum cap) + { + IsEnabled = (PFNISENABLEDPROC)IntGetProcAddress("glIsEnabled"); + return IsEnabled(cap); + } + + static void CODEGEN_FUNCPTR Switch_DepthRange(GLdouble ren_near, GLdouble ren_far) + { + DepthRange = (PFNDEPTHRANGEPROC)IntGetProcAddress("glDepthRange"); + DepthRange(ren_near, ren_far); + } + + static void CODEGEN_FUNCPTR Switch_Viewport(GLint x, GLint y, GLsizei width, GLsizei height) + { + Viewport = (PFNVIEWPORTPROC)IntGetProcAddress("glViewport"); + Viewport(x, y, width, height); + } + + static void CODEGEN_FUNCPTR Switch_DrawArrays(GLenum mode, GLint first, GLsizei count) + { + DrawArrays = (PFNDRAWARRAYSPROC)IntGetProcAddress("glDrawArrays"); + DrawArrays(mode, first, count); + } + + static void CODEGEN_FUNCPTR Switch_DrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices) + { + DrawElements = (PFNDRAWELEMENTSPROC)IntGetProcAddress("glDrawElements"); + DrawElements(mode, count, type, indices); + } + + static void CODEGEN_FUNCPTR Switch_GetPointerv(GLenum pname, GLvoid* *params) + { + GetPointerv = (PFNGETPOINTERVPROC)IntGetProcAddress("glGetPointerv"); + GetPointerv(pname, params); + } + + static void CODEGEN_FUNCPTR Switch_PolygonOffset(GLfloat factor, GLfloat units) + { + PolygonOffset = (PFNPOLYGONOFFSETPROC)IntGetProcAddress("glPolygonOffset"); + PolygonOffset(factor, units); + } + + static void CODEGEN_FUNCPTR Switch_CopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) + { + CopyTexImage1D = (PFNCOPYTEXIMAGE1DPROC)IntGetProcAddress("glCopyTexImage1D"); + CopyTexImage1D(target, level, internalformat, x, y, width, border); + } + + static void CODEGEN_FUNCPTR Switch_CopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) + { + CopyTexImage2D = (PFNCOPYTEXIMAGE2DPROC)IntGetProcAddress("glCopyTexImage2D"); + CopyTexImage2D(target, level, internalformat, x, y, width, height, border); + } + + static void CODEGEN_FUNCPTR Switch_CopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) + { + CopyTexSubImage1D = (PFNCOPYTEXSUBIMAGE1DPROC)IntGetProcAddress("glCopyTexSubImage1D"); + CopyTexSubImage1D(target, level, xoffset, x, y, width); + } + + static void CODEGEN_FUNCPTR Switch_CopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) + { + CopyTexSubImage2D = (PFNCOPYTEXSUBIMAGE2DPROC)IntGetProcAddress("glCopyTexSubImage2D"); + CopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); + } + + static void CODEGEN_FUNCPTR Switch_TexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels) + { + TexSubImage1D = (PFNTEXSUBIMAGE1DPROC)IntGetProcAddress("glTexSubImage1D"); + TexSubImage1D(target, level, xoffset, width, format, type, pixels); + } + + static void CODEGEN_FUNCPTR Switch_TexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) + { + TexSubImage2D = (PFNTEXSUBIMAGE2DPROC)IntGetProcAddress("glTexSubImage2D"); + TexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); + } + + static void CODEGEN_FUNCPTR Switch_BindTexture(GLenum target, GLuint texture) + { + BindTexture = (PFNBINDTEXTUREPROC)IntGetProcAddress("glBindTexture"); + BindTexture(target, texture); + } + + static void CODEGEN_FUNCPTR Switch_DeleteTextures(GLsizei n, const GLuint *textures) + { + DeleteTextures = (PFNDELETETEXTURESPROC)IntGetProcAddress("glDeleteTextures"); + DeleteTextures(n, textures); + } + + static void CODEGEN_FUNCPTR Switch_GenTextures(GLsizei n, GLuint *textures) + { + GenTextures = (PFNGENTEXTURESPROC)IntGetProcAddress("glGenTextures"); + GenTextures(n, textures); + } + + static GLboolean CODEGEN_FUNCPTR Switch_IsTexture(GLuint texture) + { + IsTexture = (PFNISTEXTUREPROC)IntGetProcAddress("glIsTexture"); + return IsTexture(texture); + } + + static void CODEGEN_FUNCPTR Switch_Indexub(GLubyte c) + { + Indexub = (PFNINDEXUBPROC)IntGetProcAddress("glIndexub"); + Indexub(c); + } + + static void CODEGEN_FUNCPTR Switch_Indexubv(const GLubyte *c) + { + Indexubv = (PFNINDEXUBVPROC)IntGetProcAddress("glIndexubv"); + Indexubv(c); + } + + // Extension: 1.2 + + static void CODEGEN_FUNCPTR Switch_BlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) + { + BlendColor = (PFNBLENDCOLORPROC)IntGetProcAddress("glBlendColor"); + BlendColor(red, green, blue, alpha); + } + + static void CODEGEN_FUNCPTR Switch_BlendEquation(GLenum mode) + { + BlendEquation = (PFNBLENDEQUATIONPROC)IntGetProcAddress("glBlendEquation"); + BlendEquation(mode); + } + + static void CODEGEN_FUNCPTR Switch_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices) + { + DrawRangeElements = (PFNDRAWRANGEELEMENTSPROC)IntGetProcAddress("glDrawRangeElements"); + DrawRangeElements(mode, start, end, count, type, indices); + } + + static void CODEGEN_FUNCPTR Switch_TexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels) + { + TexSubImage3D = (PFNTEXSUBIMAGE3DPROC)IntGetProcAddress("glTexSubImage3D"); + TexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + static void CODEGEN_FUNCPTR Switch_CopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) + { + CopyTexSubImage3D = (PFNCOPYTEXSUBIMAGE3DPROC)IntGetProcAddress("glCopyTexSubImage3D"); + CopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height); + } + + // Extension: 1.3 + + static void CODEGEN_FUNCPTR Switch_ActiveTexture(GLenum texture) + { + ActiveTexture = (PFNACTIVETEXTUREPROC)IntGetProcAddress("glActiveTexture"); + ActiveTexture(texture); + } + + static void CODEGEN_FUNCPTR Switch_SampleCoverage(GLfloat value, GLboolean invert) + { + SampleCoverage = (PFNSAMPLECOVERAGEPROC)IntGetProcAddress("glSampleCoverage"); + SampleCoverage(value, invert); + } + + static void CODEGEN_FUNCPTR Switch_CompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) + { + CompressedTexImage3D = (PFNCOMPRESSEDTEXIMAGE3DPROC)IntGetProcAddress("glCompressedTexImage3D"); + CompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data); + } + + static void CODEGEN_FUNCPTR Switch_CompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) + { + CompressedTexImage2D = (PFNCOMPRESSEDTEXIMAGE2DPROC)IntGetProcAddress("glCompressedTexImage2D"); + CompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data); + } + + static void CODEGEN_FUNCPTR Switch_CompressedTexImage1D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) + { + CompressedTexImage1D = (PFNCOMPRESSEDTEXIMAGE1DPROC)IntGetProcAddress("glCompressedTexImage1D"); + CompressedTexImage1D(target, level, internalformat, width, border, imageSize, data); + } + + static void CODEGEN_FUNCPTR Switch_CompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) + { + CompressedTexSubImage3D = (PFNCOMPRESSEDTEXSUBIMAGE3DPROC)IntGetProcAddress("glCompressedTexSubImage3D"); + CompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); + } + + static void CODEGEN_FUNCPTR Switch_CompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) + { + CompressedTexSubImage2D = (PFNCOMPRESSEDTEXSUBIMAGE2DPROC)IntGetProcAddress("glCompressedTexSubImage2D"); + CompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data); + } + + static void CODEGEN_FUNCPTR Switch_CompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) + { + CompressedTexSubImage1D = (PFNCOMPRESSEDTEXSUBIMAGE1DPROC)IntGetProcAddress("glCompressedTexSubImage1D"); + CompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data); + } + + static void CODEGEN_FUNCPTR Switch_GetCompressedTexImage(GLenum target, GLint level, GLvoid *img) + { + GetCompressedTexImage = (PFNGETCOMPRESSEDTEXIMAGEPROC)IntGetProcAddress("glGetCompressedTexImage"); + GetCompressedTexImage(target, level, img); + } + + // Extension: 1.4 + + static void CODEGEN_FUNCPTR Switch_BlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) + { + BlendFuncSeparate = (PFNBLENDFUNCSEPARATEPROC)IntGetProcAddress("glBlendFuncSeparate"); + BlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); + } + + static void CODEGEN_FUNCPTR Switch_MultiDrawArrays(GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount) + { + MultiDrawArrays = (PFNMULTIDRAWARRAYSPROC)IntGetProcAddress("glMultiDrawArrays"); + MultiDrawArrays(mode, first, count, drawcount); + } + + static void CODEGEN_FUNCPTR Switch_MultiDrawElements(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount) + { + MultiDrawElements = (PFNMULTIDRAWELEMENTSPROC)IntGetProcAddress("glMultiDrawElements"); + MultiDrawElements(mode, count, type, indices, drawcount); + } + + static void CODEGEN_FUNCPTR Switch_PointParameterf(GLenum pname, GLfloat param) + { + PointParameterf = (PFNPOINTPARAMETERFPROC)IntGetProcAddress("glPointParameterf"); + PointParameterf(pname, param); + } + + static void CODEGEN_FUNCPTR Switch_PointParameterfv(GLenum pname, const GLfloat *params) + { + PointParameterfv = (PFNPOINTPARAMETERFVPROC)IntGetProcAddress("glPointParameterfv"); + PointParameterfv(pname, params); + } + + static void CODEGEN_FUNCPTR Switch_PointParameteri(GLenum pname, GLint param) + { + PointParameteri = (PFNPOINTPARAMETERIPROC)IntGetProcAddress("glPointParameteri"); + PointParameteri(pname, param); + } + + static void CODEGEN_FUNCPTR Switch_PointParameteriv(GLenum pname, const GLint *params) + { + PointParameteriv = (PFNPOINTPARAMETERIVPROC)IntGetProcAddress("glPointParameteriv"); + PointParameteriv(pname, params); + } + + // Extension: 1.5 + + static void CODEGEN_FUNCPTR Switch_GenQueries(GLsizei n, GLuint *ids) + { + GenQueries = (PFNGENQUERIESPROC)IntGetProcAddress("glGenQueries"); + GenQueries(n, ids); + } + + static void CODEGEN_FUNCPTR Switch_DeleteQueries(GLsizei n, const GLuint *ids) + { + DeleteQueries = (PFNDELETEQUERIESPROC)IntGetProcAddress("glDeleteQueries"); + DeleteQueries(n, ids); + } + + static GLboolean CODEGEN_FUNCPTR Switch_IsQuery(GLuint id) + { + IsQuery = (PFNISQUERYPROC)IntGetProcAddress("glIsQuery"); + return IsQuery(id); + } + + static void CODEGEN_FUNCPTR Switch_BeginQuery(GLenum target, GLuint id) + { + BeginQuery = (PFNBEGINQUERYPROC)IntGetProcAddress("glBeginQuery"); + BeginQuery(target, id); + } + + static void CODEGEN_FUNCPTR Switch_EndQuery(GLenum target) + { + EndQuery = (PFNENDQUERYPROC)IntGetProcAddress("glEndQuery"); + EndQuery(target); + } + + static void CODEGEN_FUNCPTR Switch_GetQueryiv(GLenum target, GLenum pname, GLint *params) + { + GetQueryiv = (PFNGETQUERYIVPROC)IntGetProcAddress("glGetQueryiv"); + GetQueryiv(target, pname, params); + } + + static void CODEGEN_FUNCPTR Switch_GetQueryObjectiv(GLuint id, GLenum pname, GLint *params) + { + GetQueryObjectiv = (PFNGETQUERYOBJECTIVPROC)IntGetProcAddress("glGetQueryObjectiv"); + GetQueryObjectiv(id, pname, params); + } + + static void CODEGEN_FUNCPTR Switch_GetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params) + { + GetQueryObjectuiv = (PFNGETQUERYOBJECTUIVPROC)IntGetProcAddress("glGetQueryObjectuiv"); + GetQueryObjectuiv(id, pname, params); + } + + static void CODEGEN_FUNCPTR Switch_BindBuffer(GLenum target, GLuint buffer) + { + BindBuffer = (PFNBINDBUFFERPROC)IntGetProcAddress("glBindBuffer"); + BindBuffer(target, buffer); + } + + static void CODEGEN_FUNCPTR Switch_DeleteBuffers(GLsizei n, const GLuint *buffers) + { + DeleteBuffers = (PFNDELETEBUFFERSPROC)IntGetProcAddress("glDeleteBuffers"); + DeleteBuffers(n, buffers); + } + + static void CODEGEN_FUNCPTR Switch_GenBuffers(GLsizei n, GLuint *buffers) + { + GenBuffers = (PFNGENBUFFERSPROC)IntGetProcAddress("glGenBuffers"); + GenBuffers(n, buffers); + } + + static GLboolean CODEGEN_FUNCPTR Switch_IsBuffer(GLuint buffer) + { + IsBuffer = (PFNISBUFFERPROC)IntGetProcAddress("glIsBuffer"); + return IsBuffer(buffer); + } + + static void CODEGEN_FUNCPTR Switch_BufferData(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage) + { + BufferData = (PFNBUFFERDATAPROC)IntGetProcAddress("glBufferData"); + BufferData(target, size, data, usage); + } + + static void CODEGEN_FUNCPTR Switch_BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data) + { + BufferSubData = (PFNBUFFERSUBDATAPROC)IntGetProcAddress("glBufferSubData"); + BufferSubData(target, offset, size, data); + } + + static void CODEGEN_FUNCPTR Switch_GetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data) + { + GetBufferSubData = (PFNGETBUFFERSUBDATAPROC)IntGetProcAddress("glGetBufferSubData"); + GetBufferSubData(target, offset, size, data); + } + + static GLvoid* CODEGEN_FUNCPTR Switch_MapBuffer(GLenum target, GLenum access) + { + MapBuffer = (PFNMAPBUFFERPROC)IntGetProcAddress("glMapBuffer"); + return MapBuffer(target, access); + } + + static GLboolean CODEGEN_FUNCPTR Switch_UnmapBuffer(GLenum target) + { + UnmapBuffer = (PFNUNMAPBUFFERPROC)IntGetProcAddress("glUnmapBuffer"); + return UnmapBuffer(target); + } + + static void CODEGEN_FUNCPTR Switch_GetBufferParameteriv(GLenum target, GLenum pname, GLint *params) + { + GetBufferParameteriv = (PFNGETBUFFERPARAMETERIVPROC)IntGetProcAddress("glGetBufferParameteriv"); + GetBufferParameteriv(target, pname, params); + } + + static void CODEGEN_FUNCPTR Switch_GetBufferPointerv(GLenum target, GLenum pname, GLvoid* *params) + { + GetBufferPointerv = (PFNGETBUFFERPOINTERVPROC)IntGetProcAddress("glGetBufferPointerv"); + GetBufferPointerv(target, pname, params); + } + + // Extension: 2.0 + + static void CODEGEN_FUNCPTR Switch_BlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) + { + BlendEquationSeparate = (PFNBLENDEQUATIONSEPARATEPROC)IntGetProcAddress("glBlendEquationSeparate"); + BlendEquationSeparate(modeRGB, modeAlpha); + } + + static void CODEGEN_FUNCPTR Switch_DrawBuffers(GLsizei n, const GLenum *bufs) + { + DrawBuffers = (PFNDRAWBUFFERSPROC)IntGetProcAddress("glDrawBuffers"); + DrawBuffers(n, bufs); + } + + static void CODEGEN_FUNCPTR Switch_StencilOpSeparate(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass) + { + StencilOpSeparate = (PFNSTENCILOPSEPARATEPROC)IntGetProcAddress("glStencilOpSeparate"); + StencilOpSeparate(face, sfail, dpfail, dppass); + } + + static void CODEGEN_FUNCPTR Switch_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) + { + StencilFuncSeparate = (PFNSTENCILFUNCSEPARATEPROC)IntGetProcAddress("glStencilFuncSeparate"); + StencilFuncSeparate(face, func, ref, mask); + } + + static void CODEGEN_FUNCPTR Switch_StencilMaskSeparate(GLenum face, GLuint mask) + { + StencilMaskSeparate = (PFNSTENCILMASKSEPARATEPROC)IntGetProcAddress("glStencilMaskSeparate"); + StencilMaskSeparate(face, mask); + } + + static void CODEGEN_FUNCPTR Switch_AttachShader(GLuint program, GLuint shader) + { + AttachShader = (PFNATTACHSHADERPROC)IntGetProcAddress("glAttachShader"); + AttachShader(program, shader); + } + + static void CODEGEN_FUNCPTR Switch_BindAttribLocation(GLuint program, GLuint index, const GLchar *name) + { + BindAttribLocation = (PFNBINDATTRIBLOCATIONPROC)IntGetProcAddress("glBindAttribLocation"); + BindAttribLocation(program, index, name); + } + + static void CODEGEN_FUNCPTR Switch_CompileShader(GLuint shader) + { + CompileShader = (PFNCOMPILESHADERPROC)IntGetProcAddress("glCompileShader"); + CompileShader(shader); + } + + static GLuint CODEGEN_FUNCPTR Switch_CreateProgram() + { + CreateProgram = (PFNCREATEPROGRAMPROC)IntGetProcAddress("glCreateProgram"); + return CreateProgram(); + } + + static GLuint CODEGEN_FUNCPTR Switch_CreateShader(GLenum type) + { + CreateShader = (PFNCREATESHADERPROC)IntGetProcAddress("glCreateShader"); + return CreateShader(type); + } + + static void CODEGEN_FUNCPTR Switch_DeleteProgram(GLuint program) + { + DeleteProgram = (PFNDELETEPROGRAMPROC)IntGetProcAddress("glDeleteProgram"); + DeleteProgram(program); + } + + static void CODEGEN_FUNCPTR Switch_DeleteShader(GLuint shader) + { + DeleteShader = (PFNDELETESHADERPROC)IntGetProcAddress("glDeleteShader"); + DeleteShader(shader); + } + + static void CODEGEN_FUNCPTR Switch_DetachShader(GLuint program, GLuint shader) + { + DetachShader = (PFNDETACHSHADERPROC)IntGetProcAddress("glDetachShader"); + DetachShader(program, shader); + } + + static void CODEGEN_FUNCPTR Switch_DisableVertexAttribArray(GLuint index) + { + DisableVertexAttribArray = (PFNDISABLEVERTEXATTRIBARRAYPROC)IntGetProcAddress("glDisableVertexAttribArray"); + DisableVertexAttribArray(index); + } + + static void CODEGEN_FUNCPTR Switch_EnableVertexAttribArray(GLuint index) + { + EnableVertexAttribArray = (PFNENABLEVERTEXATTRIBARRAYPROC)IntGetProcAddress("glEnableVertexAttribArray"); + EnableVertexAttribArray(index); + } + + static void CODEGEN_FUNCPTR Switch_GetActiveAttrib(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name) + { + GetActiveAttrib = (PFNGETACTIVEATTRIBPROC)IntGetProcAddress("glGetActiveAttrib"); + GetActiveAttrib(program, index, bufSize, length, size, type, name); + } + + static void CODEGEN_FUNCPTR Switch_GetActiveUniform(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name) + { + GetActiveUniform = (PFNGETACTIVEUNIFORMPROC)IntGetProcAddress("glGetActiveUniform"); + GetActiveUniform(program, index, bufSize, length, size, type, name); + } + + static void CODEGEN_FUNCPTR Switch_GetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj) + { + GetAttachedShaders = (PFNGETATTACHEDSHADERSPROC)IntGetProcAddress("glGetAttachedShaders"); + GetAttachedShaders(program, maxCount, count, obj); + } + + static GLint CODEGEN_FUNCPTR Switch_GetAttribLocation(GLuint program, const GLchar *name) + { + GetAttribLocation = (PFNGETATTRIBLOCATIONPROC)IntGetProcAddress("glGetAttribLocation"); + return GetAttribLocation(program, name); + } + + static void CODEGEN_FUNCPTR Switch_GetProgramiv(GLuint program, GLenum pname, GLint *params) + { + GetProgramiv = (PFNGETPROGRAMIVPROC)IntGetProcAddress("glGetProgramiv"); + GetProgramiv(program, pname, params); + } + + static void CODEGEN_FUNCPTR Switch_GetProgramInfoLog(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog) + { + GetProgramInfoLog = (PFNGETPROGRAMINFOLOGPROC)IntGetProcAddress("glGetProgramInfoLog"); + GetProgramInfoLog(program, bufSize, length, infoLog); + } + + static void CODEGEN_FUNCPTR Switch_GetShaderiv(GLuint shader, GLenum pname, GLint *params) + { + GetShaderiv = (PFNGETSHADERIVPROC)IntGetProcAddress("glGetShaderiv"); + GetShaderiv(shader, pname, params); + } + + static void CODEGEN_FUNCPTR Switch_GetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog) + { + GetShaderInfoLog = (PFNGETSHADERINFOLOGPROC)IntGetProcAddress("glGetShaderInfoLog"); + GetShaderInfoLog(shader, bufSize, length, infoLog); + } + + static void CODEGEN_FUNCPTR Switch_GetShaderSource(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source) + { + GetShaderSource = (PFNGETSHADERSOURCEPROC)IntGetProcAddress("glGetShaderSource"); + GetShaderSource(shader, bufSize, length, source); + } + + static GLint CODEGEN_FUNCPTR Switch_GetUniformLocation(GLuint program, const GLchar *name) + { + GetUniformLocation = (PFNGETUNIFORMLOCATIONPROC)IntGetProcAddress("glGetUniformLocation"); + return GetUniformLocation(program, name); + } + + static void CODEGEN_FUNCPTR Switch_GetUniformfv(GLuint program, GLint location, GLfloat *params) + { + GetUniformfv = (PFNGETUNIFORMFVPROC)IntGetProcAddress("glGetUniformfv"); + GetUniformfv(program, location, params); + } + + static void CODEGEN_FUNCPTR Switch_GetUniformiv(GLuint program, GLint location, GLint *params) + { + GetUniformiv = (PFNGETUNIFORMIVPROC)IntGetProcAddress("glGetUniformiv"); + GetUniformiv(program, location, params); + } + + static void CODEGEN_FUNCPTR Switch_GetVertexAttribdv(GLuint index, GLenum pname, GLdouble *params) + { + GetVertexAttribdv = (PFNGETVERTEXATTRIBDVPROC)IntGetProcAddress("glGetVertexAttribdv"); + GetVertexAttribdv(index, pname, params); + } + + static void CODEGEN_FUNCPTR Switch_GetVertexAttribfv(GLuint index, GLenum pname, GLfloat *params) + { + GetVertexAttribfv = (PFNGETVERTEXATTRIBFVPROC)IntGetProcAddress("glGetVertexAttribfv"); + GetVertexAttribfv(index, pname, params); + } + + static void CODEGEN_FUNCPTR Switch_GetVertexAttribiv(GLuint index, GLenum pname, GLint *params) + { + GetVertexAttribiv = (PFNGETVERTEXATTRIBIVPROC)IntGetProcAddress("glGetVertexAttribiv"); + GetVertexAttribiv(index, pname, params); + } + + static void CODEGEN_FUNCPTR Switch_GetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid* *pointer) + { + GetVertexAttribPointerv = (PFNGETVERTEXATTRIBPOINTERVPROC)IntGetProcAddress("glGetVertexAttribPointerv"); + GetVertexAttribPointerv(index, pname, pointer); + } + + static GLboolean CODEGEN_FUNCPTR Switch_IsProgram(GLuint program) + { + IsProgram = (PFNISPROGRAMPROC)IntGetProcAddress("glIsProgram"); + return IsProgram(program); + } + + static GLboolean CODEGEN_FUNCPTR Switch_IsShader(GLuint shader) + { + IsShader = (PFNISSHADERPROC)IntGetProcAddress("glIsShader"); + return IsShader(shader); + } + + static void CODEGEN_FUNCPTR Switch_LinkProgram(GLuint program) + { + LinkProgram = (PFNLINKPROGRAMPROC)IntGetProcAddress("glLinkProgram"); + LinkProgram(program); + } + + static void CODEGEN_FUNCPTR Switch_ShaderSource(GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length) + { + ShaderSource = (PFNSHADERSOURCEPROC)IntGetProcAddress("glShaderSource"); + ShaderSource(shader, count, string, length); + } + + static void CODEGEN_FUNCPTR Switch_UseProgram(GLuint program) + { + UseProgram = (PFNUSEPROGRAMPROC)IntGetProcAddress("glUseProgram"); + UseProgram(program); + } + + static void CODEGEN_FUNCPTR Switch_Uniform1f(GLint location, GLfloat v0) + { + Uniform1f = (PFNUNIFORM1FPROC)IntGetProcAddress("glUniform1f"); + Uniform1f(location, v0); + } + + static void CODEGEN_FUNCPTR Switch_Uniform2f(GLint location, GLfloat v0, GLfloat v1) + { + Uniform2f = (PFNUNIFORM2FPROC)IntGetProcAddress("glUniform2f"); + Uniform2f(location, v0, v1); + } + + static void CODEGEN_FUNCPTR Switch_Uniform3f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) + { + Uniform3f = (PFNUNIFORM3FPROC)IntGetProcAddress("glUniform3f"); + Uniform3f(location, v0, v1, v2); + } + + static void CODEGEN_FUNCPTR Switch_Uniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) + { + Uniform4f = (PFNUNIFORM4FPROC)IntGetProcAddress("glUniform4f"); + Uniform4f(location, v0, v1, v2, v3); + } + + static void CODEGEN_FUNCPTR Switch_Uniform1i(GLint location, GLint v0) + { + Uniform1i = (PFNUNIFORM1IPROC)IntGetProcAddress("glUniform1i"); + Uniform1i(location, v0); + } + + static void CODEGEN_FUNCPTR Switch_Uniform2i(GLint location, GLint v0, GLint v1) + { + Uniform2i = (PFNUNIFORM2IPROC)IntGetProcAddress("glUniform2i"); + Uniform2i(location, v0, v1); + } + + static void CODEGEN_FUNCPTR Switch_Uniform3i(GLint location, GLint v0, GLint v1, GLint v2) + { + Uniform3i = (PFNUNIFORM3IPROC)IntGetProcAddress("glUniform3i"); + Uniform3i(location, v0, v1, v2); + } + + static void CODEGEN_FUNCPTR Switch_Uniform4i(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) + { + Uniform4i = (PFNUNIFORM4IPROC)IntGetProcAddress("glUniform4i"); + Uniform4i(location, v0, v1, v2, v3); + } + + static void CODEGEN_FUNCPTR Switch_Uniform1fv(GLint location, GLsizei count, const GLfloat *value) + { + Uniform1fv = (PFNUNIFORM1FVPROC)IntGetProcAddress("glUniform1fv"); + Uniform1fv(location, count, value); + } + + static void CODEGEN_FUNCPTR Switch_Uniform2fv(GLint location, GLsizei count, const GLfloat *value) + { + Uniform2fv = (PFNUNIFORM2FVPROC)IntGetProcAddress("glUniform2fv"); + Uniform2fv(location, count, value); + } + + static void CODEGEN_FUNCPTR Switch_Uniform3fv(GLint location, GLsizei count, const GLfloat *value) + { + Uniform3fv = (PFNUNIFORM3FVPROC)IntGetProcAddress("glUniform3fv"); + Uniform3fv(location, count, value); + } + + static void CODEGEN_FUNCPTR Switch_Uniform4fv(GLint location, GLsizei count, const GLfloat *value) + { + Uniform4fv = (PFNUNIFORM4FVPROC)IntGetProcAddress("glUniform4fv"); + Uniform4fv(location, count, value); + } + + static void CODEGEN_FUNCPTR Switch_Uniform1iv(GLint location, GLsizei count, const GLint *value) + { + Uniform1iv = (PFNUNIFORM1IVPROC)IntGetProcAddress("glUniform1iv"); + Uniform1iv(location, count, value); + } + + static void CODEGEN_FUNCPTR Switch_Uniform2iv(GLint location, GLsizei count, const GLint *value) + { + Uniform2iv = (PFNUNIFORM2IVPROC)IntGetProcAddress("glUniform2iv"); + Uniform2iv(location, count, value); + } + + static void CODEGEN_FUNCPTR Switch_Uniform3iv(GLint location, GLsizei count, const GLint *value) + { + Uniform3iv = (PFNUNIFORM3IVPROC)IntGetProcAddress("glUniform3iv"); + Uniform3iv(location, count, value); + } + + static void CODEGEN_FUNCPTR Switch_Uniform4iv(GLint location, GLsizei count, const GLint *value) + { + Uniform4iv = (PFNUNIFORM4IVPROC)IntGetProcAddress("glUniform4iv"); + Uniform4iv(location, count, value); + } + + static void CODEGEN_FUNCPTR Switch_UniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) + { + UniformMatrix2fv = (PFNUNIFORMMATRIX2FVPROC)IntGetProcAddress("glUniformMatrix2fv"); + UniformMatrix2fv(location, count, transpose, value); + } + + static void CODEGEN_FUNCPTR Switch_UniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) + { + UniformMatrix3fv = (PFNUNIFORMMATRIX3FVPROC)IntGetProcAddress("glUniformMatrix3fv"); + UniformMatrix3fv(location, count, transpose, value); + } + + static void CODEGEN_FUNCPTR Switch_UniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) + { + UniformMatrix4fv = (PFNUNIFORMMATRIX4FVPROC)IntGetProcAddress("glUniformMatrix4fv"); + UniformMatrix4fv(location, count, transpose, value); + } + + static void CODEGEN_FUNCPTR Switch_ValidateProgram(GLuint program) + { + ValidateProgram = (PFNVALIDATEPROGRAMPROC)IntGetProcAddress("glValidateProgram"); + ValidateProgram(program); + } + + static void CODEGEN_FUNCPTR Switch_VertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer) + { + VertexAttribPointer = (PFNVERTEXATTRIBPOINTERPROC)IntGetProcAddress("glVertexAttribPointer"); + VertexAttribPointer(index, size, type, normalized, stride, pointer); + } + + // Extension: 2.1 + + static void CODEGEN_FUNCPTR Switch_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) + { + UniformMatrix2x3fv = (PFNUNIFORMMATRIX2X3FVPROC)IntGetProcAddress("glUniformMatrix2x3fv"); + UniformMatrix2x3fv(location, count, transpose, value); + } + + static void CODEGEN_FUNCPTR Switch_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) + { + UniformMatrix3x2fv = (PFNUNIFORMMATRIX3X2FVPROC)IntGetProcAddress("glUniformMatrix3x2fv"); + UniformMatrix3x2fv(location, count, transpose, value); + } + + static void CODEGEN_FUNCPTR Switch_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) + { + UniformMatrix2x4fv = (PFNUNIFORMMATRIX2X4FVPROC)IntGetProcAddress("glUniformMatrix2x4fv"); + UniformMatrix2x4fv(location, count, transpose, value); + } + + static void CODEGEN_FUNCPTR Switch_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) + { + UniformMatrix4x2fv = (PFNUNIFORMMATRIX4X2FVPROC)IntGetProcAddress("glUniformMatrix4x2fv"); + UniformMatrix4x2fv(location, count, transpose, value); + } + + static void CODEGEN_FUNCPTR Switch_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) + { + UniformMatrix3x4fv = (PFNUNIFORMMATRIX3X4FVPROC)IntGetProcAddress("glUniformMatrix3x4fv"); + UniformMatrix3x4fv(location, count, transpose, value); + } + + static void CODEGEN_FUNCPTR Switch_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) + { + UniformMatrix4x3fv = (PFNUNIFORMMATRIX4X3FVPROC)IntGetProcAddress("glUniformMatrix4x3fv"); + UniformMatrix4x3fv(location, count, transpose, value); + } + + // Extension: ARB_vertex_array_object + + static void CODEGEN_FUNCPTR Switch_BindVertexArray(GLuint ren_array) + { + BindVertexArray = (PFNBINDVERTEXARRAYPROC)IntGetProcAddress("glBindVertexArray"); + BindVertexArray(ren_array); + } + + static void CODEGEN_FUNCPTR Switch_DeleteVertexArrays(GLsizei n, const GLuint *arrays) + { + DeleteVertexArrays = (PFNDELETEVERTEXARRAYSPROC)IntGetProcAddress("glDeleteVertexArrays"); + DeleteVertexArrays(n, arrays); + } + + static void CODEGEN_FUNCPTR Switch_GenVertexArrays(GLsizei n, GLuint *arrays) + { + GenVertexArrays = (PFNGENVERTEXARRAYSPROC)IntGetProcAddress("glGenVertexArrays"); + GenVertexArrays(n, arrays); + } + + static GLboolean CODEGEN_FUNCPTR Switch_IsVertexArray(GLuint ren_array) + { + IsVertexArray = (PFNISVERTEXARRAYPROC)IntGetProcAddress("glIsVertexArray"); + return IsVertexArray(ren_array); + } + + // Extension: ARB_map_buffer_range + + static GLvoid* CODEGEN_FUNCPTR Switch_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access) + { + MapBufferRange = (PFNMAPBUFFERRANGEPROC)IntGetProcAddress("glMapBufferRange"); + return MapBufferRange(target, offset, length, access); + } + + static void CODEGEN_FUNCPTR Switch_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length) + { + FlushMappedBufferRange = (PFNFLUSHMAPPEDBUFFERRANGEPROC)IntGetProcAddress("glFlushMappedBufferRange"); + FlushMappedBufferRange(target, offset, length); + } + + // Extension: ARB_framebuffer_object + + static GLboolean CODEGEN_FUNCPTR Switch_IsRenderbuffer(GLuint renderbuffer) + { + IsRenderbuffer = (PFNISRENDERBUFFERPROC)IntGetProcAddress("glIsRenderbuffer"); + return IsRenderbuffer(renderbuffer); + } + + static void CODEGEN_FUNCPTR Switch_BindRenderbuffer(GLenum target, GLuint renderbuffer) + { + BindRenderbuffer = (PFNBINDRENDERBUFFERPROC)IntGetProcAddress("glBindRenderbuffer"); + BindRenderbuffer(target, renderbuffer); + } + + static void CODEGEN_FUNCPTR Switch_DeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers) + { + DeleteRenderbuffers = (PFNDELETERENDERBUFFERSPROC)IntGetProcAddress("glDeleteRenderbuffers"); + DeleteRenderbuffers(n, renderbuffers); + } + + static void CODEGEN_FUNCPTR Switch_GenRenderbuffers(GLsizei n, GLuint *renderbuffers) + { + GenRenderbuffers = (PFNGENRENDERBUFFERSPROC)IntGetProcAddress("glGenRenderbuffers"); + GenRenderbuffers(n, renderbuffers); + } + + static void CODEGEN_FUNCPTR Switch_RenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) + { + RenderbufferStorage = (PFNRENDERBUFFERSTORAGEPROC)IntGetProcAddress("glRenderbufferStorage"); + RenderbufferStorage(target, internalformat, width, height); + } + + static void CODEGEN_FUNCPTR Switch_GetRenderbufferParameteriv(GLenum target, GLenum pname, GLint *params) + { + GetRenderbufferParameteriv = (PFNGETRENDERBUFFERPARAMETERIVPROC)IntGetProcAddress("glGetRenderbufferParameteriv"); + GetRenderbufferParameteriv(target, pname, params); + } + + static GLboolean CODEGEN_FUNCPTR Switch_IsFramebuffer(GLuint framebuffer) + { + IsFramebuffer = (PFNISFRAMEBUFFERPROC)IntGetProcAddress("glIsFramebuffer"); + return IsFramebuffer(framebuffer); + } + + static void CODEGEN_FUNCPTR Switch_BindFramebuffer(GLenum target, GLuint framebuffer) + { + BindFramebuffer = (PFNBINDFRAMEBUFFERPROC)IntGetProcAddress("glBindFramebuffer"); + BindFramebuffer(target, framebuffer); + } + + static void CODEGEN_FUNCPTR Switch_DeleteFramebuffers(GLsizei n, const GLuint *framebuffers) + { + DeleteFramebuffers = (PFNDELETEFRAMEBUFFERSPROC)IntGetProcAddress("glDeleteFramebuffers"); + DeleteFramebuffers(n, framebuffers); + } + + static void CODEGEN_FUNCPTR Switch_GenFramebuffers(GLsizei n, GLuint *framebuffers) + { + GenFramebuffers = (PFNGENFRAMEBUFFERSPROC)IntGetProcAddress("glGenFramebuffers"); + GenFramebuffers(n, framebuffers); + } + + static GLenum CODEGEN_FUNCPTR Switch_CheckFramebufferStatus(GLenum target) + { + CheckFramebufferStatus = (PFNCHECKFRAMEBUFFERSTATUSPROC)IntGetProcAddress("glCheckFramebufferStatus"); + return CheckFramebufferStatus(target); + } + + static void CODEGEN_FUNCPTR Switch_FramebufferTexture1D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) + { + FramebufferTexture1D = (PFNFRAMEBUFFERTEXTURE1DPROC)IntGetProcAddress("glFramebufferTexture1D"); + FramebufferTexture1D(target, attachment, textarget, texture, level); + } + + static void CODEGEN_FUNCPTR Switch_FramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) + { + FramebufferTexture2D = (PFNFRAMEBUFFERTEXTURE2DPROC)IntGetProcAddress("glFramebufferTexture2D"); + FramebufferTexture2D(target, attachment, textarget, texture, level); + } + + static void CODEGEN_FUNCPTR Switch_FramebufferTexture3D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) + { + FramebufferTexture3D = (PFNFRAMEBUFFERTEXTURE3DPROC)IntGetProcAddress("glFramebufferTexture3D"); + FramebufferTexture3D(target, attachment, textarget, texture, level, zoffset); + } + + static void CODEGEN_FUNCPTR Switch_FramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) + { + FramebufferRenderbuffer = (PFNFRAMEBUFFERRENDERBUFFERPROC)IntGetProcAddress("glFramebufferRenderbuffer"); + FramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer); + } + + static void CODEGEN_FUNCPTR Switch_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint *params) + { + GetFramebufferAttachmentParameteriv = (PFNGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)IntGetProcAddress("glGetFramebufferAttachmentParameteriv"); + GetFramebufferAttachmentParameteriv(target, attachment, pname, params); + } + + static void CODEGEN_FUNCPTR Switch_GenerateMipmap(GLenum target) + { + GenerateMipmap = (PFNGENERATEMIPMAPPROC)IntGetProcAddress("glGenerateMipmap"); + GenerateMipmap(target); + } + + static void CODEGEN_FUNCPTR Switch_BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) + { + BlitFramebuffer = (PFNBLITFRAMEBUFFERPROC)IntGetProcAddress("glBlitFramebuffer"); + BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); + } + + static void CODEGEN_FUNCPTR Switch_RenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) + { + RenderbufferStorageMultisample = (PFNRENDERBUFFERSTORAGEMULTISAMPLEPROC)IntGetProcAddress("glRenderbufferStorageMultisample"); + RenderbufferStorageMultisample(target, samples, internalformat, width, height); + } + + static void CODEGEN_FUNCPTR Switch_FramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) + { + FramebufferTextureLayer = (PFNFRAMEBUFFERTEXTURELAYERPROC)IntGetProcAddress("glFramebufferTextureLayer"); + FramebufferTextureLayer(target, attachment, texture, level, layer); + } + + // Extension: 3.0 + + static void CODEGEN_FUNCPTR Switch_ColorMaski(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a) + { + ColorMaski = (PFNCOLORMASKIPROC)IntGetProcAddress("glColorMaski"); + ColorMaski(index, r, g, b, a); + } + + static void CODEGEN_FUNCPTR Switch_GetBooleani_v(GLenum target, GLuint index, GLboolean *data) + { + GetBooleani_v = (PFNGETBOOLEANI_VPROC)IntGetProcAddress("glGetBooleani_v"); + GetBooleani_v(target, index, data); + } + + static void CODEGEN_FUNCPTR Switch_GetIntegeri_v(GLenum target, GLuint index, GLint *data) + { + GetIntegeri_v = (PFNGETINTEGERI_VPROC)IntGetProcAddress("glGetIntegeri_v"); + GetIntegeri_v(target, index, data); + } + + static void CODEGEN_FUNCPTR Switch_Enablei(GLenum target, GLuint index) + { + Enablei = (PFNENABLEIPROC)IntGetProcAddress("glEnablei"); + Enablei(target, index); + } + + static void CODEGEN_FUNCPTR Switch_Disablei(GLenum target, GLuint index) + { + Disablei = (PFNDISABLEIPROC)IntGetProcAddress("glDisablei"); + Disablei(target, index); + } + + static GLboolean CODEGEN_FUNCPTR Switch_IsEnabledi(GLenum target, GLuint index) + { + IsEnabledi = (PFNISENABLEDIPROC)IntGetProcAddress("glIsEnabledi"); + return IsEnabledi(target, index); + } + + static void CODEGEN_FUNCPTR Switch_BeginTransformFeedback(GLenum primitiveMode) + { + BeginTransformFeedback = (PFNBEGINTRANSFORMFEEDBACKPROC)IntGetProcAddress("glBeginTransformFeedback"); + BeginTransformFeedback(primitiveMode); + } + + static void CODEGEN_FUNCPTR Switch_EndTransformFeedback() + { + EndTransformFeedback = (PFNENDTRANSFORMFEEDBACKPROC)IntGetProcAddress("glEndTransformFeedback"); + EndTransformFeedback(); + } + + static void CODEGEN_FUNCPTR Switch_BindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) + { + BindBufferRange = (PFNBINDBUFFERRANGEPROC)IntGetProcAddress("glBindBufferRange"); + BindBufferRange(target, index, buffer, offset, size); + } + + static void CODEGEN_FUNCPTR Switch_BindBufferBase(GLenum target, GLuint index, GLuint buffer) + { + BindBufferBase = (PFNBINDBUFFERBASEPROC)IntGetProcAddress("glBindBufferBase"); + BindBufferBase(target, index, buffer); + } + + static void CODEGEN_FUNCPTR Switch_TransformFeedbackVaryings(GLuint program, GLsizei count, const GLchar* const *varyings, GLenum bufferMode) + { + TransformFeedbackVaryings = (PFNTRANSFORMFEEDBACKVARYINGSPROC)IntGetProcAddress("glTransformFeedbackVaryings"); + TransformFeedbackVaryings(program, count, varyings, bufferMode); + } + + static void CODEGEN_FUNCPTR Switch_GetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name) + { + GetTransformFeedbackVarying = (PFNGETTRANSFORMFEEDBACKVARYINGPROC)IntGetProcAddress("glGetTransformFeedbackVarying"); + GetTransformFeedbackVarying(program, index, bufSize, length, size, type, name); + } + + static void CODEGEN_FUNCPTR Switch_ClampColor(GLenum target, GLenum clamp) + { + ClampColor = (PFNCLAMPCOLORPROC)IntGetProcAddress("glClampColor"); + ClampColor(target, clamp); + } + + static void CODEGEN_FUNCPTR Switch_BeginConditionalRender(GLuint id, GLenum mode) + { + BeginConditionalRender = (PFNBEGINCONDITIONALRENDERPROC)IntGetProcAddress("glBeginConditionalRender"); + BeginConditionalRender(id, mode); + } + + static void CODEGEN_FUNCPTR Switch_EndConditionalRender() + { + EndConditionalRender = (PFNENDCONDITIONALRENDERPROC)IntGetProcAddress("glEndConditionalRender"); + EndConditionalRender(); + } + + static void CODEGEN_FUNCPTR Switch_VertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) + { + VertexAttribIPointer = (PFNVERTEXATTRIBIPOINTERPROC)IntGetProcAddress("glVertexAttribIPointer"); + VertexAttribIPointer(index, size, type, stride, pointer); + } + + static void CODEGEN_FUNCPTR Switch_GetVertexAttribIiv(GLuint index, GLenum pname, GLint *params) + { + GetVertexAttribIiv = (PFNGETVERTEXATTRIBIIVPROC)IntGetProcAddress("glGetVertexAttribIiv"); + GetVertexAttribIiv(index, pname, params); + } + + static void CODEGEN_FUNCPTR Switch_GetVertexAttribIuiv(GLuint index, GLenum pname, GLuint *params) + { + GetVertexAttribIuiv = (PFNGETVERTEXATTRIBIUIVPROC)IntGetProcAddress("glGetVertexAttribIuiv"); + GetVertexAttribIuiv(index, pname, params); + } + + static void CODEGEN_FUNCPTR Switch_VertexAttribI1i(GLuint index, GLint x) + { + VertexAttribI1i = (PFNVERTEXATTRIBI1IPROC)IntGetProcAddress("glVertexAttribI1i"); + VertexAttribI1i(index, x); + } + + static void CODEGEN_FUNCPTR Switch_VertexAttribI2i(GLuint index, GLint x, GLint y) + { + VertexAttribI2i = (PFNVERTEXATTRIBI2IPROC)IntGetProcAddress("glVertexAttribI2i"); + VertexAttribI2i(index, x, y); + } + + static void CODEGEN_FUNCPTR Switch_VertexAttribI3i(GLuint index, GLint x, GLint y, GLint z) + { + VertexAttribI3i = (PFNVERTEXATTRIBI3IPROC)IntGetProcAddress("glVertexAttribI3i"); + VertexAttribI3i(index, x, y, z); + } + + static void CODEGEN_FUNCPTR Switch_VertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w) + { + VertexAttribI4i = (PFNVERTEXATTRIBI4IPROC)IntGetProcAddress("glVertexAttribI4i"); + VertexAttribI4i(index, x, y, z, w); + } + + static void CODEGEN_FUNCPTR Switch_VertexAttribI1ui(GLuint index, GLuint x) + { + VertexAttribI1ui = (PFNVERTEXATTRIBI1UIPROC)IntGetProcAddress("glVertexAttribI1ui"); + VertexAttribI1ui(index, x); + } + + static void CODEGEN_FUNCPTR Switch_VertexAttribI2ui(GLuint index, GLuint x, GLuint y) + { + VertexAttribI2ui = (PFNVERTEXATTRIBI2UIPROC)IntGetProcAddress("glVertexAttribI2ui"); + VertexAttribI2ui(index, x, y); + } + + static void CODEGEN_FUNCPTR Switch_VertexAttribI3ui(GLuint index, GLuint x, GLuint y, GLuint z) + { + VertexAttribI3ui = (PFNVERTEXATTRIBI3UIPROC)IntGetProcAddress("glVertexAttribI3ui"); + VertexAttribI3ui(index, x, y, z); + } + + static void CODEGEN_FUNCPTR Switch_VertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) + { + VertexAttribI4ui = (PFNVERTEXATTRIBI4UIPROC)IntGetProcAddress("glVertexAttribI4ui"); + VertexAttribI4ui(index, x, y, z, w); + } + + static void CODEGEN_FUNCPTR Switch_VertexAttribI1iv(GLuint index, const GLint *v) + { + VertexAttribI1iv = (PFNVERTEXATTRIBI1IVPROC)IntGetProcAddress("glVertexAttribI1iv"); + VertexAttribI1iv(index, v); + } + + static void CODEGEN_FUNCPTR Switch_VertexAttribI2iv(GLuint index, const GLint *v) + { + VertexAttribI2iv = (PFNVERTEXATTRIBI2IVPROC)IntGetProcAddress("glVertexAttribI2iv"); + VertexAttribI2iv(index, v); + } + + static void CODEGEN_FUNCPTR Switch_VertexAttribI3iv(GLuint index, const GLint *v) + { + VertexAttribI3iv = (PFNVERTEXATTRIBI3IVPROC)IntGetProcAddress("glVertexAttribI3iv"); + VertexAttribI3iv(index, v); + } + + static void CODEGEN_FUNCPTR Switch_VertexAttribI4iv(GLuint index, const GLint *v) + { + VertexAttribI4iv = (PFNVERTEXATTRIBI4IVPROC)IntGetProcAddress("glVertexAttribI4iv"); + VertexAttribI4iv(index, v); + } + + static void CODEGEN_FUNCPTR Switch_VertexAttribI1uiv(GLuint index, const GLuint *v) + { + VertexAttribI1uiv = (PFNVERTEXATTRIBI1UIVPROC)IntGetProcAddress("glVertexAttribI1uiv"); + VertexAttribI1uiv(index, v); + } + + static void CODEGEN_FUNCPTR Switch_VertexAttribI2uiv(GLuint index, const GLuint *v) + { + VertexAttribI2uiv = (PFNVERTEXATTRIBI2UIVPROC)IntGetProcAddress("glVertexAttribI2uiv"); + VertexAttribI2uiv(index, v); + } + + static void CODEGEN_FUNCPTR Switch_VertexAttribI3uiv(GLuint index, const GLuint *v) + { + VertexAttribI3uiv = (PFNVERTEXATTRIBI3UIVPROC)IntGetProcAddress("glVertexAttribI3uiv"); + VertexAttribI3uiv(index, v); + } + + static void CODEGEN_FUNCPTR Switch_VertexAttribI4uiv(GLuint index, const GLuint *v) + { + VertexAttribI4uiv = (PFNVERTEXATTRIBI4UIVPROC)IntGetProcAddress("glVertexAttribI4uiv"); + VertexAttribI4uiv(index, v); + } + + static void CODEGEN_FUNCPTR Switch_VertexAttribI4bv(GLuint index, const GLbyte *v) + { + VertexAttribI4bv = (PFNVERTEXATTRIBI4BVPROC)IntGetProcAddress("glVertexAttribI4bv"); + VertexAttribI4bv(index, v); + } + + static void CODEGEN_FUNCPTR Switch_VertexAttribI4sv(GLuint index, const GLshort *v) + { + VertexAttribI4sv = (PFNVERTEXATTRIBI4SVPROC)IntGetProcAddress("glVertexAttribI4sv"); + VertexAttribI4sv(index, v); + } + + static void CODEGEN_FUNCPTR Switch_VertexAttribI4ubv(GLuint index, const GLubyte *v) + { + VertexAttribI4ubv = (PFNVERTEXATTRIBI4UBVPROC)IntGetProcAddress("glVertexAttribI4ubv"); + VertexAttribI4ubv(index, v); + } + + static void CODEGEN_FUNCPTR Switch_VertexAttribI4usv(GLuint index, const GLushort *v) + { + VertexAttribI4usv = (PFNVERTEXATTRIBI4USVPROC)IntGetProcAddress("glVertexAttribI4usv"); + VertexAttribI4usv(index, v); + } + + static void CODEGEN_FUNCPTR Switch_GetUniformuiv(GLuint program, GLint location, GLuint *params) + { + GetUniformuiv = (PFNGETUNIFORMUIVPROC)IntGetProcAddress("glGetUniformuiv"); + GetUniformuiv(program, location, params); + } + + static void CODEGEN_FUNCPTR Switch_BindFragDataLocation(GLuint program, GLuint color, const GLchar *name) + { + BindFragDataLocation = (PFNBINDFRAGDATALOCATIONPROC)IntGetProcAddress("glBindFragDataLocation"); + BindFragDataLocation(program, color, name); + } + + static GLint CODEGEN_FUNCPTR Switch_GetFragDataLocation(GLuint program, const GLchar *name) + { + GetFragDataLocation = (PFNGETFRAGDATALOCATIONPROC)IntGetProcAddress("glGetFragDataLocation"); + return GetFragDataLocation(program, name); + } + + static void CODEGEN_FUNCPTR Switch_Uniform1ui(GLint location, GLuint v0) + { + Uniform1ui = (PFNUNIFORM1UIPROC)IntGetProcAddress("glUniform1ui"); + Uniform1ui(location, v0); + } + + static void CODEGEN_FUNCPTR Switch_Uniform2ui(GLint location, GLuint v0, GLuint v1) + { + Uniform2ui = (PFNUNIFORM2UIPROC)IntGetProcAddress("glUniform2ui"); + Uniform2ui(location, v0, v1); + } + + static void CODEGEN_FUNCPTR Switch_Uniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2) + { + Uniform3ui = (PFNUNIFORM3UIPROC)IntGetProcAddress("glUniform3ui"); + Uniform3ui(location, v0, v1, v2); + } + + static void CODEGEN_FUNCPTR Switch_Uniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) + { + Uniform4ui = (PFNUNIFORM4UIPROC)IntGetProcAddress("glUniform4ui"); + Uniform4ui(location, v0, v1, v2, v3); + } + + static void CODEGEN_FUNCPTR Switch_Uniform1uiv(GLint location, GLsizei count, const GLuint *value) + { + Uniform1uiv = (PFNUNIFORM1UIVPROC)IntGetProcAddress("glUniform1uiv"); + Uniform1uiv(location, count, value); + } + + static void CODEGEN_FUNCPTR Switch_Uniform2uiv(GLint location, GLsizei count, const GLuint *value) + { + Uniform2uiv = (PFNUNIFORM2UIVPROC)IntGetProcAddress("glUniform2uiv"); + Uniform2uiv(location, count, value); + } + + static void CODEGEN_FUNCPTR Switch_Uniform3uiv(GLint location, GLsizei count, const GLuint *value) + { + Uniform3uiv = (PFNUNIFORM3UIVPROC)IntGetProcAddress("glUniform3uiv"); + Uniform3uiv(location, count, value); + } + + static void CODEGEN_FUNCPTR Switch_Uniform4uiv(GLint location, GLsizei count, const GLuint *value) + { + Uniform4uiv = (PFNUNIFORM4UIVPROC)IntGetProcAddress("glUniform4uiv"); + Uniform4uiv(location, count, value); + } + + static void CODEGEN_FUNCPTR Switch_TexParameterIiv(GLenum target, GLenum pname, const GLint *params) + { + TexParameterIiv = (PFNTEXPARAMETERIIVPROC)IntGetProcAddress("glTexParameterIiv"); + TexParameterIiv(target, pname, params); + } + + static void CODEGEN_FUNCPTR Switch_TexParameterIuiv(GLenum target, GLenum pname, const GLuint *params) + { + TexParameterIuiv = (PFNTEXPARAMETERIUIVPROC)IntGetProcAddress("glTexParameterIuiv"); + TexParameterIuiv(target, pname, params); + } + + static void CODEGEN_FUNCPTR Switch_GetTexParameterIiv(GLenum target, GLenum pname, GLint *params) + { + GetTexParameterIiv = (PFNGETTEXPARAMETERIIVPROC)IntGetProcAddress("glGetTexParameterIiv"); + GetTexParameterIiv(target, pname, params); + } + + static void CODEGEN_FUNCPTR Switch_GetTexParameterIuiv(GLenum target, GLenum pname, GLuint *params) + { + GetTexParameterIuiv = (PFNGETTEXPARAMETERIUIVPROC)IntGetProcAddress("glGetTexParameterIuiv"); + GetTexParameterIuiv(target, pname, params); + } + + static void CODEGEN_FUNCPTR Switch_ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *value) + { + ClearBufferiv = (PFNCLEARBUFFERIVPROC)IntGetProcAddress("glClearBufferiv"); + ClearBufferiv(buffer, drawbuffer, value); + } + + static void CODEGEN_FUNCPTR Switch_ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint *value) + { + ClearBufferuiv = (PFNCLEARBUFFERUIVPROC)IntGetProcAddress("glClearBufferuiv"); + ClearBufferuiv(buffer, drawbuffer, value); + } + + static void CODEGEN_FUNCPTR Switch_ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *value) + { + ClearBufferfv = (PFNCLEARBUFFERFVPROC)IntGetProcAddress("glClearBufferfv"); + ClearBufferfv(buffer, drawbuffer, value); + } + + static void CODEGEN_FUNCPTR Switch_ClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil) + { + ClearBufferfi = (PFNCLEARBUFFERFIPROC)IntGetProcAddress("glClearBufferfi"); + ClearBufferfi(buffer, drawbuffer, depth, stencil); + } + + static const GLubyte * CODEGEN_FUNCPTR Switch_GetStringi(GLenum name, GLuint index) + { + GetStringi = (PFNGETSTRINGIPROC)IntGetProcAddress("glGetStringi"); + return GetStringi(name, index); + } + + // Extension: ARB_uniform_buffer_object + + static void CODEGEN_FUNCPTR Switch_GetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar* const *uniformNames, GLuint *uniformIndices) + { + GetUniformIndices = (PFNGETUNIFORMINDICESPROC)IntGetProcAddress("glGetUniformIndices"); + GetUniformIndices(program, uniformCount, uniformNames, uniformIndices); + } + + static void CODEGEN_FUNCPTR Switch_GetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params) + { + GetActiveUniformsiv = (PFNGETACTIVEUNIFORMSIVPROC)IntGetProcAddress("glGetActiveUniformsiv"); + GetActiveUniformsiv(program, uniformCount, uniformIndices, pname, params); + } + + static void CODEGEN_FUNCPTR Switch_GetActiveUniformName(GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName) + { + GetActiveUniformName = (PFNGETACTIVEUNIFORMNAMEPROC)IntGetProcAddress("glGetActiveUniformName"); + GetActiveUniformName(program, uniformIndex, bufSize, length, uniformName); + } + + static GLuint CODEGEN_FUNCPTR Switch_GetUniformBlockIndex(GLuint program, const GLchar *uniformBlockName) + { + GetUniformBlockIndex = (PFNGETUNIFORMBLOCKINDEXPROC)IntGetProcAddress("glGetUniformBlockIndex"); + return GetUniformBlockIndex(program, uniformBlockName); + } + + static void CODEGEN_FUNCPTR Switch_GetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params) + { + GetActiveUniformBlockiv = (PFNGETACTIVEUNIFORMBLOCKIVPROC)IntGetProcAddress("glGetActiveUniformBlockiv"); + GetActiveUniformBlockiv(program, uniformBlockIndex, pname, params); + } + + static void CODEGEN_FUNCPTR Switch_GetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName) + { + GetActiveUniformBlockName = (PFNGETACTIVEUNIFORMBLOCKNAMEPROC)IntGetProcAddress("glGetActiveUniformBlockName"); + GetActiveUniformBlockName(program, uniformBlockIndex, bufSize, length, uniformBlockName); + } + + static void CODEGEN_FUNCPTR Switch_UniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding) + { + UniformBlockBinding = (PFNUNIFORMBLOCKBINDINGPROC)IntGetProcAddress("glUniformBlockBinding"); + UniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding); + } + + // Extension: ARB_copy_buffer + + static void CODEGEN_FUNCPTR Switch_CopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size) + { + CopyBufferSubData = (PFNCOPYBUFFERSUBDATAPROC)IntGetProcAddress("glCopyBufferSubData"); + CopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size); + } + + // Extension: 3.1 + + static void CODEGEN_FUNCPTR Switch_DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instancecount) + { + DrawArraysInstanced = (PFNDRAWARRAYSINSTANCEDPROC)IntGetProcAddress("glDrawArraysInstanced"); + DrawArraysInstanced(mode, first, count, instancecount); + } + + static void CODEGEN_FUNCPTR Switch_DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount) + { + DrawElementsInstanced = (PFNDRAWELEMENTSINSTANCEDPROC)IntGetProcAddress("glDrawElementsInstanced"); + DrawElementsInstanced(mode, count, type, indices, instancecount); + } + + static void CODEGEN_FUNCPTR Switch_TexBuffer(GLenum target, GLenum internalformat, GLuint buffer) + { + TexBuffer = (PFNTEXBUFFERPROC)IntGetProcAddress("glTexBuffer"); + TexBuffer(target, internalformat, buffer); + } + + static void CODEGEN_FUNCPTR Switch_PrimitiveRestartIndex(GLuint index) + { + PrimitiveRestartIndex = (PFNPRIMITIVERESTARTINDEXPROC)IntGetProcAddress("glPrimitiveRestartIndex"); + PrimitiveRestartIndex(index); + } + + // Legacy + + static void CODEGEN_FUNCPTR Switch_EnableClientState(GLenum cap) + { + EnableClientState = (PFNENABLECLIENTSTATEPROC)IntGetProcAddress("glEnableClientState"); + EnableClientState(cap); + } + + static void CODEGEN_FUNCPTR Switch_DisableClientState(GLenum cap) + { + DisableClientState = (PFNDISABLECLIENTSTATEPROC)IntGetProcAddress("glDisableClientState"); + DisableClientState(cap); + } + + static void CODEGEN_FUNCPTR Switch_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) + { + VertexPointer = (PFNVERTEXPOINTERPROC)IntGetProcAddress("glVertexPointer"); + VertexPointer(size, type, stride, ptr); + } + + static void CODEGEN_FUNCPTR Switch_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr) + { + NormalPointer = (PFNNORMALPOINTERPROC)IntGetProcAddress("glNormalPointer"); + NormalPointer(type, stride, ptr); + } + + static void CODEGEN_FUNCPTR Switch_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) + { + ColorPointer = (PFNCOLORPOINTERPROC)IntGetProcAddress("glColorPointer"); + ColorPointer(size, type, stride, ptr); + } + + static void CODEGEN_FUNCPTR Switch_TexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) + { + TexCoordPointer = (PFNTEXCOORDPOINTERPROC)IntGetProcAddress("glTexCoordPointer"); + TexCoordPointer(size, type, stride, ptr); + } + + static void CODEGEN_FUNCPTR Switch_TexEnvi(GLenum target, GLenum pname, GLint param) + { + TexEnvi = (PFNTEXENVIPROC)IntGetProcAddress("glTexEnvi"); + TexEnvi(target, pname, param); + } + + static void CODEGEN_FUNCPTR Switch_MatrixMode(GLenum mode) + { + MatrixMode = (PFNMATRIXMODEPROC)IntGetProcAddress("glMatrixMode"); + MatrixMode(mode); + } + + static void CODEGEN_FUNCPTR Switch_LoadIdentity(void) + { + LoadIdentity = (PFNLOADIDENTITYPROC)IntGetProcAddress("glLoadIdentity"); + LoadIdentity(); + } + + static void CODEGEN_FUNCPTR Switch_Ortho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val) + { + Ortho = (PFNORTHOPROC)IntGetProcAddress("glOrtho"); + Ortho(left, right, bottom, top, near_val, far_val); + } + + static void CODEGEN_FUNCPTR Switch_Color3d(GLdouble red, GLdouble green, GLdouble blue) + { + Color3d = (PFNCOLOR3DPROC)IntGetProcAddress("glColor3d"); + Color3d(red, green, blue); + } + struct InitializeVariables { - InitializeVariables() - { - // Extension: 1.1 - CullFace = Switch_CullFace; - FrontFace = Switch_FrontFace; - Hint = Switch_Hint; - LineWidth = Switch_LineWidth; - PointSize = Switch_PointSize; - PolygonMode = Switch_PolygonMode; - Scissor = Switch_Scissor; - TexParameterf = Switch_TexParameterf; - TexParameterfv = Switch_TexParameterfv; - TexParameteri = Switch_TexParameteri; - TexParameteriv = Switch_TexParameteriv; - TexImage1D = Switch_TexImage1D; - TexImage2D = Switch_TexImage2D; - DrawBuffer = Switch_DrawBuffer; - Clear = Switch_Clear; - ClearColor = Switch_ClearColor; - ClearStencil = Switch_ClearStencil; - ClearDepth = Switch_ClearDepth; - StencilMask = Switch_StencilMask; - ColorMask = Switch_ColorMask; - DepthMask = Switch_DepthMask; - Disable = Switch_Disable; - Enable = Switch_Enable; - Finish = Switch_Finish; - Flush = Switch_Flush; - BlendFunc = Switch_BlendFunc; - LogicOp = Switch_LogicOp; - StencilFunc = Switch_StencilFunc; - StencilOp = Switch_StencilOp; - DepthFunc = Switch_DepthFunc; - PixelStoref = Switch_PixelStoref; - PixelStorei = Switch_PixelStorei; - ReadBuffer = Switch_ReadBuffer; - ReadPixels = Switch_ReadPixels; - GetBooleanv = Switch_GetBooleanv; - GetDoublev = Switch_GetDoublev; - GetError = Switch_GetError; - GetFloatv = Switch_GetFloatv; - GetIntegerv = Switch_GetIntegerv; - GetString = Switch_GetString; - GetTexImage = Switch_GetTexImage; - GetTexParameterfv = Switch_GetTexParameterfv; - GetTexParameteriv = Switch_GetTexParameteriv; - GetTexLevelParameterfv = Switch_GetTexLevelParameterfv; - GetTexLevelParameteriv = Switch_GetTexLevelParameteriv; - IsEnabled = Switch_IsEnabled; - DepthRange = Switch_DepthRange; - Viewport = Switch_Viewport; - DrawArrays = Switch_DrawArrays; - DrawElements = Switch_DrawElements; - GetPointerv = Switch_GetPointerv; - PolygonOffset = Switch_PolygonOffset; - CopyTexImage1D = Switch_CopyTexImage1D; - CopyTexImage2D = Switch_CopyTexImage2D; - CopyTexSubImage1D = Switch_CopyTexSubImage1D; - CopyTexSubImage2D = Switch_CopyTexSubImage2D; - TexSubImage1D = Switch_TexSubImage1D; - TexSubImage2D = Switch_TexSubImage2D; - BindTexture = Switch_BindTexture; - DeleteTextures = Switch_DeleteTextures; - GenTextures = Switch_GenTextures; - IsTexture = Switch_IsTexture; - Indexub = Switch_Indexub; - Indexubv = Switch_Indexubv; + InitializeVariables() + { + // Extension: 1.1 + CullFace = Switch_CullFace; + FrontFace = Switch_FrontFace; + Hint = Switch_Hint; + LineWidth = Switch_LineWidth; + PointSize = Switch_PointSize; + PolygonMode = Switch_PolygonMode; + Scissor = Switch_Scissor; + TexParameterf = Switch_TexParameterf; + TexParameterfv = Switch_TexParameterfv; + TexParameteri = Switch_TexParameteri; + TexParameteriv = Switch_TexParameteriv; + TexImage1D = Switch_TexImage1D; + TexImage2D = Switch_TexImage2D; + DrawBuffer = Switch_DrawBuffer; + Clear = Switch_Clear; + ClearColor = Switch_ClearColor; + ClearStencil = Switch_ClearStencil; + ClearDepth = Switch_ClearDepth; + StencilMask = Switch_StencilMask; + ColorMask = Switch_ColorMask; + DepthMask = Switch_DepthMask; + Disable = Switch_Disable; + Enable = Switch_Enable; + Finish = Switch_Finish; + Flush = Switch_Flush; + BlendFunc = Switch_BlendFunc; + LogicOp = Switch_LogicOp; + StencilFunc = Switch_StencilFunc; + StencilOp = Switch_StencilOp; + DepthFunc = Switch_DepthFunc; + PixelStoref = Switch_PixelStoref; + PixelStorei = Switch_PixelStorei; + ReadBuffer = Switch_ReadBuffer; + ReadPixels = Switch_ReadPixels; + GetBooleanv = Switch_GetBooleanv; + GetDoublev = Switch_GetDoublev; + GetError = Switch_GetError; + GetFloatv = Switch_GetFloatv; + GetIntegerv = Switch_GetIntegerv; + GetString = Switch_GetString; + GetTexImage = Switch_GetTexImage; + GetTexParameterfv = Switch_GetTexParameterfv; + GetTexParameteriv = Switch_GetTexParameteriv; + GetTexLevelParameterfv = Switch_GetTexLevelParameterfv; + GetTexLevelParameteriv = Switch_GetTexLevelParameteriv; + IsEnabled = Switch_IsEnabled; + DepthRange = Switch_DepthRange; + Viewport = Switch_Viewport; + DrawArrays = Switch_DrawArrays; + DrawElements = Switch_DrawElements; + GetPointerv = Switch_GetPointerv; + PolygonOffset = Switch_PolygonOffset; + CopyTexImage1D = Switch_CopyTexImage1D; + CopyTexImage2D = Switch_CopyTexImage2D; + CopyTexSubImage1D = Switch_CopyTexSubImage1D; + CopyTexSubImage2D = Switch_CopyTexSubImage2D; + TexSubImage1D = Switch_TexSubImage1D; + TexSubImage2D = Switch_TexSubImage2D; + BindTexture = Switch_BindTexture; + DeleteTextures = Switch_DeleteTextures; + GenTextures = Switch_GenTextures; + IsTexture = Switch_IsTexture; + Indexub = Switch_Indexub; + Indexubv = Switch_Indexubv; - // Extension: 1.2 - BlendColor = Switch_BlendColor; - BlendEquation = Switch_BlendEquation; - DrawRangeElements = Switch_DrawRangeElements; - TexSubImage3D = Switch_TexSubImage3D; - CopyTexSubImage3D = Switch_CopyTexSubImage3D; + // Extension: 1.2 + BlendColor = Switch_BlendColor; + BlendEquation = Switch_BlendEquation; + DrawRangeElements = Switch_DrawRangeElements; + TexSubImage3D = Switch_TexSubImage3D; + CopyTexSubImage3D = Switch_CopyTexSubImage3D; - // Extension: 1.3 - ActiveTexture = Switch_ActiveTexture; - SampleCoverage = Switch_SampleCoverage; - CompressedTexImage3D = Switch_CompressedTexImage3D; - CompressedTexImage2D = Switch_CompressedTexImage2D; - CompressedTexImage1D = Switch_CompressedTexImage1D; - CompressedTexSubImage3D = Switch_CompressedTexSubImage3D; - CompressedTexSubImage2D = Switch_CompressedTexSubImage2D; - CompressedTexSubImage1D = Switch_CompressedTexSubImage1D; - GetCompressedTexImage = Switch_GetCompressedTexImage; + // Extension: 1.3 + ActiveTexture = Switch_ActiveTexture; + SampleCoverage = Switch_SampleCoverage; + CompressedTexImage3D = Switch_CompressedTexImage3D; + CompressedTexImage2D = Switch_CompressedTexImage2D; + CompressedTexImage1D = Switch_CompressedTexImage1D; + CompressedTexSubImage3D = Switch_CompressedTexSubImage3D; + CompressedTexSubImage2D = Switch_CompressedTexSubImage2D; + CompressedTexSubImage1D = Switch_CompressedTexSubImage1D; + GetCompressedTexImage = Switch_GetCompressedTexImage; - // Extension: 1.4 - BlendFuncSeparate = Switch_BlendFuncSeparate; - MultiDrawArrays = Switch_MultiDrawArrays; - MultiDrawElements = Switch_MultiDrawElements; - PointParameterf = Switch_PointParameterf; - PointParameterfv = Switch_PointParameterfv; - PointParameteri = Switch_PointParameteri; - PointParameteriv = Switch_PointParameteriv; + // Extension: 1.4 + BlendFuncSeparate = Switch_BlendFuncSeparate; + MultiDrawArrays = Switch_MultiDrawArrays; + MultiDrawElements = Switch_MultiDrawElements; + PointParameterf = Switch_PointParameterf; + PointParameterfv = Switch_PointParameterfv; + PointParameteri = Switch_PointParameteri; + PointParameteriv = Switch_PointParameteriv; - // Extension: 1.5 - GenQueries = Switch_GenQueries; - DeleteQueries = Switch_DeleteQueries; - IsQuery = Switch_IsQuery; - BeginQuery = Switch_BeginQuery; - EndQuery = Switch_EndQuery; - GetQueryiv = Switch_GetQueryiv; - GetQueryObjectiv = Switch_GetQueryObjectiv; - GetQueryObjectuiv = Switch_GetQueryObjectuiv; - BindBuffer = Switch_BindBuffer; - DeleteBuffers = Switch_DeleteBuffers; - GenBuffers = Switch_GenBuffers; - IsBuffer = Switch_IsBuffer; - BufferData = Switch_BufferData; - BufferSubData = Switch_BufferSubData; - GetBufferSubData = Switch_GetBufferSubData; - MapBuffer = Switch_MapBuffer; - UnmapBuffer = Switch_UnmapBuffer; - GetBufferParameteriv = Switch_GetBufferParameteriv; - GetBufferPointerv = Switch_GetBufferPointerv; + // Extension: 1.5 + GenQueries = Switch_GenQueries; + DeleteQueries = Switch_DeleteQueries; + IsQuery = Switch_IsQuery; + BeginQuery = Switch_BeginQuery; + EndQuery = Switch_EndQuery; + GetQueryiv = Switch_GetQueryiv; + GetQueryObjectiv = Switch_GetQueryObjectiv; + GetQueryObjectuiv = Switch_GetQueryObjectuiv; + BindBuffer = Switch_BindBuffer; + DeleteBuffers = Switch_DeleteBuffers; + GenBuffers = Switch_GenBuffers; + IsBuffer = Switch_IsBuffer; + BufferData = Switch_BufferData; + BufferSubData = Switch_BufferSubData; + GetBufferSubData = Switch_GetBufferSubData; + MapBuffer = Switch_MapBuffer; + UnmapBuffer = Switch_UnmapBuffer; + GetBufferParameteriv = Switch_GetBufferParameteriv; + GetBufferPointerv = Switch_GetBufferPointerv; - // Extension: 2.0 - BlendEquationSeparate = Switch_BlendEquationSeparate; - DrawBuffers = Switch_DrawBuffers; - StencilOpSeparate = Switch_StencilOpSeparate; - StencilFuncSeparate = Switch_StencilFuncSeparate; - StencilMaskSeparate = Switch_StencilMaskSeparate; - AttachShader = Switch_AttachShader; - BindAttribLocation = Switch_BindAttribLocation; - CompileShader = Switch_CompileShader; - CreateProgram = Switch_CreateProgram; - CreateShader = Switch_CreateShader; - DeleteProgram = Switch_DeleteProgram; - DeleteShader = Switch_DeleteShader; - DetachShader = Switch_DetachShader; - DisableVertexAttribArray = Switch_DisableVertexAttribArray; - EnableVertexAttribArray = Switch_EnableVertexAttribArray; - GetActiveAttrib = Switch_GetActiveAttrib; - GetActiveUniform = Switch_GetActiveUniform; - GetAttachedShaders = Switch_GetAttachedShaders; - GetAttribLocation = Switch_GetAttribLocation; - GetProgramiv = Switch_GetProgramiv; - GetProgramInfoLog = Switch_GetProgramInfoLog; - GetShaderiv = Switch_GetShaderiv; - GetShaderInfoLog = Switch_GetShaderInfoLog; - GetShaderSource = Switch_GetShaderSource; - GetUniformLocation = Switch_GetUniformLocation; - GetUniformfv = Switch_GetUniformfv; - GetUniformiv = Switch_GetUniformiv; - GetVertexAttribdv = Switch_GetVertexAttribdv; - GetVertexAttribfv = Switch_GetVertexAttribfv; - GetVertexAttribiv = Switch_GetVertexAttribiv; - GetVertexAttribPointerv = Switch_GetVertexAttribPointerv; - IsProgram = Switch_IsProgram; - IsShader = Switch_IsShader; - LinkProgram = Switch_LinkProgram; - ShaderSource = Switch_ShaderSource; - UseProgram = Switch_UseProgram; - Uniform1f = Switch_Uniform1f; - Uniform2f = Switch_Uniform2f; - Uniform3f = Switch_Uniform3f; - Uniform4f = Switch_Uniform4f; - Uniform1i = Switch_Uniform1i; - Uniform2i = Switch_Uniform2i; - Uniform3i = Switch_Uniform3i; - Uniform4i = Switch_Uniform4i; - Uniform1fv = Switch_Uniform1fv; - Uniform2fv = Switch_Uniform2fv; - Uniform3fv = Switch_Uniform3fv; - Uniform4fv = Switch_Uniform4fv; - Uniform1iv = Switch_Uniform1iv; - Uniform2iv = Switch_Uniform2iv; - Uniform3iv = Switch_Uniform3iv; - Uniform4iv = Switch_Uniform4iv; - UniformMatrix2fv = Switch_UniformMatrix2fv; - UniformMatrix3fv = Switch_UniformMatrix3fv; - UniformMatrix4fv = Switch_UniformMatrix4fv; - ValidateProgram = Switch_ValidateProgram; - VertexAttribPointer = Switch_VertexAttribPointer; + // Extension: 2.0 + BlendEquationSeparate = Switch_BlendEquationSeparate; + DrawBuffers = Switch_DrawBuffers; + StencilOpSeparate = Switch_StencilOpSeparate; + StencilFuncSeparate = Switch_StencilFuncSeparate; + StencilMaskSeparate = Switch_StencilMaskSeparate; + AttachShader = Switch_AttachShader; + BindAttribLocation = Switch_BindAttribLocation; + CompileShader = Switch_CompileShader; + CreateProgram = Switch_CreateProgram; + CreateShader = Switch_CreateShader; + DeleteProgram = Switch_DeleteProgram; + DeleteShader = Switch_DeleteShader; + DetachShader = Switch_DetachShader; + DisableVertexAttribArray = Switch_DisableVertexAttribArray; + EnableVertexAttribArray = Switch_EnableVertexAttribArray; + GetActiveAttrib = Switch_GetActiveAttrib; + GetActiveUniform = Switch_GetActiveUniform; + GetAttachedShaders = Switch_GetAttachedShaders; + GetAttribLocation = Switch_GetAttribLocation; + GetProgramiv = Switch_GetProgramiv; + GetProgramInfoLog = Switch_GetProgramInfoLog; + GetShaderiv = Switch_GetShaderiv; + GetShaderInfoLog = Switch_GetShaderInfoLog; + GetShaderSource = Switch_GetShaderSource; + GetUniformLocation = Switch_GetUniformLocation; + GetUniformfv = Switch_GetUniformfv; + GetUniformiv = Switch_GetUniformiv; + GetVertexAttribdv = Switch_GetVertexAttribdv; + GetVertexAttribfv = Switch_GetVertexAttribfv; + GetVertexAttribiv = Switch_GetVertexAttribiv; + GetVertexAttribPointerv = Switch_GetVertexAttribPointerv; + IsProgram = Switch_IsProgram; + IsShader = Switch_IsShader; + LinkProgram = Switch_LinkProgram; + ShaderSource = Switch_ShaderSource; + UseProgram = Switch_UseProgram; + Uniform1f = Switch_Uniform1f; + Uniform2f = Switch_Uniform2f; + Uniform3f = Switch_Uniform3f; + Uniform4f = Switch_Uniform4f; + Uniform1i = Switch_Uniform1i; + Uniform2i = Switch_Uniform2i; + Uniform3i = Switch_Uniform3i; + Uniform4i = Switch_Uniform4i; + Uniform1fv = Switch_Uniform1fv; + Uniform2fv = Switch_Uniform2fv; + Uniform3fv = Switch_Uniform3fv; + Uniform4fv = Switch_Uniform4fv; + Uniform1iv = Switch_Uniform1iv; + Uniform2iv = Switch_Uniform2iv; + Uniform3iv = Switch_Uniform3iv; + Uniform4iv = Switch_Uniform4iv; + UniformMatrix2fv = Switch_UniformMatrix2fv; + UniformMatrix3fv = Switch_UniformMatrix3fv; + UniformMatrix4fv = Switch_UniformMatrix4fv; + ValidateProgram = Switch_ValidateProgram; + VertexAttribPointer = Switch_VertexAttribPointer; - // Extension: 2.1 - UniformMatrix2x3fv = Switch_UniformMatrix2x3fv; - UniformMatrix3x2fv = Switch_UniformMatrix3x2fv; - UniformMatrix2x4fv = Switch_UniformMatrix2x4fv; - UniformMatrix4x2fv = Switch_UniformMatrix4x2fv; - UniformMatrix3x4fv = Switch_UniformMatrix3x4fv; - UniformMatrix4x3fv = Switch_UniformMatrix4x3fv; + // Extension: 2.1 + UniformMatrix2x3fv = Switch_UniformMatrix2x3fv; + UniformMatrix3x2fv = Switch_UniformMatrix3x2fv; + UniformMatrix2x4fv = Switch_UniformMatrix2x4fv; + UniformMatrix4x2fv = Switch_UniformMatrix4x2fv; + UniformMatrix3x4fv = Switch_UniformMatrix3x4fv; + UniformMatrix4x3fv = Switch_UniformMatrix4x3fv; - // Extension: ARB_vertex_array_object - BindVertexArray = Switch_BindVertexArray; - DeleteVertexArrays = Switch_DeleteVertexArrays; - GenVertexArrays = Switch_GenVertexArrays; - IsVertexArray = Switch_IsVertexArray; + // Extension: ARB_vertex_array_object + BindVertexArray = Switch_BindVertexArray; + DeleteVertexArrays = Switch_DeleteVertexArrays; + GenVertexArrays = Switch_GenVertexArrays; + IsVertexArray = Switch_IsVertexArray; - // Extension: ARB_map_buffer_range - MapBufferRange = Switch_MapBufferRange; - FlushMappedBufferRange = Switch_FlushMappedBufferRange; + // Extension: ARB_map_buffer_range + MapBufferRange = Switch_MapBufferRange; + FlushMappedBufferRange = Switch_FlushMappedBufferRange; - // Extension: ARB_framebuffer_object - IsRenderbuffer = Switch_IsRenderbuffer; - BindRenderbuffer = Switch_BindRenderbuffer; - DeleteRenderbuffers = Switch_DeleteRenderbuffers; - GenRenderbuffers = Switch_GenRenderbuffers; - RenderbufferStorage = Switch_RenderbufferStorage; - GetRenderbufferParameteriv = Switch_GetRenderbufferParameteriv; - IsFramebuffer = Switch_IsFramebuffer; - BindFramebuffer = Switch_BindFramebuffer; - DeleteFramebuffers = Switch_DeleteFramebuffers; - GenFramebuffers = Switch_GenFramebuffers; - CheckFramebufferStatus = Switch_CheckFramebufferStatus; - FramebufferTexture1D = Switch_FramebufferTexture1D; - FramebufferTexture2D = Switch_FramebufferTexture2D; - FramebufferTexture3D = Switch_FramebufferTexture3D; - FramebufferRenderbuffer = Switch_FramebufferRenderbuffer; - GetFramebufferAttachmentParameteriv = Switch_GetFramebufferAttachmentParameteriv; - GenerateMipmap = Switch_GenerateMipmap; - BlitFramebuffer = Switch_BlitFramebuffer; - RenderbufferStorageMultisample = Switch_RenderbufferStorageMultisample; - FramebufferTextureLayer = Switch_FramebufferTextureLayer; + // Extension: ARB_framebuffer_object + IsRenderbuffer = Switch_IsRenderbuffer; + BindRenderbuffer = Switch_BindRenderbuffer; + DeleteRenderbuffers = Switch_DeleteRenderbuffers; + GenRenderbuffers = Switch_GenRenderbuffers; + RenderbufferStorage = Switch_RenderbufferStorage; + GetRenderbufferParameteriv = Switch_GetRenderbufferParameteriv; + IsFramebuffer = Switch_IsFramebuffer; + BindFramebuffer = Switch_BindFramebuffer; + DeleteFramebuffers = Switch_DeleteFramebuffers; + GenFramebuffers = Switch_GenFramebuffers; + CheckFramebufferStatus = Switch_CheckFramebufferStatus; + FramebufferTexture1D = Switch_FramebufferTexture1D; + FramebufferTexture2D = Switch_FramebufferTexture2D; + FramebufferTexture3D = Switch_FramebufferTexture3D; + FramebufferRenderbuffer = Switch_FramebufferRenderbuffer; + GetFramebufferAttachmentParameteriv = Switch_GetFramebufferAttachmentParameteriv; + GenerateMipmap = Switch_GenerateMipmap; + BlitFramebuffer = Switch_BlitFramebuffer; + RenderbufferStorageMultisample = Switch_RenderbufferStorageMultisample; + FramebufferTextureLayer = Switch_FramebufferTextureLayer; - // Extension: 3.0 - ColorMaski = Switch_ColorMaski; - GetBooleani_v = Switch_GetBooleani_v; - GetIntegeri_v = Switch_GetIntegeri_v; - Enablei = Switch_Enablei; - Disablei = Switch_Disablei; - IsEnabledi = Switch_IsEnabledi; - BeginTransformFeedback = Switch_BeginTransformFeedback; - EndTransformFeedback = Switch_EndTransformFeedback; - BindBufferRange = Switch_BindBufferRange; - BindBufferBase = Switch_BindBufferBase; - TransformFeedbackVaryings = Switch_TransformFeedbackVaryings; - GetTransformFeedbackVarying = Switch_GetTransformFeedbackVarying; - ClampColor = Switch_ClampColor; - BeginConditionalRender = Switch_BeginConditionalRender; - EndConditionalRender = Switch_EndConditionalRender; - VertexAttribIPointer = Switch_VertexAttribIPointer; - GetVertexAttribIiv = Switch_GetVertexAttribIiv; - GetVertexAttribIuiv = Switch_GetVertexAttribIuiv; - VertexAttribI1i = Switch_VertexAttribI1i; - VertexAttribI2i = Switch_VertexAttribI2i; - VertexAttribI3i = Switch_VertexAttribI3i; - VertexAttribI4i = Switch_VertexAttribI4i; - VertexAttribI1ui = Switch_VertexAttribI1ui; - VertexAttribI2ui = Switch_VertexAttribI2ui; - VertexAttribI3ui = Switch_VertexAttribI3ui; - VertexAttribI4ui = Switch_VertexAttribI4ui; - VertexAttribI1iv = Switch_VertexAttribI1iv; - VertexAttribI2iv = Switch_VertexAttribI2iv; - VertexAttribI3iv = Switch_VertexAttribI3iv; - VertexAttribI4iv = Switch_VertexAttribI4iv; - VertexAttribI1uiv = Switch_VertexAttribI1uiv; - VertexAttribI2uiv = Switch_VertexAttribI2uiv; - VertexAttribI3uiv = Switch_VertexAttribI3uiv; - VertexAttribI4uiv = Switch_VertexAttribI4uiv; - VertexAttribI4bv = Switch_VertexAttribI4bv; - VertexAttribI4sv = Switch_VertexAttribI4sv; - VertexAttribI4ubv = Switch_VertexAttribI4ubv; - VertexAttribI4usv = Switch_VertexAttribI4usv; - GetUniformuiv = Switch_GetUniformuiv; - BindFragDataLocation = Switch_BindFragDataLocation; - GetFragDataLocation = Switch_GetFragDataLocation; - Uniform1ui = Switch_Uniform1ui; - Uniform2ui = Switch_Uniform2ui; - Uniform3ui = Switch_Uniform3ui; - Uniform4ui = Switch_Uniform4ui; - Uniform1uiv = Switch_Uniform1uiv; - Uniform2uiv = Switch_Uniform2uiv; - Uniform3uiv = Switch_Uniform3uiv; - Uniform4uiv = Switch_Uniform4uiv; - TexParameterIiv = Switch_TexParameterIiv; - TexParameterIuiv = Switch_TexParameterIuiv; - GetTexParameterIiv = Switch_GetTexParameterIiv; - GetTexParameterIuiv = Switch_GetTexParameterIuiv; - ClearBufferiv = Switch_ClearBufferiv; - ClearBufferuiv = Switch_ClearBufferuiv; - ClearBufferfv = Switch_ClearBufferfv; - ClearBufferfi = Switch_ClearBufferfi; - GetStringi = Switch_GetStringi; + // Extension: 3.0 + ColorMaski = Switch_ColorMaski; + GetBooleani_v = Switch_GetBooleani_v; + GetIntegeri_v = Switch_GetIntegeri_v; + Enablei = Switch_Enablei; + Disablei = Switch_Disablei; + IsEnabledi = Switch_IsEnabledi; + BeginTransformFeedback = Switch_BeginTransformFeedback; + EndTransformFeedback = Switch_EndTransformFeedback; + BindBufferRange = Switch_BindBufferRange; + BindBufferBase = Switch_BindBufferBase; + TransformFeedbackVaryings = Switch_TransformFeedbackVaryings; + GetTransformFeedbackVarying = Switch_GetTransformFeedbackVarying; + ClampColor = Switch_ClampColor; + BeginConditionalRender = Switch_BeginConditionalRender; + EndConditionalRender = Switch_EndConditionalRender; + VertexAttribIPointer = Switch_VertexAttribIPointer; + GetVertexAttribIiv = Switch_GetVertexAttribIiv; + GetVertexAttribIuiv = Switch_GetVertexAttribIuiv; + VertexAttribI1i = Switch_VertexAttribI1i; + VertexAttribI2i = Switch_VertexAttribI2i; + VertexAttribI3i = Switch_VertexAttribI3i; + VertexAttribI4i = Switch_VertexAttribI4i; + VertexAttribI1ui = Switch_VertexAttribI1ui; + VertexAttribI2ui = Switch_VertexAttribI2ui; + VertexAttribI3ui = Switch_VertexAttribI3ui; + VertexAttribI4ui = Switch_VertexAttribI4ui; + VertexAttribI1iv = Switch_VertexAttribI1iv; + VertexAttribI2iv = Switch_VertexAttribI2iv; + VertexAttribI3iv = Switch_VertexAttribI3iv; + VertexAttribI4iv = Switch_VertexAttribI4iv; + VertexAttribI1uiv = Switch_VertexAttribI1uiv; + VertexAttribI2uiv = Switch_VertexAttribI2uiv; + VertexAttribI3uiv = Switch_VertexAttribI3uiv; + VertexAttribI4uiv = Switch_VertexAttribI4uiv; + VertexAttribI4bv = Switch_VertexAttribI4bv; + VertexAttribI4sv = Switch_VertexAttribI4sv; + VertexAttribI4ubv = Switch_VertexAttribI4ubv; + VertexAttribI4usv = Switch_VertexAttribI4usv; + GetUniformuiv = Switch_GetUniformuiv; + BindFragDataLocation = Switch_BindFragDataLocation; + GetFragDataLocation = Switch_GetFragDataLocation; + Uniform1ui = Switch_Uniform1ui; + Uniform2ui = Switch_Uniform2ui; + Uniform3ui = Switch_Uniform3ui; + Uniform4ui = Switch_Uniform4ui; + Uniform1uiv = Switch_Uniform1uiv; + Uniform2uiv = Switch_Uniform2uiv; + Uniform3uiv = Switch_Uniform3uiv; + Uniform4uiv = Switch_Uniform4uiv; + TexParameterIiv = Switch_TexParameterIiv; + TexParameterIuiv = Switch_TexParameterIuiv; + GetTexParameterIiv = Switch_GetTexParameterIiv; + GetTexParameterIuiv = Switch_GetTexParameterIuiv; + ClearBufferiv = Switch_ClearBufferiv; + ClearBufferuiv = Switch_ClearBufferuiv; + ClearBufferfv = Switch_ClearBufferfv; + ClearBufferfi = Switch_ClearBufferfi; + GetStringi = Switch_GetStringi; - // Extension: ARB_uniform_buffer_object - GetUniformIndices = Switch_GetUniformIndices; - GetActiveUniformsiv = Switch_GetActiveUniformsiv; - GetActiveUniformName = Switch_GetActiveUniformName; - GetUniformBlockIndex = Switch_GetUniformBlockIndex; - GetActiveUniformBlockiv = Switch_GetActiveUniformBlockiv; - GetActiveUniformBlockName = Switch_GetActiveUniformBlockName; - UniformBlockBinding = Switch_UniformBlockBinding; + // Extension: ARB_uniform_buffer_object + GetUniformIndices = Switch_GetUniformIndices; + GetActiveUniformsiv = Switch_GetActiveUniformsiv; + GetActiveUniformName = Switch_GetActiveUniformName; + GetUniformBlockIndex = Switch_GetUniformBlockIndex; + GetActiveUniformBlockiv = Switch_GetActiveUniformBlockiv; + GetActiveUniformBlockName = Switch_GetActiveUniformBlockName; + UniformBlockBinding = Switch_UniformBlockBinding; - // Extension: ARB_copy_buffer - CopyBufferSubData = Switch_CopyBufferSubData; + // Extension: ARB_copy_buffer + CopyBufferSubData = Switch_CopyBufferSubData; - // Extension: 3.1 - DrawArraysInstanced = Switch_DrawArraysInstanced; - DrawElementsInstanced = Switch_DrawElementsInstanced; - TexBuffer = Switch_TexBuffer; - PrimitiveRestartIndex = Switch_PrimitiveRestartIndex; + // Extension: 3.1 + DrawArraysInstanced = Switch_DrawArraysInstanced; + DrawElementsInstanced = Switch_DrawElementsInstanced; + TexBuffer = Switch_TexBuffer; + PrimitiveRestartIndex = Switch_PrimitiveRestartIndex; - // Legacy - EnableClientState = Switch_EnableClientState; - DisableClientState = Switch_DisableClientState; - VertexPointer = Switch_VertexPointer; - NormalPointer = Switch_NormalPointer; - ColorPointer = Switch_ColorPointer; - TexCoordPointer = Switch_TexCoordPointer; - - TexEnvi = Switch_TexEnvi; - - MatrixMode = Switch_MatrixMode; - LoadIdentity = Switch_LoadIdentity; - Ortho = Switch_Ortho; - - Color3d = Switch_Color3d; - - } + // Legacy + EnableClientState = Switch_EnableClientState; + DisableClientState = Switch_DisableClientState; + VertexPointer = Switch_VertexPointer; + NormalPointer = Switch_NormalPointer; + ColorPointer = Switch_ColorPointer; + TexCoordPointer = Switch_TexCoordPointer; + TexEnvi = Switch_TexEnvi; + MatrixMode = Switch_MatrixMode; + LoadIdentity = Switch_LoadIdentity; + Ortho = Switch_Ortho; + Color3d = Switch_Color3d; + } }; InitializeVariables g_initVariables; - } - - namespace sys - { - namespace - { - void ClearExtensionVariables() - { - } - - struct MapEntry - { - const char *extName; - bool *extVariable; - }; - - struct MapCompare - { - MapCompare(const char *test_) : test(test_) {} - bool operator()(const MapEntry &other) { return strcmp(test, other.extName) == 0; } - const char *test; - }; - - struct ClearEntry - { - void operator()(MapEntry &entry) { *(entry.extVariable) = false;} - }; - - MapEntry g_mappingTable[1] = - { - }; - - void LoadExtByName(const char *extensionName) - { - MapEntry *tableEnd = &g_mappingTable[0]; - MapEntry *entry = std::find_if(&g_mappingTable[0], tableEnd, MapCompare(extensionName)); - - if(entry != tableEnd) - *(entry->extVariable) = true; - } - - void ProcExtsFromExtList() - { - GLint iLoop; - GLint iNumExtensions = 0; - GetIntegerv(NUM_EXTENSIONS, &iNumExtensions); - - for(iLoop = 0; iLoop < iNumExtensions; iLoop++) - { - const char *strExtensionName = (const char *)GetStringi(EXTENSIONS, iLoop); - LoadExtByName(strExtensionName); - } - } - } - void CheckExtensions() - { - ClearExtensionVariables(); - std::for_each(&g_mappingTable[0], &g_mappingTable[0], ClearEntry()); - - ProcExtsFromExtList(); - } - - } } #endif diff --git a/modules/core/src/gl_core_3_1.hpp b/modules/core/src/gl_core_3_1.hpp index 711ebe9ab7..50dbee66c7 100644 --- a/modules/core/src/gl_core_3_1.hpp +++ b/modules/core/src/gl_core_3_1.hpp @@ -37,7 +37,7 @@ #else #define APIENTRY #endif -#endif /*APIENTRY*/ +#endif // APIENTRY #ifndef CODEGEN_FUNCPTR #define CODEGEN_REMOVE_FUNCPTR @@ -46,1297 +46,1286 @@ #else #define CODEGEN_FUNCPTR #endif -#endif /*CODEGEN_FUNCPTR*/ - -#ifndef GLAPI - #define GLAPI extern -#endif - +#endif // CODEGEN_FUNCPTR #ifndef GL_LOAD_GEN_BASIC_OPENGL_TYPEDEFS #define GL_LOAD_GEN_BASIC_OPENGL_TYPEDEFS - - typedef unsigned int GLenum; - typedef unsigned char GLboolean; - typedef unsigned int GLbitfield; - typedef signed char GLbyte; - typedef short GLshort; - typedef int GLint; - typedef int GLsizei; - typedef unsigned char GLubyte; - typedef unsigned short GLushort; - typedef unsigned int GLuint; - typedef float GLfloat; - typedef float GLclampf; - typedef double GLdouble; - typedef double GLclampd; - #define GLvoid void - -#endif /*GL_LOAD_GEN_BASIC_OPENGL_TYPEDEFS*/ + typedef unsigned int GLenum; + typedef unsigned char GLboolean; + typedef unsigned int GLbitfield; + typedef signed char GLbyte; + typedef short GLshort; + typedef int GLint; + typedef int GLsizei; + typedef unsigned char GLubyte; + typedef unsigned short GLushort; + typedef unsigned int GLuint; + typedef float GLfloat; + typedef float GLclampf; + typedef double GLdouble; + typedef double GLclampd; + #define GLvoid void +#endif // GL_LOAD_GEN_BASIC_OPENGL_TYPEDEFS #include + #ifndef GL_VERSION_2_0 - /* GL type for program/shader text */ - typedef char GLchar; + // GL type for program/shader text + typedef char GLchar; #endif + #ifndef GL_VERSION_1_5 - /* GL types for handling large vertex buffer objects */ - typedef ptrdiff_t GLintptr; - typedef ptrdiff_t GLsizeiptr; + // GL types for handling large vertex buffer objects + typedef ptrdiff_t GLintptr; + typedef ptrdiff_t GLsizeiptr; #endif + #ifndef GL_ARB_vertex_buffer_object - /* GL types for handling large vertex buffer objects */ - typedef ptrdiff_t GLintptrARB; - typedef ptrdiff_t GLsizeiptrARB; + // GL types for handling large vertex buffer objects + typedef ptrdiff_t GLintptrARB; + typedef ptrdiff_t GLsizeiptrARB; #endif + #ifndef GL_ARB_shader_objects - /* GL types for program/shader text and shader object handles */ - typedef char GLcharARB; - typedef unsigned int GLhandleARB; + // GL types for program/shader text and shader object handles + typedef char GLcharARB; + typedef unsigned int GLhandleARB; #endif -/* GL type for "half" precision (s10e5) float data in host memory */ + +// GL type for "half" precision (s10e5) float data in host memory #ifndef GL_ARB_half_float_pixel - typedef unsigned short GLhalfARB; + typedef unsigned short GLhalfARB; #endif #ifndef GL_NV_half_float - typedef unsigned short GLhalfNV; + typedef unsigned short GLhalfNV; #endif + #ifndef GLEXT_64_TYPES_DEFINED - /* This code block is duplicated in glxext.h, so must be protected */ - #define GLEXT_64_TYPES_DEFINED - /* Define int32_t, int64_t, and uint64_t types for UST/MSC */ - /* (as used in the GL_EXT_timer_query extension). */ - #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #include - #elif defined(__sun__) || defined(__digital__) - #include - #if defined(__STDC__) - #if defined(__arch64__) || defined(_LP64) - typedef long int int64_t; - typedef unsigned long int uint64_t; - #else + // This code block is duplicated in glxext.h, so must be protected + #define GLEXT_64_TYPES_DEFINED + + // Define int32_t, int64_t, and uint64_t types for UST/MSC + // (as used in the GL_EXT_timer_query extension) + #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #include + #elif defined(__sun__) || defined(__digital__) + #include + #if defined(__STDC__) + #if defined(__arch64__) || defined(_LP64) + typedef long int int64_t; + typedef unsigned long int uint64_t; + #else + typedef long long int int64_t; + typedef unsigned long long int uint64_t; + #endif // __arch64__ + #endif // __STDC__ + #elif defined( __VMS ) || defined(__sgi) + #include + #elif defined(__SCO__) || defined(__USLC__) + #include + #elif defined(__UNIXOS2__) || defined(__SOL64__) + typedef long int int32_t; typedef long long int int64_t; typedef unsigned long long int uint64_t; - #endif /* __arch64__ */ - #endif /* __STDC__ */ - #elif defined( __VMS ) || defined(__sgi) - #include - #elif defined(__SCO__) || defined(__USLC__) - #include - #elif defined(__UNIXOS2__) || defined(__SOL64__) - typedef long int int32_t; - typedef long long int int64_t; - typedef unsigned long long int uint64_t; - #elif defined(_WIN32) && defined(__GNUC__) - #include - #elif defined(_WIN32) - typedef __int32 int32_t; - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; + #elif defined(_WIN32) && defined(__GNUC__) + #include + #elif defined(_WIN32) + typedef __int32 int32_t; + typedef __int64 int64_t; + typedef unsigned __int64 uint64_t; #else - /* Fallback if nothing above works */ - #include - #endif + // Fallback if nothing above works + #include + #endif #endif + #ifndef GL_EXT_timer_query - typedef int64_t GLint64EXT; - typedef uint64_t GLuint64EXT; + typedef int64_t GLint64EXT; + typedef uint64_t GLuint64EXT; #endif + #ifndef GL_ARB_sync - typedef int64_t GLint64; - typedef uint64_t GLuint64; - typedef struct __GLsync *GLsync; + typedef int64_t GLint64; + typedef uint64_t GLuint64; + typedef struct __GLsync *GLsync; #endif + #ifndef GL_ARB_cl_event - /* These incomplete types let us declare types compatible with OpenCL's cl_context and cl_event */ - struct _cl_context; - struct _cl_event; + // These incomplete types let us declare types compatible with OpenCL's cl_context and cl_event + struct _cl_context; + struct _cl_event; #endif + #ifndef GL_ARB_debug_output - typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); + typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); #endif + #ifndef GL_AMD_debug_output - typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); + typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); #endif + #ifndef GL_KHR_debug - typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); + typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); #endif + #ifndef GL_NV_vdpau_interop - typedef GLintptr GLvdpauSurfaceNV; + typedef GLintptr GLvdpauSurfaceNV; #endif namespace gl { - ///////////////////////// - // Extension Variables - namespace exts - { - } + enum + { + // Version: 1.1 + DEPTH_BUFFER_BIT = 0x00000100, + STENCIL_BUFFER_BIT = 0x00000400, + COLOR_BUFFER_BIT = 0x00004000, + FALSE_ = 0, + TRUE_ = 1, + POINTS = 0x0000, + LINES = 0x0001, + LINE_LOOP = 0x0002, + LINE_STRIP = 0x0003, + TRIANGLES = 0x0004, + TRIANGLE_STRIP = 0x0005, + TRIANGLE_FAN = 0x0006, + QUADS = 0x0007, + NEVER = 0x0200, + LESS = 0x0201, + EQUAL = 0x0202, + LEQUAL = 0x0203, + GREATER = 0x0204, + NOTEQUAL = 0x0205, + GEQUAL = 0x0206, + ALWAYS = 0x0207, + ZERO = 0, + ONE = 1, + SRC_COLOR = 0x0300, + ONE_MINUS_SRC_COLOR = 0x0301, + SRC_ALPHA = 0x0302, + ONE_MINUS_SRC_ALPHA = 0x0303, + DST_ALPHA = 0x0304, + ONE_MINUS_DST_ALPHA = 0x0305, + DST_COLOR = 0x0306, + ONE_MINUS_DST_COLOR = 0x0307, + SRC_ALPHA_SATURATE = 0x0308, + NONE = 0, + FRONT_LEFT = 0x0400, + FRONT_RIGHT = 0x0401, + BACK_LEFT = 0x0402, + BACK_RIGHT = 0x0403, + FRONT = 0x0404, + BACK = 0x0405, + LEFT = 0x0406, + RIGHT = 0x0407, + FRONT_AND_BACK = 0x0408, + NO_ERROR_ = 0, + INVALID_ENUM = 0x0500, + INVALID_VALUE = 0x0501, + INVALID_OPERATION = 0x0502, + OUT_OF_MEMORY = 0x0505, + CW = 0x0900, + CCW = 0x0901, + POINT_SIZE = 0x0B11, + POINT_SIZE_RANGE = 0x0B12, + POINT_SIZE_GRANULARITY = 0x0B13, + LINE_SMOOTH = 0x0B20, + LINE_WIDTH = 0x0B21, + LINE_WIDTH_RANGE = 0x0B22, + LINE_WIDTH_GRANULARITY = 0x0B23, + POLYGON_MODE = 0x0B40, + POLYGON_SMOOTH = 0x0B41, + CULL_FACE = 0x0B44, + CULL_FACE_MODE = 0x0B45, + FRONT_FACE = 0x0B46, + DEPTH_RANGE = 0x0B70, + DEPTH_TEST = 0x0B71, + DEPTH_WRITEMASK = 0x0B72, + DEPTH_CLEAR_VALUE = 0x0B73, + DEPTH_FUNC = 0x0B74, + STENCIL_TEST = 0x0B90, + STENCIL_CLEAR_VALUE = 0x0B91, + STENCIL_FUNC = 0x0B92, + STENCIL_VALUE_MASK = 0x0B93, + STENCIL_FAIL = 0x0B94, + STENCIL_PASS_DEPTH_FAIL = 0x0B95, + STENCIL_PASS_DEPTH_PASS = 0x0B96, + STENCIL_REF = 0x0B97, + STENCIL_WRITEMASK = 0x0B98, + VIEWPORT = 0x0BA2, + DITHER = 0x0BD0, + BLEND_DST = 0x0BE0, + BLEND_SRC = 0x0BE1, + BLEND = 0x0BE2, + LOGIC_OP_MODE = 0x0BF0, + COLOR_LOGIC_OP = 0x0BF2, + DRAW_BUFFER = 0x0C01, + READ_BUFFER = 0x0C02, + SCISSOR_BOX = 0x0C10, + SCISSOR_TEST = 0x0C11, + COLOR_CLEAR_VALUE = 0x0C22, + COLOR_WRITEMASK = 0x0C23, + DOUBLEBUFFER = 0x0C32, + STEREO = 0x0C33, + LINE_SMOOTH_HINT = 0x0C52, + POLYGON_SMOOTH_HINT = 0x0C53, + UNPACK_SWAP_BYTES = 0x0CF0, + UNPACK_LSB_FIRST = 0x0CF1, + UNPACK_ROW_LENGTH = 0x0CF2, + UNPACK_SKIP_ROWS = 0x0CF3, + UNPACK_SKIP_PIXELS = 0x0CF4, + UNPACK_ALIGNMENT = 0x0CF5, + PACK_SWAP_BYTES = 0x0D00, + PACK_LSB_FIRST = 0x0D01, + PACK_ROW_LENGTH = 0x0D02, + PACK_SKIP_ROWS = 0x0D03, + PACK_SKIP_PIXELS = 0x0D04, + PACK_ALIGNMENT = 0x0D05, + MAX_TEXTURE_SIZE = 0x0D33, + MAX_VIEWPORT_DIMS = 0x0D3A, + SUBPIXEL_BITS = 0x0D50, + TEXTURE_1D = 0x0DE0, + TEXTURE_2D = 0x0DE1, + POLYGON_OFFSET_UNITS = 0x2A00, + POLYGON_OFFSET_POINT = 0x2A01, + POLYGON_OFFSET_LINE = 0x2A02, + POLYGON_OFFSET_FILL = 0x8037, + POLYGON_OFFSET_FACTOR = 0x8038, + TEXTURE_BINDING_1D = 0x8068, + TEXTURE_BINDING_2D = 0x8069, + TEXTURE_WIDTH = 0x1000, + TEXTURE_HEIGHT = 0x1001, + TEXTURE_INTERNAL_FORMAT = 0x1003, + TEXTURE_BORDER_COLOR = 0x1004, + TEXTURE_RED_SIZE = 0x805C, + TEXTURE_GREEN_SIZE = 0x805D, + TEXTURE_BLUE_SIZE = 0x805E, + TEXTURE_ALPHA_SIZE = 0x805F, + DONT_CARE = 0x1100, + FASTEST = 0x1101, + NICEST = 0x1102, + BYTE = 0x1400, + UNSIGNED_BYTE = 0x1401, + SHORT = 0x1402, + UNSIGNED_SHORT = 0x1403, + INT = 0x1404, + UNSIGNED_INT = 0x1405, + FLOAT = 0x1406, + DOUBLE = 0x140A, + CLEAR = 0x1500, + AND = 0x1501, + AND_REVERSE = 0x1502, + COPY = 0x1503, + AND_INVERTED = 0x1504, + NOOP = 0x1505, + XOR = 0x1506, + OR = 0x1507, + NOR = 0x1508, + EQUIV = 0x1509, + INVERT = 0x150A, + OR_REVERSE = 0x150B, + COPY_INVERTED = 0x150C, + OR_INVERTED = 0x150D, + NAND = 0x150E, + SET = 0x150F, + TEXTURE = 0x1702, + COLOR = 0x1800, + DEPTH = 0x1801, + STENCIL = 0x1802, + STENCIL_INDEX = 0x1901, + DEPTH_COMPONENT = 0x1902, + RED = 0x1903, + GREEN = 0x1904, + BLUE = 0x1905, + ALPHA = 0x1906, + RGB = 0x1907, + RGBA = 0x1908, + POINT = 0x1B00, + LINE = 0x1B01, + FILL = 0x1B02, + KEEP = 0x1E00, + REPLACE = 0x1E01, + INCR = 0x1E02, + DECR = 0x1E03, + VENDOR = 0x1F00, + RENDERER = 0x1F01, + VERSION_ = 0x1F02, + EXTENSIONS = 0x1F03, + NEAREST = 0x2600, + LINEAR = 0x2601, + NEAREST_MIPMAP_NEAREST = 0x2700, + LINEAR_MIPMAP_NEAREST = 0x2701, + NEAREST_MIPMAP_LINEAR = 0x2702, + LINEAR_MIPMAP_LINEAR = 0x2703, + TEXTURE_MAG_FILTER = 0x2800, + TEXTURE_MIN_FILTER = 0x2801, + TEXTURE_WRAP_S = 0x2802, + TEXTURE_WRAP_T = 0x2803, + PROXY_TEXTURE_1D = 0x8063, + PROXY_TEXTURE_2D = 0x8064, + REPEAT = 0x2901, + R3_G3_B2 = 0x2A10, + RGB4 = 0x804F, + RGB5 = 0x8050, + RGB8 = 0x8051, + RGB10 = 0x8052, + RGB12 = 0x8053, + RGB16 = 0x8054, + RGBA2 = 0x8055, + RGBA4 = 0x8056, + RGB5_A1 = 0x8057, + RGBA8 = 0x8058, + RGB10_A2 = 0x8059, + RGBA12 = 0x805A, + RGBA16 = 0x805B, - enum - { - // Version: 1.1 - DEPTH_BUFFER_BIT = 0x00000100, - STENCIL_BUFFER_BIT = 0x00000400, - COLOR_BUFFER_BIT = 0x00004000, - FALSE_ = 0, - TRUE_ = 1, - POINTS = 0x0000, - LINES = 0x0001, - LINE_LOOP = 0x0002, - LINE_STRIP = 0x0003, - TRIANGLES = 0x0004, - TRIANGLE_STRIP = 0x0005, - TRIANGLE_FAN = 0x0006, - QUADS = 0x0007, - NEVER = 0x0200, - LESS = 0x0201, - EQUAL = 0x0202, - LEQUAL = 0x0203, - GREATER = 0x0204, - NOTEQUAL = 0x0205, - GEQUAL = 0x0206, - ALWAYS = 0x0207, - ZERO = 0, - ONE = 1, - SRC_COLOR = 0x0300, - ONE_MINUS_SRC_COLOR = 0x0301, - SRC_ALPHA = 0x0302, - ONE_MINUS_SRC_ALPHA = 0x0303, - DST_ALPHA = 0x0304, - ONE_MINUS_DST_ALPHA = 0x0305, - DST_COLOR = 0x0306, - ONE_MINUS_DST_COLOR = 0x0307, - SRC_ALPHA_SATURATE = 0x0308, - NONE = 0, - FRONT_LEFT = 0x0400, - FRONT_RIGHT = 0x0401, - BACK_LEFT = 0x0402, - BACK_RIGHT = 0x0403, - FRONT = 0x0404, - BACK = 0x0405, - LEFT = 0x0406, - RIGHT = 0x0407, - FRONT_AND_BACK = 0x0408, - NO_ERROR_ = 0, - INVALID_ENUM = 0x0500, - INVALID_VALUE = 0x0501, - INVALID_OPERATION = 0x0502, - OUT_OF_MEMORY = 0x0505, - CW = 0x0900, - CCW = 0x0901, - POINT_SIZE = 0x0B11, - POINT_SIZE_RANGE = 0x0B12, - POINT_SIZE_GRANULARITY = 0x0B13, - LINE_SMOOTH = 0x0B20, - LINE_WIDTH = 0x0B21, - LINE_WIDTH_RANGE = 0x0B22, - LINE_WIDTH_GRANULARITY = 0x0B23, - POLYGON_MODE = 0x0B40, - POLYGON_SMOOTH = 0x0B41, - CULL_FACE = 0x0B44, - CULL_FACE_MODE = 0x0B45, - FRONT_FACE = 0x0B46, - DEPTH_RANGE = 0x0B70, - DEPTH_TEST = 0x0B71, - DEPTH_WRITEMASK = 0x0B72, - DEPTH_CLEAR_VALUE = 0x0B73, - DEPTH_FUNC = 0x0B74, - STENCIL_TEST = 0x0B90, - STENCIL_CLEAR_VALUE = 0x0B91, - STENCIL_FUNC = 0x0B92, - STENCIL_VALUE_MASK = 0x0B93, - STENCIL_FAIL = 0x0B94, - STENCIL_PASS_DEPTH_FAIL = 0x0B95, - STENCIL_PASS_DEPTH_PASS = 0x0B96, - STENCIL_REF = 0x0B97, - STENCIL_WRITEMASK = 0x0B98, - VIEWPORT = 0x0BA2, - DITHER = 0x0BD0, - BLEND_DST = 0x0BE0, - BLEND_SRC = 0x0BE1, - BLEND = 0x0BE2, - LOGIC_OP_MODE = 0x0BF0, - COLOR_LOGIC_OP = 0x0BF2, - DRAW_BUFFER = 0x0C01, - READ_BUFFER = 0x0C02, - SCISSOR_BOX = 0x0C10, - SCISSOR_TEST = 0x0C11, - COLOR_CLEAR_VALUE = 0x0C22, - COLOR_WRITEMASK = 0x0C23, - DOUBLEBUFFER = 0x0C32, - STEREO = 0x0C33, - LINE_SMOOTH_HINT = 0x0C52, - POLYGON_SMOOTH_HINT = 0x0C53, - UNPACK_SWAP_BYTES = 0x0CF0, - UNPACK_LSB_FIRST = 0x0CF1, - UNPACK_ROW_LENGTH = 0x0CF2, - UNPACK_SKIP_ROWS = 0x0CF3, - UNPACK_SKIP_PIXELS = 0x0CF4, - UNPACK_ALIGNMENT = 0x0CF5, - PACK_SWAP_BYTES = 0x0D00, - PACK_LSB_FIRST = 0x0D01, - PACK_ROW_LENGTH = 0x0D02, - PACK_SKIP_ROWS = 0x0D03, - PACK_SKIP_PIXELS = 0x0D04, - PACK_ALIGNMENT = 0x0D05, - MAX_TEXTURE_SIZE = 0x0D33, - MAX_VIEWPORT_DIMS = 0x0D3A, - SUBPIXEL_BITS = 0x0D50, - TEXTURE_1D = 0x0DE0, - TEXTURE_2D = 0x0DE1, - POLYGON_OFFSET_UNITS = 0x2A00, - POLYGON_OFFSET_POINT = 0x2A01, - POLYGON_OFFSET_LINE = 0x2A02, - POLYGON_OFFSET_FILL = 0x8037, - POLYGON_OFFSET_FACTOR = 0x8038, - TEXTURE_BINDING_1D = 0x8068, - TEXTURE_BINDING_2D = 0x8069, - TEXTURE_WIDTH = 0x1000, - TEXTURE_HEIGHT = 0x1001, - TEXTURE_INTERNAL_FORMAT = 0x1003, - TEXTURE_BORDER_COLOR = 0x1004, - TEXTURE_RED_SIZE = 0x805C, - TEXTURE_GREEN_SIZE = 0x805D, - TEXTURE_BLUE_SIZE = 0x805E, - TEXTURE_ALPHA_SIZE = 0x805F, - DONT_CARE = 0x1100, - FASTEST = 0x1101, - NICEST = 0x1102, - BYTE = 0x1400, - UNSIGNED_BYTE = 0x1401, - SHORT = 0x1402, - UNSIGNED_SHORT = 0x1403, - INT = 0x1404, - UNSIGNED_INT = 0x1405, - FLOAT = 0x1406, - DOUBLE = 0x140A, - CLEAR = 0x1500, - AND = 0x1501, - AND_REVERSE = 0x1502, - COPY = 0x1503, - AND_INVERTED = 0x1504, - NOOP = 0x1505, - XOR = 0x1506, - OR = 0x1507, - NOR = 0x1508, - EQUIV = 0x1509, - INVERT = 0x150A, - OR_REVERSE = 0x150B, - COPY_INVERTED = 0x150C, - OR_INVERTED = 0x150D, - NAND = 0x150E, - SET = 0x150F, - TEXTURE = 0x1702, - COLOR = 0x1800, - DEPTH = 0x1801, - STENCIL = 0x1802, - STENCIL_INDEX = 0x1901, - DEPTH_COMPONENT = 0x1902, - RED = 0x1903, - GREEN = 0x1904, - BLUE = 0x1905, - ALPHA = 0x1906, - RGB = 0x1907, - RGBA = 0x1908, - POINT = 0x1B00, - LINE = 0x1B01, - FILL = 0x1B02, - KEEP = 0x1E00, - REPLACE = 0x1E01, - INCR = 0x1E02, - DECR = 0x1E03, - VENDOR = 0x1F00, - RENDERER = 0x1F01, - VERSION_ = 0x1F02, - EXTENSIONS = 0x1F03, - NEAREST = 0x2600, - LINEAR = 0x2601, - NEAREST_MIPMAP_NEAREST = 0x2700, - LINEAR_MIPMAP_NEAREST = 0x2701, - NEAREST_MIPMAP_LINEAR = 0x2702, - LINEAR_MIPMAP_LINEAR = 0x2703, - TEXTURE_MAG_FILTER = 0x2800, - TEXTURE_MIN_FILTER = 0x2801, - TEXTURE_WRAP_S = 0x2802, - TEXTURE_WRAP_T = 0x2803, - PROXY_TEXTURE_1D = 0x8063, - PROXY_TEXTURE_2D = 0x8064, - REPEAT = 0x2901, - R3_G3_B2 = 0x2A10, - RGB4 = 0x804F, - RGB5 = 0x8050, - RGB8 = 0x8051, - RGB10 = 0x8052, - RGB12 = 0x8053, - RGB16 = 0x8054, - RGBA2 = 0x8055, - RGBA4 = 0x8056, - RGB5_A1 = 0x8057, - RGBA8 = 0x8058, - RGB10_A2 = 0x8059, - RGBA12 = 0x805A, - RGBA16 = 0x805B, + // Core Extension: ARB_imaging + CONSTANT_COLOR = 0x8001, + ONE_MINUS_CONSTANT_COLOR = 0x8002, + CONSTANT_ALPHA = 0x8003, + ONE_MINUS_CONSTANT_ALPHA = 0x8004, + BLEND_COLOR = 0x8005, + FUNC_ADD = 0x8006, + MIN = 0x8007, + MAX = 0x8008, + BLEND_EQUATION = 0x8009, + FUNC_SUBTRACT = 0x800A, + FUNC_REVERSE_SUBTRACT = 0x800B, + CONVOLUTION_1D = 0x8010, + CONVOLUTION_2D = 0x8011, + SEPARABLE_2D = 0x8012, + CONVOLUTION_BORDER_MODE = 0x8013, + CONVOLUTION_FILTER_SCALE = 0x8014, + CONVOLUTION_FILTER_BIAS = 0x8015, + REDUCE = 0x8016, + CONVOLUTION_FORMAT = 0x8017, + CONVOLUTION_WIDTH = 0x8018, + CONVOLUTION_HEIGHT = 0x8019, + MAX_CONVOLUTION_WIDTH = 0x801A, + MAX_CONVOLUTION_HEIGHT = 0x801B, + POST_CONVOLUTION_RED_SCALE = 0x801C, + POST_CONVOLUTION_GREEN_SCALE = 0x801D, + POST_CONVOLUTION_BLUE_SCALE = 0x801E, + POST_CONVOLUTION_ALPHA_SCALE = 0x801F, + POST_CONVOLUTION_RED_BIAS = 0x8020, + POST_CONVOLUTION_GREEN_BIAS = 0x8021, + POST_CONVOLUTION_BLUE_BIAS = 0x8022, + POST_CONVOLUTION_ALPHA_BIAS = 0x8023, + HISTOGRAM = 0x8024, + PROXY_HISTOGRAM = 0x8025, + HISTOGRAM_WIDTH = 0x8026, + HISTOGRAM_FORMAT = 0x8027, + HISTOGRAM_RED_SIZE = 0x8028, + HISTOGRAM_GREEN_SIZE = 0x8029, + HISTOGRAM_BLUE_SIZE = 0x802A, + HISTOGRAM_ALPHA_SIZE = 0x802B, + HISTOGRAM_LUMINANCE_SIZE = 0x802C, + HISTOGRAM_SINK = 0x802D, + MINMAX = 0x802E, + MINMAX_FORMAT = 0x802F, + MINMAX_SINK = 0x8030, + TABLE_TOO_LARGE = 0x8031, + COLOR_MATRIX = 0x80B1, + COLOR_MATRIX_STACK_DEPTH = 0x80B2, + MAX_COLOR_MATRIX_STACK_DEPTH = 0x80B3, + POST_COLOR_MATRIX_RED_SCALE = 0x80B4, + POST_COLOR_MATRIX_GREEN_SCALE = 0x80B5, + POST_COLOR_MATRIX_BLUE_SCALE = 0x80B6, + POST_COLOR_MATRIX_ALPHA_SCALE = 0x80B7, + POST_COLOR_MATRIX_RED_BIAS = 0x80B8, + POST_COLOR_MATRIX_GREEN_BIAS = 0x80B9, + POST_COLOR_MATRIX_BLUE_BIAS = 0x80BA, + POST_COLOR_MATRIX_ALPHA_BIAS = 0x80BB, + COLOR_TABLE = 0x80D0, + POST_CONVOLUTION_COLOR_TABLE = 0x80D1, + POST_COLOR_MATRIX_COLOR_TABLE = 0x80D2, + PROXY_COLOR_TABLE = 0x80D3, + PROXY_POST_CONVOLUTION_COLOR_TABLE = 0x80D4, + PROXY_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D5, + COLOR_TABLE_SCALE = 0x80D6, + COLOR_TABLE_BIAS = 0x80D7, + COLOR_TABLE_FORMAT = 0x80D8, + COLOR_TABLE_WIDTH = 0x80D9, + COLOR_TABLE_RED_SIZE = 0x80DA, + COLOR_TABLE_GREEN_SIZE = 0x80DB, + COLOR_TABLE_BLUE_SIZE = 0x80DC, + COLOR_TABLE_ALPHA_SIZE = 0x80DD, + COLOR_TABLE_LUMINANCE_SIZE = 0x80DE, + COLOR_TABLE_INTENSITY_SIZE = 0x80DF, + CONSTANT_BORDER = 0x8151, + REPLICATE_BORDER = 0x8153, + CONVOLUTION_BORDER_COLOR = 0x8154, - // Core Extension: ARB_imaging - CONSTANT_COLOR = 0x8001, - ONE_MINUS_CONSTANT_COLOR = 0x8002, - CONSTANT_ALPHA = 0x8003, - ONE_MINUS_CONSTANT_ALPHA = 0x8004, - BLEND_COLOR = 0x8005, - FUNC_ADD = 0x8006, - MIN = 0x8007, - MAX = 0x8008, - BLEND_EQUATION = 0x8009, - FUNC_SUBTRACT = 0x800A, - FUNC_REVERSE_SUBTRACT = 0x800B, - CONVOLUTION_1D = 0x8010, - CONVOLUTION_2D = 0x8011, - SEPARABLE_2D = 0x8012, - CONVOLUTION_BORDER_MODE = 0x8013, - CONVOLUTION_FILTER_SCALE = 0x8014, - CONVOLUTION_FILTER_BIAS = 0x8015, - REDUCE = 0x8016, - CONVOLUTION_FORMAT = 0x8017, - CONVOLUTION_WIDTH = 0x8018, - CONVOLUTION_HEIGHT = 0x8019, - MAX_CONVOLUTION_WIDTH = 0x801A, - MAX_CONVOLUTION_HEIGHT = 0x801B, - POST_CONVOLUTION_RED_SCALE = 0x801C, - POST_CONVOLUTION_GREEN_SCALE = 0x801D, - POST_CONVOLUTION_BLUE_SCALE = 0x801E, - POST_CONVOLUTION_ALPHA_SCALE = 0x801F, - POST_CONVOLUTION_RED_BIAS = 0x8020, - POST_CONVOLUTION_GREEN_BIAS = 0x8021, - POST_CONVOLUTION_BLUE_BIAS = 0x8022, - POST_CONVOLUTION_ALPHA_BIAS = 0x8023, - HISTOGRAM = 0x8024, - PROXY_HISTOGRAM = 0x8025, - HISTOGRAM_WIDTH = 0x8026, - HISTOGRAM_FORMAT = 0x8027, - HISTOGRAM_RED_SIZE = 0x8028, - HISTOGRAM_GREEN_SIZE = 0x8029, - HISTOGRAM_BLUE_SIZE = 0x802A, - HISTOGRAM_ALPHA_SIZE = 0x802B, - HISTOGRAM_LUMINANCE_SIZE = 0x802C, - HISTOGRAM_SINK = 0x802D, - MINMAX = 0x802E, - MINMAX_FORMAT = 0x802F, - MINMAX_SINK = 0x8030, - TABLE_TOO_LARGE = 0x8031, - COLOR_MATRIX = 0x80B1, - COLOR_MATRIX_STACK_DEPTH = 0x80B2, - MAX_COLOR_MATRIX_STACK_DEPTH = 0x80B3, - POST_COLOR_MATRIX_RED_SCALE = 0x80B4, - POST_COLOR_MATRIX_GREEN_SCALE = 0x80B5, - POST_COLOR_MATRIX_BLUE_SCALE = 0x80B6, - POST_COLOR_MATRIX_ALPHA_SCALE = 0x80B7, - POST_COLOR_MATRIX_RED_BIAS = 0x80B8, - POST_COLOR_MATRIX_GREEN_BIAS = 0x80B9, - POST_COLOR_MATRIX_BLUE_BIAS = 0x80BA, - POST_COLOR_MATRIX_ALPHA_BIAS = 0x80BB, - COLOR_TABLE = 0x80D0, - POST_CONVOLUTION_COLOR_TABLE = 0x80D1, - POST_COLOR_MATRIX_COLOR_TABLE = 0x80D2, - PROXY_COLOR_TABLE = 0x80D3, - PROXY_POST_CONVOLUTION_COLOR_TABLE = 0x80D4, - PROXY_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D5, - COLOR_TABLE_SCALE = 0x80D6, - COLOR_TABLE_BIAS = 0x80D7, - COLOR_TABLE_FORMAT = 0x80D8, - COLOR_TABLE_WIDTH = 0x80D9, - COLOR_TABLE_RED_SIZE = 0x80DA, - COLOR_TABLE_GREEN_SIZE = 0x80DB, - COLOR_TABLE_BLUE_SIZE = 0x80DC, - COLOR_TABLE_ALPHA_SIZE = 0x80DD, - COLOR_TABLE_LUMINANCE_SIZE = 0x80DE, - COLOR_TABLE_INTENSITY_SIZE = 0x80DF, - CONSTANT_BORDER = 0x8151, - REPLICATE_BORDER = 0x8153, - CONVOLUTION_BORDER_COLOR = 0x8154, + // Version: 1.2 + UNSIGNED_BYTE_3_3_2 = 0x8032, + UNSIGNED_SHORT_4_4_4_4 = 0x8033, + UNSIGNED_SHORT_5_5_5_1 = 0x8034, + UNSIGNED_INT_8_8_8_8 = 0x8035, + UNSIGNED_INT_10_10_10_2 = 0x8036, + TEXTURE_BINDING_3D = 0x806A, + PACK_SKIP_IMAGES = 0x806B, + PACK_IMAGE_HEIGHT = 0x806C, + UNPACK_SKIP_IMAGES = 0x806D, + UNPACK_IMAGE_HEIGHT = 0x806E, + TEXTURE_3D = 0x806F, + PROXY_TEXTURE_3D = 0x8070, + TEXTURE_DEPTH = 0x8071, + TEXTURE_WRAP_R = 0x8072, + MAX_3D_TEXTURE_SIZE = 0x8073, + UNSIGNED_BYTE_2_3_3_REV = 0x8362, + UNSIGNED_SHORT_5_6_5 = 0x8363, + UNSIGNED_SHORT_5_6_5_REV = 0x8364, + UNSIGNED_SHORT_4_4_4_4_REV = 0x8365, + UNSIGNED_SHORT_1_5_5_5_REV = 0x8366, + UNSIGNED_INT_8_8_8_8_REV = 0x8367, + UNSIGNED_INT_2_10_10_10_REV = 0x8368, + BGR = 0x80E0, + BGRA = 0x80E1, + MAX_ELEMENTS_VERTICES = 0x80E8, + MAX_ELEMENTS_INDICES = 0x80E9, + CLAMP_TO_EDGE = 0x812F, + TEXTURE_MIN_LOD = 0x813A, + TEXTURE_MAX_LOD = 0x813B, + TEXTURE_BASE_LEVEL = 0x813C, + TEXTURE_MAX_LEVEL = 0x813D, + SMOOTH_POINT_SIZE_RANGE = 0x0B12, + SMOOTH_POINT_SIZE_GRANULARITY = 0x0B13, + SMOOTH_LINE_WIDTH_RANGE = 0x0B22, + SMOOTH_LINE_WIDTH_GRANULARITY = 0x0B23, + ALIASED_LINE_WIDTH_RANGE = 0x846E, - // Version: 1.2 - UNSIGNED_BYTE_3_3_2 = 0x8032, - UNSIGNED_SHORT_4_4_4_4 = 0x8033, - UNSIGNED_SHORT_5_5_5_1 = 0x8034, - UNSIGNED_INT_8_8_8_8 = 0x8035, - UNSIGNED_INT_10_10_10_2 = 0x8036, - TEXTURE_BINDING_3D = 0x806A, - PACK_SKIP_IMAGES = 0x806B, - PACK_IMAGE_HEIGHT = 0x806C, - UNPACK_SKIP_IMAGES = 0x806D, - UNPACK_IMAGE_HEIGHT = 0x806E, - TEXTURE_3D = 0x806F, - PROXY_TEXTURE_3D = 0x8070, - TEXTURE_DEPTH = 0x8071, - TEXTURE_WRAP_R = 0x8072, - MAX_3D_TEXTURE_SIZE = 0x8073, - UNSIGNED_BYTE_2_3_3_REV = 0x8362, - UNSIGNED_SHORT_5_6_5 = 0x8363, - UNSIGNED_SHORT_5_6_5_REV = 0x8364, - UNSIGNED_SHORT_4_4_4_4_REV = 0x8365, - UNSIGNED_SHORT_1_5_5_5_REV = 0x8366, - UNSIGNED_INT_8_8_8_8_REV = 0x8367, - UNSIGNED_INT_2_10_10_10_REV = 0x8368, - BGR = 0x80E0, - BGRA = 0x80E1, - MAX_ELEMENTS_VERTICES = 0x80E8, - MAX_ELEMENTS_INDICES = 0x80E9, - CLAMP_TO_EDGE = 0x812F, - TEXTURE_MIN_LOD = 0x813A, - TEXTURE_MAX_LOD = 0x813B, - TEXTURE_BASE_LEVEL = 0x813C, - TEXTURE_MAX_LEVEL = 0x813D, - SMOOTH_POINT_SIZE_RANGE = 0x0B12, - SMOOTH_POINT_SIZE_GRANULARITY = 0x0B13, - SMOOTH_LINE_WIDTH_RANGE = 0x0B22, - SMOOTH_LINE_WIDTH_GRANULARITY = 0x0B23, - ALIASED_LINE_WIDTH_RANGE = 0x846E, + // Version: 1.3 + TEXTURE0 = 0x84C0, + TEXTURE1 = 0x84C1, + TEXTURE2 = 0x84C2, + TEXTURE3 = 0x84C3, + TEXTURE4 = 0x84C4, + TEXTURE5 = 0x84C5, + TEXTURE6 = 0x84C6, + TEXTURE7 = 0x84C7, + TEXTURE8 = 0x84C8, + TEXTURE9 = 0x84C9, + TEXTURE10 = 0x84CA, + TEXTURE11 = 0x84CB, + TEXTURE12 = 0x84CC, + TEXTURE13 = 0x84CD, + TEXTURE14 = 0x84CE, + TEXTURE15 = 0x84CF, + TEXTURE16 = 0x84D0, + TEXTURE17 = 0x84D1, + TEXTURE18 = 0x84D2, + TEXTURE19 = 0x84D3, + TEXTURE20 = 0x84D4, + TEXTURE21 = 0x84D5, + TEXTURE22 = 0x84D6, + TEXTURE23 = 0x84D7, + TEXTURE24 = 0x84D8, + TEXTURE25 = 0x84D9, + TEXTURE26 = 0x84DA, + TEXTURE27 = 0x84DB, + TEXTURE28 = 0x84DC, + TEXTURE29 = 0x84DD, + TEXTURE30 = 0x84DE, + TEXTURE31 = 0x84DF, + ACTIVE_TEXTURE = 0x84E0, + MULTISAMPLE = 0x809D, + SAMPLE_ALPHA_TO_COVERAGE = 0x809E, + SAMPLE_ALPHA_TO_ONE = 0x809F, + SAMPLE_COVERAGE = 0x80A0, + SAMPLE_BUFFERS = 0x80A8, + SAMPLES = 0x80A9, + SAMPLE_COVERAGE_VALUE = 0x80AA, + SAMPLE_COVERAGE_INVERT = 0x80AB, + TEXTURE_CUBE_MAP = 0x8513, + TEXTURE_BINDING_CUBE_MAP = 0x8514, + TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515, + TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516, + TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517, + TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518, + TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519, + TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A, + PROXY_TEXTURE_CUBE_MAP = 0x851B, + MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C, + COMPRESSED_RGB = 0x84ED, + COMPRESSED_RGBA = 0x84EE, + TEXTURE_COMPRESSION_HINT = 0x84EF, + TEXTURE_COMPRESSED_IMAGE_SIZE = 0x86A0, + TEXTURE_COMPRESSED = 0x86A1, + NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2, + COMPRESSED_TEXTURE_FORMATS = 0x86A3, + CLAMP_TO_BORDER = 0x812D, - // Version: 1.3 - TEXTURE0 = 0x84C0, - TEXTURE1 = 0x84C1, - TEXTURE2 = 0x84C2, - TEXTURE3 = 0x84C3, - TEXTURE4 = 0x84C4, - TEXTURE5 = 0x84C5, - TEXTURE6 = 0x84C6, - TEXTURE7 = 0x84C7, - TEXTURE8 = 0x84C8, - TEXTURE9 = 0x84C9, - TEXTURE10 = 0x84CA, - TEXTURE11 = 0x84CB, - TEXTURE12 = 0x84CC, - TEXTURE13 = 0x84CD, - TEXTURE14 = 0x84CE, - TEXTURE15 = 0x84CF, - TEXTURE16 = 0x84D0, - TEXTURE17 = 0x84D1, - TEXTURE18 = 0x84D2, - TEXTURE19 = 0x84D3, - TEXTURE20 = 0x84D4, - TEXTURE21 = 0x84D5, - TEXTURE22 = 0x84D6, - TEXTURE23 = 0x84D7, - TEXTURE24 = 0x84D8, - TEXTURE25 = 0x84D9, - TEXTURE26 = 0x84DA, - TEXTURE27 = 0x84DB, - TEXTURE28 = 0x84DC, - TEXTURE29 = 0x84DD, - TEXTURE30 = 0x84DE, - TEXTURE31 = 0x84DF, - ACTIVE_TEXTURE = 0x84E0, - MULTISAMPLE = 0x809D, - SAMPLE_ALPHA_TO_COVERAGE = 0x809E, - SAMPLE_ALPHA_TO_ONE = 0x809F, - SAMPLE_COVERAGE = 0x80A0, - SAMPLE_BUFFERS = 0x80A8, - SAMPLES = 0x80A9, - SAMPLE_COVERAGE_VALUE = 0x80AA, - SAMPLE_COVERAGE_INVERT = 0x80AB, - TEXTURE_CUBE_MAP = 0x8513, - TEXTURE_BINDING_CUBE_MAP = 0x8514, - TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515, - TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516, - TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517, - TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518, - TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519, - TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A, - PROXY_TEXTURE_CUBE_MAP = 0x851B, - MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C, - COMPRESSED_RGB = 0x84ED, - COMPRESSED_RGBA = 0x84EE, - TEXTURE_COMPRESSION_HINT = 0x84EF, - TEXTURE_COMPRESSED_IMAGE_SIZE = 0x86A0, - TEXTURE_COMPRESSED = 0x86A1, - NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2, - COMPRESSED_TEXTURE_FORMATS = 0x86A3, - CLAMP_TO_BORDER = 0x812D, + // Version: 1.4 + BLEND_DST_RGB = 0x80C8, + BLEND_SRC_RGB = 0x80C9, + BLEND_DST_ALPHA = 0x80CA, + BLEND_SRC_ALPHA = 0x80CB, + POINT_FADE_THRESHOLD_SIZE = 0x8128, + DEPTH_COMPONENT16 = 0x81A5, + DEPTH_COMPONENT24 = 0x81A6, + DEPTH_COMPONENT32 = 0x81A7, + MIRRORED_REPEAT = 0x8370, + MAX_TEXTURE_LOD_BIAS = 0x84FD, + TEXTURE_LOD_BIAS = 0x8501, + INCR_WRAP = 0x8507, + DECR_WRAP = 0x8508, + TEXTURE_DEPTH_SIZE = 0x884A, + TEXTURE_COMPARE_MODE = 0x884C, + TEXTURE_COMPARE_FUNC = 0x884D, - // Version: 1.4 - BLEND_DST_RGB = 0x80C8, - BLEND_SRC_RGB = 0x80C9, - BLEND_DST_ALPHA = 0x80CA, - BLEND_SRC_ALPHA = 0x80CB, - POINT_FADE_THRESHOLD_SIZE = 0x8128, - DEPTH_COMPONENT16 = 0x81A5, - DEPTH_COMPONENT24 = 0x81A6, - DEPTH_COMPONENT32 = 0x81A7, - MIRRORED_REPEAT = 0x8370, - MAX_TEXTURE_LOD_BIAS = 0x84FD, - TEXTURE_LOD_BIAS = 0x8501, - INCR_WRAP = 0x8507, - DECR_WRAP = 0x8508, - TEXTURE_DEPTH_SIZE = 0x884A, - TEXTURE_COMPARE_MODE = 0x884C, - TEXTURE_COMPARE_FUNC = 0x884D, + // Version: 1.5 + BUFFER_SIZE = 0x8764, + BUFFER_USAGE = 0x8765, + QUERY_COUNTER_BITS = 0x8864, + CURRENT_QUERY = 0x8865, + QUERY_RESULT = 0x8866, + QUERY_RESULT_AVAILABLE = 0x8867, + ARRAY_BUFFER = 0x8892, + ELEMENT_ARRAY_BUFFER = 0x8893, + ARRAY_BUFFER_BINDING = 0x8894, + ELEMENT_ARRAY_BUFFER_BINDING = 0x8895, + VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F, + READ_ONLY = 0x88B8, + WRITE_ONLY = 0x88B9, + READ_WRITE = 0x88BA, + BUFFER_ACCESS = 0x88BB, + BUFFER_MAPPED = 0x88BC, + BUFFER_MAP_POINTER = 0x88BD, + STREAM_DRAW = 0x88E0, + STREAM_READ = 0x88E1, + STREAM_COPY = 0x88E2, + STATIC_DRAW = 0x88E4, + STATIC_READ = 0x88E5, + STATIC_COPY = 0x88E6, + DYNAMIC_DRAW = 0x88E8, + DYNAMIC_READ = 0x88E9, + DYNAMIC_COPY = 0x88EA, + SAMPLES_PASSED = 0x8914, + SRC1_ALPHA = 0x8589, - // Version: 1.5 - BUFFER_SIZE = 0x8764, - BUFFER_USAGE = 0x8765, - QUERY_COUNTER_BITS = 0x8864, - CURRENT_QUERY = 0x8865, - QUERY_RESULT = 0x8866, - QUERY_RESULT_AVAILABLE = 0x8867, - ARRAY_BUFFER = 0x8892, - ELEMENT_ARRAY_BUFFER = 0x8893, - ARRAY_BUFFER_BINDING = 0x8894, - ELEMENT_ARRAY_BUFFER_BINDING = 0x8895, - VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F, - READ_ONLY = 0x88B8, - WRITE_ONLY = 0x88B9, - READ_WRITE = 0x88BA, - BUFFER_ACCESS = 0x88BB, - BUFFER_MAPPED = 0x88BC, - BUFFER_MAP_POINTER = 0x88BD, - STREAM_DRAW = 0x88E0, - STREAM_READ = 0x88E1, - STREAM_COPY = 0x88E2, - STATIC_DRAW = 0x88E4, - STATIC_READ = 0x88E5, - STATIC_COPY = 0x88E6, - DYNAMIC_DRAW = 0x88E8, - DYNAMIC_READ = 0x88E9, - DYNAMIC_COPY = 0x88EA, - SAMPLES_PASSED = 0x8914, - SRC1_ALPHA = 0x8589, + // Version: 2.0 + BLEND_EQUATION_RGB = 0x8009, + VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622, + VERTEX_ATTRIB_ARRAY_SIZE = 0x8623, + VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624, + VERTEX_ATTRIB_ARRAY_TYPE = 0x8625, + CURRENT_VERTEX_ATTRIB = 0x8626, + VERTEX_PROGRAM_POINT_SIZE = 0x8642, + VERTEX_ATTRIB_ARRAY_POINTER = 0x8645, + STENCIL_BACK_FUNC = 0x8800, + STENCIL_BACK_FAIL = 0x8801, + STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802, + STENCIL_BACK_PASS_DEPTH_PASS = 0x8803, + MAX_DRAW_BUFFERS = 0x8824, + DRAW_BUFFER0 = 0x8825, + DRAW_BUFFER1 = 0x8826, + DRAW_BUFFER2 = 0x8827, + DRAW_BUFFER3 = 0x8828, + DRAW_BUFFER4 = 0x8829, + DRAW_BUFFER5 = 0x882A, + DRAW_BUFFER6 = 0x882B, + DRAW_BUFFER7 = 0x882C, + DRAW_BUFFER8 = 0x882D, + DRAW_BUFFER9 = 0x882E, + DRAW_BUFFER10 = 0x882F, + DRAW_BUFFER11 = 0x8830, + DRAW_BUFFER12 = 0x8831, + DRAW_BUFFER13 = 0x8832, + DRAW_BUFFER14 = 0x8833, + DRAW_BUFFER15 = 0x8834, + BLEND_EQUATION_ALPHA = 0x883D, + MAX_VERTEX_ATTRIBS = 0x8869, + VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A, + MAX_TEXTURE_IMAGE_UNITS = 0x8872, + FRAGMENT_SHADER = 0x8B30, + VERTEX_SHADER = 0x8B31, + MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49, + MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A, + MAX_VARYING_FLOATS = 0x8B4B, + MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C, + MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D, + SHADER_TYPE = 0x8B4F, + FLOAT_VEC2 = 0x8B50, + FLOAT_VEC3 = 0x8B51, + FLOAT_VEC4 = 0x8B52, + INT_VEC2 = 0x8B53, + INT_VEC3 = 0x8B54, + INT_VEC4 = 0x8B55, + BOOL = 0x8B56, + BOOL_VEC2 = 0x8B57, + BOOL_VEC3 = 0x8B58, + BOOL_VEC4 = 0x8B59, + FLOAT_MAT2 = 0x8B5A, + FLOAT_MAT3 = 0x8B5B, + FLOAT_MAT4 = 0x8B5C, + SAMPLER_1D = 0x8B5D, + SAMPLER_2D = 0x8B5E, + SAMPLER_3D = 0x8B5F, + SAMPLER_CUBE = 0x8B60, + SAMPLER_1D_SHADOW = 0x8B61, + SAMPLER_2D_SHADOW = 0x8B62, + DELETE_STATUS = 0x8B80, + COMPILE_STATUS = 0x8B81, + LINK_STATUS = 0x8B82, + VALIDATE_STATUS = 0x8B83, + INFO_LOG_LENGTH = 0x8B84, + ATTACHED_SHADERS = 0x8B85, + ACTIVE_UNIFORMS = 0x8B86, + ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87, + SHADER_SOURCE_LENGTH = 0x8B88, + ACTIVE_ATTRIBUTES = 0x8B89, + ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A, + FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B, + SHADING_LANGUAGE_VERSION = 0x8B8C, + CURRENT_PROGRAM = 0x8B8D, + POINT_SPRITE_COORD_ORIGIN = 0x8CA0, + LOWER_LEFT = 0x8CA1, + UPPER_LEFT = 0x8CA2, + STENCIL_BACK_REF = 0x8CA3, + STENCIL_BACK_VALUE_MASK = 0x8CA4, + STENCIL_BACK_WRITEMASK = 0x8CA5, - // Version: 2.0 - BLEND_EQUATION_RGB = 0x8009, - VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622, - VERTEX_ATTRIB_ARRAY_SIZE = 0x8623, - VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624, - VERTEX_ATTRIB_ARRAY_TYPE = 0x8625, - CURRENT_VERTEX_ATTRIB = 0x8626, - VERTEX_PROGRAM_POINT_SIZE = 0x8642, - VERTEX_ATTRIB_ARRAY_POINTER = 0x8645, - STENCIL_BACK_FUNC = 0x8800, - STENCIL_BACK_FAIL = 0x8801, - STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802, - STENCIL_BACK_PASS_DEPTH_PASS = 0x8803, - MAX_DRAW_BUFFERS = 0x8824, - DRAW_BUFFER0 = 0x8825, - DRAW_BUFFER1 = 0x8826, - DRAW_BUFFER2 = 0x8827, - DRAW_BUFFER3 = 0x8828, - DRAW_BUFFER4 = 0x8829, - DRAW_BUFFER5 = 0x882A, - DRAW_BUFFER6 = 0x882B, - DRAW_BUFFER7 = 0x882C, - DRAW_BUFFER8 = 0x882D, - DRAW_BUFFER9 = 0x882E, - DRAW_BUFFER10 = 0x882F, - DRAW_BUFFER11 = 0x8830, - DRAW_BUFFER12 = 0x8831, - DRAW_BUFFER13 = 0x8832, - DRAW_BUFFER14 = 0x8833, - DRAW_BUFFER15 = 0x8834, - BLEND_EQUATION_ALPHA = 0x883D, - MAX_VERTEX_ATTRIBS = 0x8869, - VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A, - MAX_TEXTURE_IMAGE_UNITS = 0x8872, - FRAGMENT_SHADER = 0x8B30, - VERTEX_SHADER = 0x8B31, - MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49, - MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A, - MAX_VARYING_FLOATS = 0x8B4B, - MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C, - MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D, - SHADER_TYPE = 0x8B4F, - FLOAT_VEC2 = 0x8B50, - FLOAT_VEC3 = 0x8B51, - FLOAT_VEC4 = 0x8B52, - INT_VEC2 = 0x8B53, - INT_VEC3 = 0x8B54, - INT_VEC4 = 0x8B55, - BOOL = 0x8B56, - BOOL_VEC2 = 0x8B57, - BOOL_VEC3 = 0x8B58, - BOOL_VEC4 = 0x8B59, - FLOAT_MAT2 = 0x8B5A, - FLOAT_MAT3 = 0x8B5B, - FLOAT_MAT4 = 0x8B5C, - SAMPLER_1D = 0x8B5D, - SAMPLER_2D = 0x8B5E, - SAMPLER_3D = 0x8B5F, - SAMPLER_CUBE = 0x8B60, - SAMPLER_1D_SHADOW = 0x8B61, - SAMPLER_2D_SHADOW = 0x8B62, - DELETE_STATUS = 0x8B80, - COMPILE_STATUS = 0x8B81, - LINK_STATUS = 0x8B82, - VALIDATE_STATUS = 0x8B83, - INFO_LOG_LENGTH = 0x8B84, - ATTACHED_SHADERS = 0x8B85, - ACTIVE_UNIFORMS = 0x8B86, - ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87, - SHADER_SOURCE_LENGTH = 0x8B88, - ACTIVE_ATTRIBUTES = 0x8B89, - ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A, - FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B, - SHADING_LANGUAGE_VERSION = 0x8B8C, - CURRENT_PROGRAM = 0x8B8D, - POINT_SPRITE_COORD_ORIGIN = 0x8CA0, - LOWER_LEFT = 0x8CA1, - UPPER_LEFT = 0x8CA2, - STENCIL_BACK_REF = 0x8CA3, - STENCIL_BACK_VALUE_MASK = 0x8CA4, - STENCIL_BACK_WRITEMASK = 0x8CA5, + // Version: 2.1 + PIXEL_PACK_BUFFER = 0x88EB, + PIXEL_UNPACK_BUFFER = 0x88EC, + PIXEL_PACK_BUFFER_BINDING = 0x88ED, + PIXEL_UNPACK_BUFFER_BINDING = 0x88EF, + FLOAT_MAT2x3 = 0x8B65, + FLOAT_MAT2x4 = 0x8B66, + FLOAT_MAT3x2 = 0x8B67, + FLOAT_MAT3x4 = 0x8B68, + FLOAT_MAT4x2 = 0x8B69, + FLOAT_MAT4x3 = 0x8B6A, + SRGB = 0x8C40, + SRGB8 = 0x8C41, + SRGB_ALPHA = 0x8C42, + SRGB8_ALPHA8 = 0x8C43, + COMPRESSED_SRGB = 0x8C48, + COMPRESSED_SRGB_ALPHA = 0x8C49, - // Version: 2.1 - PIXEL_PACK_BUFFER = 0x88EB, - PIXEL_UNPACK_BUFFER = 0x88EC, - PIXEL_PACK_BUFFER_BINDING = 0x88ED, - PIXEL_UNPACK_BUFFER_BINDING = 0x88EF, - FLOAT_MAT2x3 = 0x8B65, - FLOAT_MAT2x4 = 0x8B66, - FLOAT_MAT3x2 = 0x8B67, - FLOAT_MAT3x4 = 0x8B68, - FLOAT_MAT4x2 = 0x8B69, - FLOAT_MAT4x3 = 0x8B6A, - SRGB = 0x8C40, - SRGB8 = 0x8C41, - SRGB_ALPHA = 0x8C42, - SRGB8_ALPHA8 = 0x8C43, - COMPRESSED_SRGB = 0x8C48, - COMPRESSED_SRGB_ALPHA = 0x8C49, + // Core Extension: ARB_vertex_array_object + VERTEX_ARRAY_BINDING = 0x85B5, - // Core Extension: ARB_vertex_array_object - VERTEX_ARRAY_BINDING = 0x85B5, + // Core Extension: ARB_texture_rg + RG = 0x8227, + RG_INTEGER = 0x8228, + R8 = 0x8229, + R16 = 0x822A, + RG8 = 0x822B, + RG16 = 0x822C, + R16F = 0x822D, + R32F = 0x822E, + RG16F = 0x822F, + RG32F = 0x8230, + R8I = 0x8231, + R8UI = 0x8232, + R16I = 0x8233, + R16UI = 0x8234, + R32I = 0x8235, + R32UI = 0x8236, + RG8I = 0x8237, + RG8UI = 0x8238, + RG16I = 0x8239, + RG16UI = 0x823A, + RG32I = 0x823B, + RG32UI = 0x823C, - // Core Extension: ARB_texture_rg - RG = 0x8227, - RG_INTEGER = 0x8228, - R8 = 0x8229, - R16 = 0x822A, - RG8 = 0x822B, - RG16 = 0x822C, - R16F = 0x822D, - R32F = 0x822E, - RG16F = 0x822F, - RG32F = 0x8230, - R8I = 0x8231, - R8UI = 0x8232, - R16I = 0x8233, - R16UI = 0x8234, - R32I = 0x8235, - R32UI = 0x8236, - RG8I = 0x8237, - RG8UI = 0x8238, - RG16I = 0x8239, - RG16UI = 0x823A, - RG32I = 0x823B, - RG32UI = 0x823C, + // Core Extension: ARB_texture_compression_rgtc + COMPRESSED_RED_RGTC1 = 0x8DBB, + COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC, + COMPRESSED_RG_RGTC2 = 0x8DBD, + COMPRESSED_SIGNED_RG_RGTC2 = 0x8DBE, - // Core Extension: ARB_texture_compression_rgtc - COMPRESSED_RED_RGTC1 = 0x8DBB, - COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC, - COMPRESSED_RG_RGTC2 = 0x8DBD, - COMPRESSED_SIGNED_RG_RGTC2 = 0x8DBE, + // Core Extension: ARB_map_buffer_range + MAP_READ_BIT = 0x0001, + MAP_WRITE_BIT = 0x0002, + MAP_INVALIDATE_RANGE_BIT = 0x0004, + MAP_INVALIDATE_BUFFER_BIT = 0x0008, + MAP_FLUSH_EXPLICIT_BIT = 0x0010, + MAP_UNSYNCHRONIZED_BIT = 0x0020, - // Core Extension: ARB_map_buffer_range - MAP_READ_BIT = 0x0001, - MAP_WRITE_BIT = 0x0002, - MAP_INVALIDATE_RANGE_BIT = 0x0004, - MAP_INVALIDATE_BUFFER_BIT = 0x0008, - MAP_FLUSH_EXPLICIT_BIT = 0x0010, - MAP_UNSYNCHRONIZED_BIT = 0x0020, + // Core Extension: ARB_half_float_vertex + HALF_FLOAT = 0x140B, - // Core Extension: ARB_half_float_vertex - HALF_FLOAT = 0x140B, + // Core Extension: ARB_framebuffer_sRGB + FRAMEBUFFER_SRGB = 0x8DB9, - // Core Extension: ARB_framebuffer_sRGB - FRAMEBUFFER_SRGB = 0x8DB9, + // Core Extension: ARB_framebuffer_object + INVALID_FRAMEBUFFER_OPERATION = 0x0506, + FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210, + FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211, + FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212, + FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213, + FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214, + FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215, + FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216, + FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217, + FRAMEBUFFER_DEFAULT = 0x8218, + FRAMEBUFFER_UNDEFINED = 0x8219, + DEPTH_STENCIL_ATTACHMENT = 0x821A, + INDEX = 0x8222, + MAX_RENDERBUFFER_SIZE = 0x84E8, + DEPTH_STENCIL = 0x84F9, + UNSIGNED_INT_24_8 = 0x84FA, + DEPTH24_STENCIL8 = 0x88F0, + TEXTURE_STENCIL_SIZE = 0x88F1, + TEXTURE_RED_TYPE = 0x8C10, + TEXTURE_GREEN_TYPE = 0x8C11, + TEXTURE_BLUE_TYPE = 0x8C12, + TEXTURE_ALPHA_TYPE = 0x8C13, + TEXTURE_DEPTH_TYPE = 0x8C16, + UNSIGNED_NORMALIZED = 0x8C17, + FRAMEBUFFER_BINDING = 0x8CA6, + DRAW_FRAMEBUFFER_BINDING = 0x8CA6, + RENDERBUFFER_BINDING = 0x8CA7, + READ_FRAMEBUFFER = 0x8CA8, + DRAW_FRAMEBUFFER = 0x8CA9, + READ_FRAMEBUFFER_BINDING = 0x8CAA, + RENDERBUFFER_SAMPLES = 0x8CAB, + FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0, + FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1, + FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2, + FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3, + FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4, + FRAMEBUFFER_COMPLETE = 0x8CD5, + FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6, + FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7, + FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 0x8CDB, + FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC, + FRAMEBUFFER_UNSUPPORTED = 0x8CDD, + MAX_COLOR_ATTACHMENTS = 0x8CDF, + COLOR_ATTACHMENT0 = 0x8CE0, + COLOR_ATTACHMENT1 = 0x8CE1, + COLOR_ATTACHMENT2 = 0x8CE2, + COLOR_ATTACHMENT3 = 0x8CE3, + COLOR_ATTACHMENT4 = 0x8CE4, + COLOR_ATTACHMENT5 = 0x8CE5, + COLOR_ATTACHMENT6 = 0x8CE6, + COLOR_ATTACHMENT7 = 0x8CE7, + COLOR_ATTACHMENT8 = 0x8CE8, + COLOR_ATTACHMENT9 = 0x8CE9, + COLOR_ATTACHMENT10 = 0x8CEA, + COLOR_ATTACHMENT11 = 0x8CEB, + COLOR_ATTACHMENT12 = 0x8CEC, + COLOR_ATTACHMENT13 = 0x8CED, + COLOR_ATTACHMENT14 = 0x8CEE, + COLOR_ATTACHMENT15 = 0x8CEF, + DEPTH_ATTACHMENT = 0x8D00, + STENCIL_ATTACHMENT = 0x8D20, + FRAMEBUFFER = 0x8D40, + RENDERBUFFER = 0x8D41, + RENDERBUFFER_WIDTH = 0x8D42, + RENDERBUFFER_HEIGHT = 0x8D43, + RENDERBUFFER_INTERNAL_FORMAT = 0x8D44, + STENCIL_INDEX1 = 0x8D46, + STENCIL_INDEX4 = 0x8D47, + STENCIL_INDEX8 = 0x8D48, + STENCIL_INDEX16 = 0x8D49, + RENDERBUFFER_RED_SIZE = 0x8D50, + RENDERBUFFER_GREEN_SIZE = 0x8D51, + RENDERBUFFER_BLUE_SIZE = 0x8D52, + RENDERBUFFER_ALPHA_SIZE = 0x8D53, + RENDERBUFFER_DEPTH_SIZE = 0x8D54, + RENDERBUFFER_STENCIL_SIZE = 0x8D55, + FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56, + MAX_SAMPLES = 0x8D57, + TEXTURE_LUMINANCE_TYPE = 0x8C14, + TEXTURE_INTENSITY_TYPE = 0x8C15, - // Core Extension: ARB_framebuffer_object - INVALID_FRAMEBUFFER_OPERATION = 0x0506, - FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210, - FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211, - FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212, - FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213, - FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214, - FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215, - FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216, - FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217, - FRAMEBUFFER_DEFAULT = 0x8218, - FRAMEBUFFER_UNDEFINED = 0x8219, - DEPTH_STENCIL_ATTACHMENT = 0x821A, - INDEX = 0x8222, - MAX_RENDERBUFFER_SIZE = 0x84E8, - DEPTH_STENCIL = 0x84F9, - UNSIGNED_INT_24_8 = 0x84FA, - DEPTH24_STENCIL8 = 0x88F0, - TEXTURE_STENCIL_SIZE = 0x88F1, - TEXTURE_RED_TYPE = 0x8C10, - TEXTURE_GREEN_TYPE = 0x8C11, - TEXTURE_BLUE_TYPE = 0x8C12, - TEXTURE_ALPHA_TYPE = 0x8C13, - TEXTURE_DEPTH_TYPE = 0x8C16, - UNSIGNED_NORMALIZED = 0x8C17, - FRAMEBUFFER_BINDING = 0x8CA6, - DRAW_FRAMEBUFFER_BINDING = 0x8CA6, - RENDERBUFFER_BINDING = 0x8CA7, - READ_FRAMEBUFFER = 0x8CA8, - DRAW_FRAMEBUFFER = 0x8CA9, - READ_FRAMEBUFFER_BINDING = 0x8CAA, - RENDERBUFFER_SAMPLES = 0x8CAB, - FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0, - FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1, - FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2, - FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3, - FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4, - FRAMEBUFFER_COMPLETE = 0x8CD5, - FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6, - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7, - FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 0x8CDB, - FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC, - FRAMEBUFFER_UNSUPPORTED = 0x8CDD, - MAX_COLOR_ATTACHMENTS = 0x8CDF, - COLOR_ATTACHMENT0 = 0x8CE0, - COLOR_ATTACHMENT1 = 0x8CE1, - COLOR_ATTACHMENT2 = 0x8CE2, - COLOR_ATTACHMENT3 = 0x8CE3, - COLOR_ATTACHMENT4 = 0x8CE4, - COLOR_ATTACHMENT5 = 0x8CE5, - COLOR_ATTACHMENT6 = 0x8CE6, - COLOR_ATTACHMENT7 = 0x8CE7, - COLOR_ATTACHMENT8 = 0x8CE8, - COLOR_ATTACHMENT9 = 0x8CE9, - COLOR_ATTACHMENT10 = 0x8CEA, - COLOR_ATTACHMENT11 = 0x8CEB, - COLOR_ATTACHMENT12 = 0x8CEC, - COLOR_ATTACHMENT13 = 0x8CED, - COLOR_ATTACHMENT14 = 0x8CEE, - COLOR_ATTACHMENT15 = 0x8CEF, - DEPTH_ATTACHMENT = 0x8D00, - STENCIL_ATTACHMENT = 0x8D20, - FRAMEBUFFER = 0x8D40, - RENDERBUFFER = 0x8D41, - RENDERBUFFER_WIDTH = 0x8D42, - RENDERBUFFER_HEIGHT = 0x8D43, - RENDERBUFFER_INTERNAL_FORMAT = 0x8D44, - STENCIL_INDEX1 = 0x8D46, - STENCIL_INDEX4 = 0x8D47, - STENCIL_INDEX8 = 0x8D48, - STENCIL_INDEX16 = 0x8D49, - RENDERBUFFER_RED_SIZE = 0x8D50, - RENDERBUFFER_GREEN_SIZE = 0x8D51, - RENDERBUFFER_BLUE_SIZE = 0x8D52, - RENDERBUFFER_ALPHA_SIZE = 0x8D53, - RENDERBUFFER_DEPTH_SIZE = 0x8D54, - RENDERBUFFER_STENCIL_SIZE = 0x8D55, - FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56, - MAX_SAMPLES = 0x8D57, - TEXTURE_LUMINANCE_TYPE = 0x8C14, - TEXTURE_INTENSITY_TYPE = 0x8C15, + // Core Extension: ARB_depth_buffer_float + DEPTH_COMPONENT32F = 0x8CAC, + DEPTH32F_STENCIL8 = 0x8CAD, + FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD, - // Core Extension: ARB_depth_buffer_float - DEPTH_COMPONENT32F = 0x8CAC, - DEPTH32F_STENCIL8 = 0x8CAD, - FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD, + // Version: 3.0 + COMPARE_REF_TO_TEXTURE = 0x884E, + CLIP_DISTANCE0 = 0x3000, + CLIP_DISTANCE1 = 0x3001, + CLIP_DISTANCE2 = 0x3002, + CLIP_DISTANCE3 = 0x3003, + CLIP_DISTANCE4 = 0x3004, + CLIP_DISTANCE5 = 0x3005, + CLIP_DISTANCE6 = 0x3006, + CLIP_DISTANCE7 = 0x3007, + MAX_CLIP_DISTANCES = 0x0D32, + MAJOR_VERSION = 0x821B, + MINOR_VERSION = 0x821C, + NUM_EXTENSIONS = 0x821D, + CONTEXT_FLAGS = 0x821E, + COMPRESSED_RED = 0x8225, + COMPRESSED_RG = 0x8226, + CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT = 0x0001, + RGBA32F = 0x8814, + RGB32F = 0x8815, + RGBA16F = 0x881A, + RGB16F = 0x881B, + VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD, + MAX_ARRAY_TEXTURE_LAYERS = 0x88FF, + MIN_PROGRAM_TEXEL_OFFSET = 0x8904, + MAX_PROGRAM_TEXEL_OFFSET = 0x8905, + CLAMP_READ_COLOR = 0x891C, + FIXED_ONLY = 0x891D, + TEXTURE_1D_ARRAY = 0x8C18, + PROXY_TEXTURE_1D_ARRAY = 0x8C19, + TEXTURE_2D_ARRAY = 0x8C1A, + PROXY_TEXTURE_2D_ARRAY = 0x8C1B, + TEXTURE_BINDING_1D_ARRAY = 0x8C1C, + TEXTURE_BINDING_2D_ARRAY = 0x8C1D, + R11F_G11F_B10F = 0x8C3A, + UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B, + RGB9_E5 = 0x8C3D, + UNSIGNED_INT_5_9_9_9_REV = 0x8C3E, + TEXTURE_SHARED_SIZE = 0x8C3F, + TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 0x8C76, + TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F, + MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80, + TRANSFORM_FEEDBACK_VARYINGS = 0x8C83, + TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84, + TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85, + PRIMITIVES_GENERATED = 0x8C87, + TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88, + RASTERIZER_DISCARD = 0x8C89, + MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A, + MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B, + INTERLEAVED_ATTRIBS = 0x8C8C, + SEPARATE_ATTRIBS = 0x8C8D, + TRANSFORM_FEEDBACK_BUFFER = 0x8C8E, + TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F, + RGBA32UI = 0x8D70, + RGB32UI = 0x8D71, + RGBA16UI = 0x8D76, + RGB16UI = 0x8D77, + RGBA8UI = 0x8D7C, + RGB8UI = 0x8D7D, + RGBA32I = 0x8D82, + RGB32I = 0x8D83, + RGBA16I = 0x8D88, + RGB16I = 0x8D89, + RGBA8I = 0x8D8E, + RGB8I = 0x8D8F, + RED_INTEGER = 0x8D94, + GREEN_INTEGER = 0x8D95, + BLUE_INTEGER = 0x8D96, + RGB_INTEGER = 0x8D98, + RGBA_INTEGER = 0x8D99, + BGR_INTEGER = 0x8D9A, + BGRA_INTEGER = 0x8D9B, + SAMPLER_1D_ARRAY = 0x8DC0, + SAMPLER_2D_ARRAY = 0x8DC1, + SAMPLER_1D_ARRAY_SHADOW = 0x8DC3, + SAMPLER_2D_ARRAY_SHADOW = 0x8DC4, + SAMPLER_CUBE_SHADOW = 0x8DC5, + UNSIGNED_INT_VEC2 = 0x8DC6, + UNSIGNED_INT_VEC3 = 0x8DC7, + UNSIGNED_INT_VEC4 = 0x8DC8, + INT_SAMPLER_1D = 0x8DC9, + INT_SAMPLER_2D = 0x8DCA, + INT_SAMPLER_3D = 0x8DCB, + INT_SAMPLER_CUBE = 0x8DCC, + INT_SAMPLER_1D_ARRAY = 0x8DCE, + INT_SAMPLER_2D_ARRAY = 0x8DCF, + UNSIGNED_INT_SAMPLER_1D = 0x8DD1, + UNSIGNED_INT_SAMPLER_2D = 0x8DD2, + UNSIGNED_INT_SAMPLER_3D = 0x8DD3, + UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4, + UNSIGNED_INT_SAMPLER_1D_ARRAY = 0x8DD6, + UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7, + QUERY_WAIT = 0x8E13, + QUERY_NO_WAIT = 0x8E14, + QUERY_BY_REGION_WAIT = 0x8E15, + QUERY_BY_REGION_NO_WAIT = 0x8E16, + BUFFER_ACCESS_FLAGS = 0x911F, + BUFFER_MAP_LENGTH = 0x9120, + BUFFER_MAP_OFFSET = 0x9121, - // Version: 3.0 - COMPARE_REF_TO_TEXTURE = 0x884E, - CLIP_DISTANCE0 = 0x3000, - CLIP_DISTANCE1 = 0x3001, - CLIP_DISTANCE2 = 0x3002, - CLIP_DISTANCE3 = 0x3003, - CLIP_DISTANCE4 = 0x3004, - CLIP_DISTANCE5 = 0x3005, - CLIP_DISTANCE6 = 0x3006, - CLIP_DISTANCE7 = 0x3007, - MAX_CLIP_DISTANCES = 0x0D32, - MAJOR_VERSION = 0x821B, - MINOR_VERSION = 0x821C, - NUM_EXTENSIONS = 0x821D, - CONTEXT_FLAGS = 0x821E, - COMPRESSED_RED = 0x8225, - COMPRESSED_RG = 0x8226, - CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT = 0x0001, - RGBA32F = 0x8814, - RGB32F = 0x8815, - RGBA16F = 0x881A, - RGB16F = 0x881B, - VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD, - MAX_ARRAY_TEXTURE_LAYERS = 0x88FF, - MIN_PROGRAM_TEXEL_OFFSET = 0x8904, - MAX_PROGRAM_TEXEL_OFFSET = 0x8905, - CLAMP_READ_COLOR = 0x891C, - FIXED_ONLY = 0x891D, - TEXTURE_1D_ARRAY = 0x8C18, - PROXY_TEXTURE_1D_ARRAY = 0x8C19, - TEXTURE_2D_ARRAY = 0x8C1A, - PROXY_TEXTURE_2D_ARRAY = 0x8C1B, - TEXTURE_BINDING_1D_ARRAY = 0x8C1C, - TEXTURE_BINDING_2D_ARRAY = 0x8C1D, - R11F_G11F_B10F = 0x8C3A, - UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B, - RGB9_E5 = 0x8C3D, - UNSIGNED_INT_5_9_9_9_REV = 0x8C3E, - TEXTURE_SHARED_SIZE = 0x8C3F, - TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 0x8C76, - TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F, - MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80, - TRANSFORM_FEEDBACK_VARYINGS = 0x8C83, - TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84, - TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85, - PRIMITIVES_GENERATED = 0x8C87, - TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88, - RASTERIZER_DISCARD = 0x8C89, - MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A, - MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B, - INTERLEAVED_ATTRIBS = 0x8C8C, - SEPARATE_ATTRIBS = 0x8C8D, - TRANSFORM_FEEDBACK_BUFFER = 0x8C8E, - TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F, - RGBA32UI = 0x8D70, - RGB32UI = 0x8D71, - RGBA16UI = 0x8D76, - RGB16UI = 0x8D77, - RGBA8UI = 0x8D7C, - RGB8UI = 0x8D7D, - RGBA32I = 0x8D82, - RGB32I = 0x8D83, - RGBA16I = 0x8D88, - RGB16I = 0x8D89, - RGBA8I = 0x8D8E, - RGB8I = 0x8D8F, - RED_INTEGER = 0x8D94, - GREEN_INTEGER = 0x8D95, - BLUE_INTEGER = 0x8D96, - RGB_INTEGER = 0x8D98, - RGBA_INTEGER = 0x8D99, - BGR_INTEGER = 0x8D9A, - BGRA_INTEGER = 0x8D9B, - SAMPLER_1D_ARRAY = 0x8DC0, - SAMPLER_2D_ARRAY = 0x8DC1, - SAMPLER_1D_ARRAY_SHADOW = 0x8DC3, - SAMPLER_2D_ARRAY_SHADOW = 0x8DC4, - SAMPLER_CUBE_SHADOW = 0x8DC5, - UNSIGNED_INT_VEC2 = 0x8DC6, - UNSIGNED_INT_VEC3 = 0x8DC7, - UNSIGNED_INT_VEC4 = 0x8DC8, - INT_SAMPLER_1D = 0x8DC9, - INT_SAMPLER_2D = 0x8DCA, - INT_SAMPLER_3D = 0x8DCB, - INT_SAMPLER_CUBE = 0x8DCC, - INT_SAMPLER_1D_ARRAY = 0x8DCE, - INT_SAMPLER_2D_ARRAY = 0x8DCF, - UNSIGNED_INT_SAMPLER_1D = 0x8DD1, - UNSIGNED_INT_SAMPLER_2D = 0x8DD2, - UNSIGNED_INT_SAMPLER_3D = 0x8DD3, - UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4, - UNSIGNED_INT_SAMPLER_1D_ARRAY = 0x8DD6, - UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7, - QUERY_WAIT = 0x8E13, - QUERY_NO_WAIT = 0x8E14, - QUERY_BY_REGION_WAIT = 0x8E15, - QUERY_BY_REGION_NO_WAIT = 0x8E16, - BUFFER_ACCESS_FLAGS = 0x911F, - BUFFER_MAP_LENGTH = 0x9120, - BUFFER_MAP_OFFSET = 0x9121, + // Core Extension: ARB_uniform_buffer_object + UNIFORM_BUFFER = 0x8A11, + UNIFORM_BUFFER_BINDING = 0x8A28, + UNIFORM_BUFFER_START = 0x8A29, + UNIFORM_BUFFER_SIZE = 0x8A2A, + MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B, + MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D, + MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E, + MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F, + MAX_UNIFORM_BLOCK_SIZE = 0x8A30, + MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31, + MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33, + UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34, + ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 0x8A35, + ACTIVE_UNIFORM_BLOCKS = 0x8A36, + UNIFORM_TYPE = 0x8A37, + UNIFORM_SIZE = 0x8A38, + UNIFORM_NAME_LENGTH = 0x8A39, + UNIFORM_BLOCK_INDEX = 0x8A3A, + UNIFORM_OFFSET = 0x8A3B, + UNIFORM_ARRAY_STRIDE = 0x8A3C, + UNIFORM_MATRIX_STRIDE = 0x8A3D, + UNIFORM_IS_ROW_MAJOR = 0x8A3E, + UNIFORM_BLOCK_BINDING = 0x8A3F, + UNIFORM_BLOCK_DATA_SIZE = 0x8A40, + UNIFORM_BLOCK_NAME_LENGTH = 0x8A41, + UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42, + UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43, + UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44, + UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46, + INVALID_INDEX = 0xFFFFFFFF, + MAX_GEOMETRY_UNIFORM_BLOCKS = 0x8A2C, + MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = 0x8A32, + UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER = 0x8A45, - // Core Extension: ARB_uniform_buffer_object - UNIFORM_BUFFER = 0x8A11, - UNIFORM_BUFFER_BINDING = 0x8A28, - UNIFORM_BUFFER_START = 0x8A29, - UNIFORM_BUFFER_SIZE = 0x8A2A, - MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B, - MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D, - MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E, - MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F, - MAX_UNIFORM_BLOCK_SIZE = 0x8A30, - MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31, - MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33, - UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34, - ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 0x8A35, - ACTIVE_UNIFORM_BLOCKS = 0x8A36, - UNIFORM_TYPE = 0x8A37, - UNIFORM_SIZE = 0x8A38, - UNIFORM_NAME_LENGTH = 0x8A39, - UNIFORM_BLOCK_INDEX = 0x8A3A, - UNIFORM_OFFSET = 0x8A3B, - UNIFORM_ARRAY_STRIDE = 0x8A3C, - UNIFORM_MATRIX_STRIDE = 0x8A3D, - UNIFORM_IS_ROW_MAJOR = 0x8A3E, - UNIFORM_BLOCK_BINDING = 0x8A3F, - UNIFORM_BLOCK_DATA_SIZE = 0x8A40, - UNIFORM_BLOCK_NAME_LENGTH = 0x8A41, - UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42, - UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43, - UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44, - UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46, - INVALID_INDEX = 0xFFFFFFFF, - MAX_GEOMETRY_UNIFORM_BLOCKS = 0x8A2C, - MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = 0x8A32, - UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER = 0x8A45, + // Core Extension: ARB_copy_buffer + COPY_READ_BUFFER = 0x8F36, + COPY_WRITE_BUFFER = 0x8F37, + COPY_READ_BUFFER_BINDING = 0x8F36, + COPY_WRITE_BUFFER_BINDING = 0x8F37, - // Core Extension: ARB_copy_buffer - COPY_READ_BUFFER = 0x8F36, - COPY_WRITE_BUFFER = 0x8F37, - COPY_READ_BUFFER_BINDING = 0x8F36, - COPY_WRITE_BUFFER_BINDING = 0x8F37, + // Version: 3.1 + SAMPLER_2D_RECT = 0x8B63, + SAMPLER_2D_RECT_SHADOW = 0x8B64, + SAMPLER_BUFFER = 0x8DC2, + INT_SAMPLER_2D_RECT = 0x8DCD, + INT_SAMPLER_BUFFER = 0x8DD0, + UNSIGNED_INT_SAMPLER_2D_RECT = 0x8DD5, + UNSIGNED_INT_SAMPLER_BUFFER = 0x8DD8, + TEXTURE_BUFFER = 0x8C2A, + MAX_TEXTURE_BUFFER_SIZE = 0x8C2B, + TEXTURE_BINDING_BUFFER = 0x8C2C, + TEXTURE_BUFFER_DATA_STORE_BINDING = 0x8C2D, + TEXTURE_RECTANGLE = 0x84F5, + TEXTURE_BINDING_RECTANGLE = 0x84F6, + PROXY_TEXTURE_RECTANGLE = 0x84F7, + MAX_RECTANGLE_TEXTURE_SIZE = 0x84F8, + RED_SNORM = 0x8F90, + RG_SNORM = 0x8F91, + RGB_SNORM = 0x8F92, + RGBA_SNORM = 0x8F93, + R8_SNORM = 0x8F94, + RG8_SNORM = 0x8F95, + RGB8_SNORM = 0x8F96, + RGBA8_SNORM = 0x8F97, + R16_SNORM = 0x8F98, + RG16_SNORM = 0x8F99, + RGB16_SNORM = 0x8F9A, + RGBA16_SNORM = 0x8F9B, + SIGNED_NORMALIZED = 0x8F9C, + PRIMITIVE_RESTART = 0x8F9D, + PRIMITIVE_RESTART_INDEX = 0x8F9E, - // Version: 3.1 - SAMPLER_2D_RECT = 0x8B63, - SAMPLER_2D_RECT_SHADOW = 0x8B64, - SAMPLER_BUFFER = 0x8DC2, - INT_SAMPLER_2D_RECT = 0x8DCD, - INT_SAMPLER_BUFFER = 0x8DD0, - UNSIGNED_INT_SAMPLER_2D_RECT = 0x8DD5, - UNSIGNED_INT_SAMPLER_BUFFER = 0x8DD8, - TEXTURE_BUFFER = 0x8C2A, - MAX_TEXTURE_BUFFER_SIZE = 0x8C2B, - TEXTURE_BINDING_BUFFER = 0x8C2C, - TEXTURE_BUFFER_DATA_STORE_BINDING = 0x8C2D, - TEXTURE_RECTANGLE = 0x84F5, - TEXTURE_BINDING_RECTANGLE = 0x84F6, - PROXY_TEXTURE_RECTANGLE = 0x84F7, - MAX_RECTANGLE_TEXTURE_SIZE = 0x84F8, - RED_SNORM = 0x8F90, - RG_SNORM = 0x8F91, - RGB_SNORM = 0x8F92, - RGBA_SNORM = 0x8F93, - R8_SNORM = 0x8F94, - RG8_SNORM = 0x8F95, - RGB8_SNORM = 0x8F96, - RGBA8_SNORM = 0x8F97, - R16_SNORM = 0x8F98, - RG16_SNORM = 0x8F99, - RGB16_SNORM = 0x8F9A, - RGBA16_SNORM = 0x8F9B, - SIGNED_NORMALIZED = 0x8F9C, - PRIMITIVE_RESTART = 0x8F9D, - PRIMITIVE_RESTART_INDEX = 0x8F9E, + // Legacy + VERTEX_ARRAY = 0x8074, + NORMAL_ARRAY = 0x8075, + COLOR_ARRAY = 0x8076, + TEXTURE_COORD_ARRAY = 0x8078, + TEXTURE_ENV = 0x2300, + TEXTURE_ENV_MODE = 0x2200, + MODELVIEW = 0x1700, + PROJECTION = 0x1701, + LIGHTING = 0x0B50 + }; - }; + // Extension: 1.1 + extern void (CODEGEN_FUNCPTR *CullFace)(GLenum mode); + extern void (CODEGEN_FUNCPTR *FrontFace)(GLenum mode); + extern void (CODEGEN_FUNCPTR *Hint)(GLenum target, GLenum mode); + extern void (CODEGEN_FUNCPTR *LineWidth)(GLfloat width); + extern void (CODEGEN_FUNCPTR *PointSize)(GLfloat size); + extern void (CODEGEN_FUNCPTR *PolygonMode)(GLenum face, GLenum mode); + extern void (CODEGEN_FUNCPTR *Scissor)(GLint x, GLint y, GLsizei width, GLsizei height); + extern void (CODEGEN_FUNCPTR *TexParameterf)(GLenum target, GLenum pname, GLfloat param); + extern void (CODEGEN_FUNCPTR *TexParameterfv)(GLenum target, GLenum pname, const GLfloat *params); + extern void (CODEGEN_FUNCPTR *TexParameteri)(GLenum target, GLenum pname, GLint param); + extern void (CODEGEN_FUNCPTR *TexParameteriv)(GLenum target, GLenum pname, const GLint *params); + extern void (CODEGEN_FUNCPTR *TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); + extern void (CODEGEN_FUNCPTR *TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); + extern void (CODEGEN_FUNCPTR *DrawBuffer)(GLenum mode); + extern void (CODEGEN_FUNCPTR *Clear)(GLbitfield mask); + extern void (CODEGEN_FUNCPTR *ClearColor)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); + extern void (CODEGEN_FUNCPTR *ClearStencil)(GLint s); + extern void (CODEGEN_FUNCPTR *ClearDepth)(GLdouble depth); + extern void (CODEGEN_FUNCPTR *StencilMask)(GLuint mask); + extern void (CODEGEN_FUNCPTR *ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); + extern void (CODEGEN_FUNCPTR *DepthMask)(GLboolean flag); + extern void (CODEGEN_FUNCPTR *Disable)(GLenum cap); + extern void (CODEGEN_FUNCPTR *Enable)(GLenum cap); + extern void (CODEGEN_FUNCPTR *Finish)(); + extern void (CODEGEN_FUNCPTR *Flush)(); + extern void (CODEGEN_FUNCPTR *BlendFunc)(GLenum sfactor, GLenum dfactor); + extern void (CODEGEN_FUNCPTR *LogicOp)(GLenum opcode); + extern void (CODEGEN_FUNCPTR *StencilFunc)(GLenum func, GLint ref, GLuint mask); + extern void (CODEGEN_FUNCPTR *StencilOp)(GLenum fail, GLenum zfail, GLenum zpass); + extern void (CODEGEN_FUNCPTR *DepthFunc)(GLenum func); + extern void (CODEGEN_FUNCPTR *PixelStoref)(GLenum pname, GLfloat param); + extern void (CODEGEN_FUNCPTR *PixelStorei)(GLenum pname, GLint param); + extern void (CODEGEN_FUNCPTR *ReadBuffer)(GLenum mode); + extern void (CODEGEN_FUNCPTR *ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); + extern void (CODEGEN_FUNCPTR *GetBooleanv)(GLenum pname, GLboolean *params); + extern void (CODEGEN_FUNCPTR *GetDoublev)(GLenum pname, GLdouble *params); + extern GLenum (CODEGEN_FUNCPTR *GetError)(); + extern void (CODEGEN_FUNCPTR *GetFloatv)(GLenum pname, GLfloat *params); + extern void (CODEGEN_FUNCPTR *GetIntegerv)(GLenum pname, GLint *params); + extern const GLubyte * (CODEGEN_FUNCPTR *GetString)(GLenum name); + extern void (CODEGEN_FUNCPTR *GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); + extern void (CODEGEN_FUNCPTR *GetTexParameterfv)(GLenum target, GLenum pname, GLfloat *params); + extern void (CODEGEN_FUNCPTR *GetTexParameteriv)(GLenum target, GLenum pname, GLint *params); + extern void (CODEGEN_FUNCPTR *GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat *params); + extern void (CODEGEN_FUNCPTR *GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params); + extern GLboolean (CODEGEN_FUNCPTR *IsEnabled)(GLenum cap); + extern void (CODEGEN_FUNCPTR *DepthRange)(GLdouble ren_near, GLdouble ren_far); + extern void (CODEGEN_FUNCPTR *Viewport)(GLint x, GLint y, GLsizei width, GLsizei height); + extern void (CODEGEN_FUNCPTR *DrawArrays)(GLenum mode, GLint first, GLsizei count); + extern void (CODEGEN_FUNCPTR *DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); + extern void (CODEGEN_FUNCPTR *GetPointerv)(GLenum pname, GLvoid* *params); + extern void (CODEGEN_FUNCPTR *PolygonOffset)(GLfloat factor, GLfloat units); + extern void (CODEGEN_FUNCPTR *CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); + extern void (CODEGEN_FUNCPTR *CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); + extern void (CODEGEN_FUNCPTR *CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); + extern void (CODEGEN_FUNCPTR *CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); + extern void (CODEGEN_FUNCPTR *TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); + extern void (CODEGEN_FUNCPTR *TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); + extern void (CODEGEN_FUNCPTR *BindTexture)(GLenum target, GLuint texture); + extern void (CODEGEN_FUNCPTR *DeleteTextures)(GLsizei n, const GLuint *textures); + extern void (CODEGEN_FUNCPTR *GenTextures)(GLsizei n, GLuint *textures); + extern GLboolean (CODEGEN_FUNCPTR *IsTexture)(GLuint texture); + extern void (CODEGEN_FUNCPTR *Indexub)(GLubyte c); + extern void (CODEGEN_FUNCPTR *Indexubv)(const GLubyte *c); - // Extension: 1.1 - extern void (CODEGEN_FUNCPTR *CullFace)(GLenum mode); - extern void (CODEGEN_FUNCPTR *FrontFace)(GLenum mode); - extern void (CODEGEN_FUNCPTR *Hint)(GLenum target, GLenum mode); - extern void (CODEGEN_FUNCPTR *LineWidth)(GLfloat width); - extern void (CODEGEN_FUNCPTR *PointSize)(GLfloat size); - extern void (CODEGEN_FUNCPTR *PolygonMode)(GLenum face, GLenum mode); - extern void (CODEGEN_FUNCPTR *Scissor)(GLint x, GLint y, GLsizei width, GLsizei height); - extern void (CODEGEN_FUNCPTR *TexParameterf)(GLenum target, GLenum pname, GLfloat param); - extern void (CODEGEN_FUNCPTR *TexParameterfv)(GLenum target, GLenum pname, const GLfloat *params); - extern void (CODEGEN_FUNCPTR *TexParameteri)(GLenum target, GLenum pname, GLint param); - extern void (CODEGEN_FUNCPTR *TexParameteriv)(GLenum target, GLenum pname, const GLint *params); - extern void (CODEGEN_FUNCPTR *TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); - extern void (CODEGEN_FUNCPTR *TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); - extern void (CODEGEN_FUNCPTR *DrawBuffer)(GLenum mode); - extern void (CODEGEN_FUNCPTR *Clear)(GLbitfield mask); - extern void (CODEGEN_FUNCPTR *ClearColor)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); - extern void (CODEGEN_FUNCPTR *ClearStencil)(GLint s); - extern void (CODEGEN_FUNCPTR *ClearDepth)(GLdouble depth); - extern void (CODEGEN_FUNCPTR *StencilMask)(GLuint mask); - extern void (CODEGEN_FUNCPTR *ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); - extern void (CODEGEN_FUNCPTR *DepthMask)(GLboolean flag); - extern void (CODEGEN_FUNCPTR *Disable)(GLenum cap); - extern void (CODEGEN_FUNCPTR *Enable)(GLenum cap); - extern void (CODEGEN_FUNCPTR *Finish)(); - extern void (CODEGEN_FUNCPTR *Flush)(); - extern void (CODEGEN_FUNCPTR *BlendFunc)(GLenum sfactor, GLenum dfactor); - extern void (CODEGEN_FUNCPTR *LogicOp)(GLenum opcode); - extern void (CODEGEN_FUNCPTR *StencilFunc)(GLenum func, GLint ref, GLuint mask); - extern void (CODEGEN_FUNCPTR *StencilOp)(GLenum fail, GLenum zfail, GLenum zpass); - extern void (CODEGEN_FUNCPTR *DepthFunc)(GLenum func); - extern void (CODEGEN_FUNCPTR *PixelStoref)(GLenum pname, GLfloat param); - extern void (CODEGEN_FUNCPTR *PixelStorei)(GLenum pname, GLint param); - extern void (CODEGEN_FUNCPTR *ReadBuffer)(GLenum mode); - extern void (CODEGEN_FUNCPTR *ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); - extern void (CODEGEN_FUNCPTR *GetBooleanv)(GLenum pname, GLboolean *params); - extern void (CODEGEN_FUNCPTR *GetDoublev)(GLenum pname, GLdouble *params); - extern GLenum (CODEGEN_FUNCPTR *GetError)(); - extern void (CODEGEN_FUNCPTR *GetFloatv)(GLenum pname, GLfloat *params); - extern void (CODEGEN_FUNCPTR *GetIntegerv)(GLenum pname, GLint *params); - extern const GLubyte * (CODEGEN_FUNCPTR *GetString)(GLenum name); - extern void (CODEGEN_FUNCPTR *GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); - extern void (CODEGEN_FUNCPTR *GetTexParameterfv)(GLenum target, GLenum pname, GLfloat *params); - extern void (CODEGEN_FUNCPTR *GetTexParameteriv)(GLenum target, GLenum pname, GLint *params); - extern void (CODEGEN_FUNCPTR *GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat *params); - extern void (CODEGEN_FUNCPTR *GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params); - extern GLboolean (CODEGEN_FUNCPTR *IsEnabled)(GLenum cap); - extern void (CODEGEN_FUNCPTR *DepthRange)(GLdouble ren_near, GLdouble ren_far); - extern void (CODEGEN_FUNCPTR *Viewport)(GLint x, GLint y, GLsizei width, GLsizei height); - extern void (CODEGEN_FUNCPTR *DrawArrays)(GLenum mode, GLint first, GLsizei count); - extern void (CODEGEN_FUNCPTR *DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); - extern void (CODEGEN_FUNCPTR *GetPointerv)(GLenum pname, GLvoid* *params); - extern void (CODEGEN_FUNCPTR *PolygonOffset)(GLfloat factor, GLfloat units); - extern void (CODEGEN_FUNCPTR *CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); - extern void (CODEGEN_FUNCPTR *CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); - extern void (CODEGEN_FUNCPTR *CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); - extern void (CODEGEN_FUNCPTR *CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); - extern void (CODEGEN_FUNCPTR *TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); - extern void (CODEGEN_FUNCPTR *TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); - extern void (CODEGEN_FUNCPTR *BindTexture)(GLenum target, GLuint texture); - extern void (CODEGEN_FUNCPTR *DeleteTextures)(GLsizei n, const GLuint *textures); - extern void (CODEGEN_FUNCPTR *GenTextures)(GLsizei n, GLuint *textures); - extern GLboolean (CODEGEN_FUNCPTR *IsTexture)(GLuint texture); - extern void (CODEGEN_FUNCPTR *Indexub)(GLubyte c); - extern void (CODEGEN_FUNCPTR *Indexubv)(const GLubyte *c); + // Extension: 1.2 + extern void (CODEGEN_FUNCPTR *BlendColor)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); + extern void (CODEGEN_FUNCPTR *BlendEquation)(GLenum mode); + extern void (CODEGEN_FUNCPTR *DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); + extern void (CODEGEN_FUNCPTR *TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); + extern void (CODEGEN_FUNCPTR *CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); - // Extension: 1.2 - extern void (CODEGEN_FUNCPTR *BlendColor)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); - extern void (CODEGEN_FUNCPTR *BlendEquation)(GLenum mode); - extern void (CODEGEN_FUNCPTR *DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); - extern void (CODEGEN_FUNCPTR *TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); - extern void (CODEGEN_FUNCPTR *CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); + // Extension: 1.3 + extern void (CODEGEN_FUNCPTR *ActiveTexture)(GLenum texture); + extern void (CODEGEN_FUNCPTR *SampleCoverage)(GLfloat value, GLboolean invert); + extern void (CODEGEN_FUNCPTR *CompressedTexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); + extern void (CODEGEN_FUNCPTR *CompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); + extern void (CODEGEN_FUNCPTR *CompressedTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); + extern void (CODEGEN_FUNCPTR *CompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); + extern void (CODEGEN_FUNCPTR *CompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); + extern void (CODEGEN_FUNCPTR *CompressedTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); + extern void (CODEGEN_FUNCPTR *GetCompressedTexImage)(GLenum target, GLint level, GLvoid *img); - // Extension: 1.3 - extern void (CODEGEN_FUNCPTR *ActiveTexture)(GLenum texture); - extern void (CODEGEN_FUNCPTR *SampleCoverage)(GLfloat value, GLboolean invert); - extern void (CODEGEN_FUNCPTR *CompressedTexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); - extern void (CODEGEN_FUNCPTR *CompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); - extern void (CODEGEN_FUNCPTR *CompressedTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); - extern void (CODEGEN_FUNCPTR *CompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); - extern void (CODEGEN_FUNCPTR *CompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); - extern void (CODEGEN_FUNCPTR *CompressedTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); - extern void (CODEGEN_FUNCPTR *GetCompressedTexImage)(GLenum target, GLint level, GLvoid *img); + // Extension: 1.4 + extern void (CODEGEN_FUNCPTR *BlendFuncSeparate)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); + extern void (CODEGEN_FUNCPTR *MultiDrawArrays)(GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); + extern void (CODEGEN_FUNCPTR *MultiDrawElements)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount); + extern void (CODEGEN_FUNCPTR *PointParameterf)(GLenum pname, GLfloat param); + extern void (CODEGEN_FUNCPTR *PointParameterfv)(GLenum pname, const GLfloat *params); + extern void (CODEGEN_FUNCPTR *PointParameteri)(GLenum pname, GLint param); + extern void (CODEGEN_FUNCPTR *PointParameteriv)(GLenum pname, const GLint *params); - // Extension: 1.4 - extern void (CODEGEN_FUNCPTR *BlendFuncSeparate)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); - extern void (CODEGEN_FUNCPTR *MultiDrawArrays)(GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); - extern void (CODEGEN_FUNCPTR *MultiDrawElements)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount); - extern void (CODEGEN_FUNCPTR *PointParameterf)(GLenum pname, GLfloat param); - extern void (CODEGEN_FUNCPTR *PointParameterfv)(GLenum pname, const GLfloat *params); - extern void (CODEGEN_FUNCPTR *PointParameteri)(GLenum pname, GLint param); - extern void (CODEGEN_FUNCPTR *PointParameteriv)(GLenum pname, const GLint *params); + // Extension: 1.5 + extern void (CODEGEN_FUNCPTR *GenQueries)(GLsizei n, GLuint *ids); + extern void (CODEGEN_FUNCPTR *DeleteQueries)(GLsizei n, const GLuint *ids); + extern GLboolean (CODEGEN_FUNCPTR *IsQuery)(GLuint id); + extern void (CODEGEN_FUNCPTR *BeginQuery)(GLenum target, GLuint id); + extern void (CODEGEN_FUNCPTR *EndQuery)(GLenum target); + extern void (CODEGEN_FUNCPTR *GetQueryiv)(GLenum target, GLenum pname, GLint *params); + extern void (CODEGEN_FUNCPTR *GetQueryObjectiv)(GLuint id, GLenum pname, GLint *params); + extern void (CODEGEN_FUNCPTR *GetQueryObjectuiv)(GLuint id, GLenum pname, GLuint *params); + extern void (CODEGEN_FUNCPTR *BindBuffer)(GLenum target, GLuint buffer); + extern void (CODEGEN_FUNCPTR *DeleteBuffers)(GLsizei n, const GLuint *buffers); + extern void (CODEGEN_FUNCPTR *GenBuffers)(GLsizei n, GLuint *buffers); + extern GLboolean (CODEGEN_FUNCPTR *IsBuffer)(GLuint buffer); + extern void (CODEGEN_FUNCPTR *BufferData)(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); + extern void (CODEGEN_FUNCPTR *BufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); + extern void (CODEGEN_FUNCPTR *GetBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); + extern GLvoid* (CODEGEN_FUNCPTR *MapBuffer)(GLenum target, GLenum access); + extern GLboolean (CODEGEN_FUNCPTR *UnmapBuffer)(GLenum target); + extern void (CODEGEN_FUNCPTR *GetBufferParameteriv)(GLenum target, GLenum pname, GLint *params); + extern void (CODEGEN_FUNCPTR *GetBufferPointerv)(GLenum target, GLenum pname, GLvoid* *params); - // Extension: 1.5 - extern void (CODEGEN_FUNCPTR *GenQueries)(GLsizei n, GLuint *ids); - extern void (CODEGEN_FUNCPTR *DeleteQueries)(GLsizei n, const GLuint *ids); - extern GLboolean (CODEGEN_FUNCPTR *IsQuery)(GLuint id); - extern void (CODEGEN_FUNCPTR *BeginQuery)(GLenum target, GLuint id); - extern void (CODEGEN_FUNCPTR *EndQuery)(GLenum target); - extern void (CODEGEN_FUNCPTR *GetQueryiv)(GLenum target, GLenum pname, GLint *params); - extern void (CODEGEN_FUNCPTR *GetQueryObjectiv)(GLuint id, GLenum pname, GLint *params); - extern void (CODEGEN_FUNCPTR *GetQueryObjectuiv)(GLuint id, GLenum pname, GLuint *params); - extern void (CODEGEN_FUNCPTR *BindBuffer)(GLenum target, GLuint buffer); - extern void (CODEGEN_FUNCPTR *DeleteBuffers)(GLsizei n, const GLuint *buffers); - extern void (CODEGEN_FUNCPTR *GenBuffers)(GLsizei n, GLuint *buffers); - extern GLboolean (CODEGEN_FUNCPTR *IsBuffer)(GLuint buffer); - extern void (CODEGEN_FUNCPTR *BufferData)(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); - extern void (CODEGEN_FUNCPTR *BufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); - extern void (CODEGEN_FUNCPTR *GetBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); - extern GLvoid* (CODEGEN_FUNCPTR *MapBuffer)(GLenum target, GLenum access); - extern GLboolean (CODEGEN_FUNCPTR *UnmapBuffer)(GLenum target); - extern void (CODEGEN_FUNCPTR *GetBufferParameteriv)(GLenum target, GLenum pname, GLint *params); - extern void (CODEGEN_FUNCPTR *GetBufferPointerv)(GLenum target, GLenum pname, GLvoid* *params); + // Extension: 2.0 + extern void (CODEGEN_FUNCPTR *BlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha); + extern void (CODEGEN_FUNCPTR *DrawBuffers)(GLsizei n, const GLenum *bufs); + extern void (CODEGEN_FUNCPTR *StencilOpSeparate)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); + extern void (CODEGEN_FUNCPTR *StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask); + extern void (CODEGEN_FUNCPTR *StencilMaskSeparate)(GLenum face, GLuint mask); + extern void (CODEGEN_FUNCPTR *AttachShader)(GLuint program, GLuint shader); + extern void (CODEGEN_FUNCPTR *BindAttribLocation)(GLuint program, GLuint index, const GLchar *name); + extern void (CODEGEN_FUNCPTR *CompileShader)(GLuint shader); + extern GLuint (CODEGEN_FUNCPTR *CreateProgram)(); + extern GLuint (CODEGEN_FUNCPTR *CreateShader)(GLenum type); + extern void (CODEGEN_FUNCPTR *DeleteProgram)(GLuint program); + extern void (CODEGEN_FUNCPTR *DeleteShader)(GLuint shader); + extern void (CODEGEN_FUNCPTR *DetachShader)(GLuint program, GLuint shader); + extern void (CODEGEN_FUNCPTR *DisableVertexAttribArray)(GLuint index); + extern void (CODEGEN_FUNCPTR *EnableVertexAttribArray)(GLuint index); + extern void (CODEGEN_FUNCPTR *GetActiveAttrib)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); + extern void (CODEGEN_FUNCPTR *GetActiveUniform)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); + extern void (CODEGEN_FUNCPTR *GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj); + extern GLint (CODEGEN_FUNCPTR *GetAttribLocation)(GLuint program, const GLchar *name); + extern void (CODEGEN_FUNCPTR *GetProgramiv)(GLuint program, GLenum pname, GLint *params); + extern void (CODEGEN_FUNCPTR *GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); + extern void (CODEGEN_FUNCPTR *GetShaderiv)(GLuint shader, GLenum pname, GLint *params); + extern void (CODEGEN_FUNCPTR *GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); + extern void (CODEGEN_FUNCPTR *GetShaderSource)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); + extern GLint (CODEGEN_FUNCPTR *GetUniformLocation)(GLuint program, const GLchar *name); + extern void (CODEGEN_FUNCPTR *GetUniformfv)(GLuint program, GLint location, GLfloat *params); + extern void (CODEGEN_FUNCPTR *GetUniformiv)(GLuint program, GLint location, GLint *params); + extern void (CODEGEN_FUNCPTR *GetVertexAttribdv)(GLuint index, GLenum pname, GLdouble *params); + extern void (CODEGEN_FUNCPTR *GetVertexAttribfv)(GLuint index, GLenum pname, GLfloat *params); + extern void (CODEGEN_FUNCPTR *GetVertexAttribiv)(GLuint index, GLenum pname, GLint *params); + extern void (CODEGEN_FUNCPTR *GetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid* *pointer); + extern GLboolean (CODEGEN_FUNCPTR *IsProgram)(GLuint program); + extern GLboolean (CODEGEN_FUNCPTR *IsShader)(GLuint shader); + extern void (CODEGEN_FUNCPTR *LinkProgram)(GLuint program); + extern void (CODEGEN_FUNCPTR *ShaderSource)(GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length); + extern void (CODEGEN_FUNCPTR *UseProgram)(GLuint program); + extern void (CODEGEN_FUNCPTR *Uniform1f)(GLint location, GLfloat v0); + extern void (CODEGEN_FUNCPTR *Uniform2f)(GLint location, GLfloat v0, GLfloat v1); + extern void (CODEGEN_FUNCPTR *Uniform3f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); + extern void (CODEGEN_FUNCPTR *Uniform4f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); + extern void (CODEGEN_FUNCPTR *Uniform1i)(GLint location, GLint v0); + extern void (CODEGEN_FUNCPTR *Uniform2i)(GLint location, GLint v0, GLint v1); + extern void (CODEGEN_FUNCPTR *Uniform3i)(GLint location, GLint v0, GLint v1, GLint v2); + extern void (CODEGEN_FUNCPTR *Uniform4i)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); + extern void (CODEGEN_FUNCPTR *Uniform1fv)(GLint location, GLsizei count, const GLfloat *value); + extern void (CODEGEN_FUNCPTR *Uniform2fv)(GLint location, GLsizei count, const GLfloat *value); + extern void (CODEGEN_FUNCPTR *Uniform3fv)(GLint location, GLsizei count, const GLfloat *value); + extern void (CODEGEN_FUNCPTR *Uniform4fv)(GLint location, GLsizei count, const GLfloat *value); + extern void (CODEGEN_FUNCPTR *Uniform1iv)(GLint location, GLsizei count, const GLint *value); + extern void (CODEGEN_FUNCPTR *Uniform2iv)(GLint location, GLsizei count, const GLint *value); + extern void (CODEGEN_FUNCPTR *Uniform3iv)(GLint location, GLsizei count, const GLint *value); + extern void (CODEGEN_FUNCPTR *Uniform4iv)(GLint location, GLsizei count, const GLint *value); + extern void (CODEGEN_FUNCPTR *UniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + extern void (CODEGEN_FUNCPTR *UniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + extern void (CODEGEN_FUNCPTR *UniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + extern void (CODEGEN_FUNCPTR *ValidateProgram)(GLuint program); + extern void (CODEGEN_FUNCPTR *VertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); - // Extension: 2.0 - extern void (CODEGEN_FUNCPTR *BlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha); - extern void (CODEGEN_FUNCPTR *DrawBuffers)(GLsizei n, const GLenum *bufs); - extern void (CODEGEN_FUNCPTR *StencilOpSeparate)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); - extern void (CODEGEN_FUNCPTR *StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask); - extern void (CODEGEN_FUNCPTR *StencilMaskSeparate)(GLenum face, GLuint mask); - extern void (CODEGEN_FUNCPTR *AttachShader)(GLuint program, GLuint shader); - extern void (CODEGEN_FUNCPTR *BindAttribLocation)(GLuint program, GLuint index, const GLchar *name); - extern void (CODEGEN_FUNCPTR *CompileShader)(GLuint shader); - extern GLuint (CODEGEN_FUNCPTR *CreateProgram)(); - extern GLuint (CODEGEN_FUNCPTR *CreateShader)(GLenum type); - extern void (CODEGEN_FUNCPTR *DeleteProgram)(GLuint program); - extern void (CODEGEN_FUNCPTR *DeleteShader)(GLuint shader); - extern void (CODEGEN_FUNCPTR *DetachShader)(GLuint program, GLuint shader); - extern void (CODEGEN_FUNCPTR *DisableVertexAttribArray)(GLuint index); - extern void (CODEGEN_FUNCPTR *EnableVertexAttribArray)(GLuint index); - extern void (CODEGEN_FUNCPTR *GetActiveAttrib)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); - extern void (CODEGEN_FUNCPTR *GetActiveUniform)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); - extern void (CODEGEN_FUNCPTR *GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj); - extern GLint (CODEGEN_FUNCPTR *GetAttribLocation)(GLuint program, const GLchar *name); - extern void (CODEGEN_FUNCPTR *GetProgramiv)(GLuint program, GLenum pname, GLint *params); - extern void (CODEGEN_FUNCPTR *GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); - extern void (CODEGEN_FUNCPTR *GetShaderiv)(GLuint shader, GLenum pname, GLint *params); - extern void (CODEGEN_FUNCPTR *GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); - extern void (CODEGEN_FUNCPTR *GetShaderSource)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); - extern GLint (CODEGEN_FUNCPTR *GetUniformLocation)(GLuint program, const GLchar *name); - extern void (CODEGEN_FUNCPTR *GetUniformfv)(GLuint program, GLint location, GLfloat *params); - extern void (CODEGEN_FUNCPTR *GetUniformiv)(GLuint program, GLint location, GLint *params); - extern void (CODEGEN_FUNCPTR *GetVertexAttribdv)(GLuint index, GLenum pname, GLdouble *params); - extern void (CODEGEN_FUNCPTR *GetVertexAttribfv)(GLuint index, GLenum pname, GLfloat *params); - extern void (CODEGEN_FUNCPTR *GetVertexAttribiv)(GLuint index, GLenum pname, GLint *params); - extern void (CODEGEN_FUNCPTR *GetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid* *pointer); - extern GLboolean (CODEGEN_FUNCPTR *IsProgram)(GLuint program); - extern GLboolean (CODEGEN_FUNCPTR *IsShader)(GLuint shader); - extern void (CODEGEN_FUNCPTR *LinkProgram)(GLuint program); - extern void (CODEGEN_FUNCPTR *ShaderSource)(GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length); - extern void (CODEGEN_FUNCPTR *UseProgram)(GLuint program); - extern void (CODEGEN_FUNCPTR *Uniform1f)(GLint location, GLfloat v0); - extern void (CODEGEN_FUNCPTR *Uniform2f)(GLint location, GLfloat v0, GLfloat v1); - extern void (CODEGEN_FUNCPTR *Uniform3f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); - extern void (CODEGEN_FUNCPTR *Uniform4f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); - extern void (CODEGEN_FUNCPTR *Uniform1i)(GLint location, GLint v0); - extern void (CODEGEN_FUNCPTR *Uniform2i)(GLint location, GLint v0, GLint v1); - extern void (CODEGEN_FUNCPTR *Uniform3i)(GLint location, GLint v0, GLint v1, GLint v2); - extern void (CODEGEN_FUNCPTR *Uniform4i)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); - extern void (CODEGEN_FUNCPTR *Uniform1fv)(GLint location, GLsizei count, const GLfloat *value); - extern void (CODEGEN_FUNCPTR *Uniform2fv)(GLint location, GLsizei count, const GLfloat *value); - extern void (CODEGEN_FUNCPTR *Uniform3fv)(GLint location, GLsizei count, const GLfloat *value); - extern void (CODEGEN_FUNCPTR *Uniform4fv)(GLint location, GLsizei count, const GLfloat *value); - extern void (CODEGEN_FUNCPTR *Uniform1iv)(GLint location, GLsizei count, const GLint *value); - extern void (CODEGEN_FUNCPTR *Uniform2iv)(GLint location, GLsizei count, const GLint *value); - extern void (CODEGEN_FUNCPTR *Uniform3iv)(GLint location, GLsizei count, const GLint *value); - extern void (CODEGEN_FUNCPTR *Uniform4iv)(GLint location, GLsizei count, const GLint *value); - extern void (CODEGEN_FUNCPTR *UniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); - extern void (CODEGEN_FUNCPTR *UniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); - extern void (CODEGEN_FUNCPTR *UniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); - extern void (CODEGEN_FUNCPTR *ValidateProgram)(GLuint program); - extern void (CODEGEN_FUNCPTR *VertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); + // Extension: 2.1 + extern void (CODEGEN_FUNCPTR *UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + extern void (CODEGEN_FUNCPTR *UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + extern void (CODEGEN_FUNCPTR *UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + extern void (CODEGEN_FUNCPTR *UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + extern void (CODEGEN_FUNCPTR *UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + extern void (CODEGEN_FUNCPTR *UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); - // Extension: 2.1 - extern void (CODEGEN_FUNCPTR *UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); - extern void (CODEGEN_FUNCPTR *UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); - extern void (CODEGEN_FUNCPTR *UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); - extern void (CODEGEN_FUNCPTR *UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); - extern void (CODEGEN_FUNCPTR *UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); - extern void (CODEGEN_FUNCPTR *UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + // Extension: ARB_vertex_array_object + extern void (CODEGEN_FUNCPTR *BindVertexArray)(GLuint ren_array); + extern void (CODEGEN_FUNCPTR *DeleteVertexArrays)(GLsizei n, const GLuint *arrays); + extern void (CODEGEN_FUNCPTR *GenVertexArrays)(GLsizei n, GLuint *arrays); + extern GLboolean (CODEGEN_FUNCPTR *IsVertexArray)(GLuint ren_array); - // Extension: ARB_vertex_array_object - extern void (CODEGEN_FUNCPTR *BindVertexArray)(GLuint ren_array); - extern void (CODEGEN_FUNCPTR *DeleteVertexArrays)(GLsizei n, const GLuint *arrays); - extern void (CODEGEN_FUNCPTR *GenVertexArrays)(GLsizei n, GLuint *arrays); - extern GLboolean (CODEGEN_FUNCPTR *IsVertexArray)(GLuint ren_array); + // Extension: ARB_map_buffer_range + extern GLvoid* (CODEGEN_FUNCPTR *MapBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); + extern void (CODEGEN_FUNCPTR *FlushMappedBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length); - // Extension: ARB_map_buffer_range - extern GLvoid* (CODEGEN_FUNCPTR *MapBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); - extern void (CODEGEN_FUNCPTR *FlushMappedBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length); + // Extension: ARB_framebuffer_object + extern GLboolean (CODEGEN_FUNCPTR *IsRenderbuffer)(GLuint renderbuffer); + extern void (CODEGEN_FUNCPTR *BindRenderbuffer)(GLenum target, GLuint renderbuffer); + extern void (CODEGEN_FUNCPTR *DeleteRenderbuffers)(GLsizei n, const GLuint *renderbuffers); + extern void (CODEGEN_FUNCPTR *GenRenderbuffers)(GLsizei n, GLuint *renderbuffers); + extern void (CODEGEN_FUNCPTR *RenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); + extern void (CODEGEN_FUNCPTR *GetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint *params); + extern GLboolean (CODEGEN_FUNCPTR *IsFramebuffer)(GLuint framebuffer); + extern void (CODEGEN_FUNCPTR *BindFramebuffer)(GLenum target, GLuint framebuffer); + extern void (CODEGEN_FUNCPTR *DeleteFramebuffers)(GLsizei n, const GLuint *framebuffers); + extern void (CODEGEN_FUNCPTR *GenFramebuffers)(GLsizei n, GLuint *framebuffers); + extern GLenum (CODEGEN_FUNCPTR *CheckFramebufferStatus)(GLenum target); + extern void (CODEGEN_FUNCPTR *FramebufferTexture1D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); + extern void (CODEGEN_FUNCPTR *FramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); + extern void (CODEGEN_FUNCPTR *FramebufferTexture3D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); + extern void (CODEGEN_FUNCPTR *FramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); + extern void (CODEGEN_FUNCPTR *GetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint *params); + extern void (CODEGEN_FUNCPTR *GenerateMipmap)(GLenum target); + extern void (CODEGEN_FUNCPTR *BlitFramebuffer)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + extern void (CODEGEN_FUNCPTR *RenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + extern void (CODEGEN_FUNCPTR *FramebufferTextureLayer)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); - // Extension: ARB_framebuffer_object - extern GLboolean (CODEGEN_FUNCPTR *IsRenderbuffer)(GLuint renderbuffer); - extern void (CODEGEN_FUNCPTR *BindRenderbuffer)(GLenum target, GLuint renderbuffer); - extern void (CODEGEN_FUNCPTR *DeleteRenderbuffers)(GLsizei n, const GLuint *renderbuffers); - extern void (CODEGEN_FUNCPTR *GenRenderbuffers)(GLsizei n, GLuint *renderbuffers); - extern void (CODEGEN_FUNCPTR *RenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); - extern void (CODEGEN_FUNCPTR *GetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint *params); - extern GLboolean (CODEGEN_FUNCPTR *IsFramebuffer)(GLuint framebuffer); - extern void (CODEGEN_FUNCPTR *BindFramebuffer)(GLenum target, GLuint framebuffer); - extern void (CODEGEN_FUNCPTR *DeleteFramebuffers)(GLsizei n, const GLuint *framebuffers); - extern void (CODEGEN_FUNCPTR *GenFramebuffers)(GLsizei n, GLuint *framebuffers); - extern GLenum (CODEGEN_FUNCPTR *CheckFramebufferStatus)(GLenum target); - extern void (CODEGEN_FUNCPTR *FramebufferTexture1D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); - extern void (CODEGEN_FUNCPTR *FramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); - extern void (CODEGEN_FUNCPTR *FramebufferTexture3D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); - extern void (CODEGEN_FUNCPTR *FramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); - extern void (CODEGEN_FUNCPTR *GetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint *params); - extern void (CODEGEN_FUNCPTR *GenerateMipmap)(GLenum target); - extern void (CODEGEN_FUNCPTR *BlitFramebuffer)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); - extern void (CODEGEN_FUNCPTR *RenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); - extern void (CODEGEN_FUNCPTR *FramebufferTextureLayer)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); + // Extension: 3.0 + extern void (CODEGEN_FUNCPTR *ColorMaski)(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); + extern void (CODEGEN_FUNCPTR *GetBooleani_v)(GLenum target, GLuint index, GLboolean *data); + extern void (CODEGEN_FUNCPTR *GetIntegeri_v)(GLenum target, GLuint index, GLint *data); + extern void (CODEGEN_FUNCPTR *Enablei)(GLenum target, GLuint index); + extern void (CODEGEN_FUNCPTR *Disablei)(GLenum target, GLuint index); + extern GLboolean (CODEGEN_FUNCPTR *IsEnabledi)(GLenum target, GLuint index); + extern void (CODEGEN_FUNCPTR *BeginTransformFeedback)(GLenum primitiveMode); + extern void (CODEGEN_FUNCPTR *EndTransformFeedback)(); + extern void (CODEGEN_FUNCPTR *BindBufferRange)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); + extern void (CODEGEN_FUNCPTR *BindBufferBase)(GLenum target, GLuint index, GLuint buffer); + extern void (CODEGEN_FUNCPTR *TransformFeedbackVaryings)(GLuint program, GLsizei count, const GLchar* const *varyings, GLenum bufferMode); + extern void (CODEGEN_FUNCPTR *GetTransformFeedbackVarying)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); + extern void (CODEGEN_FUNCPTR *ClampColor)(GLenum target, GLenum clamp); + extern void (CODEGEN_FUNCPTR *BeginConditionalRender)(GLuint id, GLenum mode); + extern void (CODEGEN_FUNCPTR *EndConditionalRender)(); + extern void (CODEGEN_FUNCPTR *VertexAttribIPointer)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); + extern void (CODEGEN_FUNCPTR *GetVertexAttribIiv)(GLuint index, GLenum pname, GLint *params); + extern void (CODEGEN_FUNCPTR *GetVertexAttribIuiv)(GLuint index, GLenum pname, GLuint *params); + extern void (CODEGEN_FUNCPTR *VertexAttribI1i)(GLuint index, GLint x); + extern void (CODEGEN_FUNCPTR *VertexAttribI2i)(GLuint index, GLint x, GLint y); + extern void (CODEGEN_FUNCPTR *VertexAttribI3i)(GLuint index, GLint x, GLint y, GLint z); + extern void (CODEGEN_FUNCPTR *VertexAttribI4i)(GLuint index, GLint x, GLint y, GLint z, GLint w); + extern void (CODEGEN_FUNCPTR *VertexAttribI1ui)(GLuint index, GLuint x); + extern void (CODEGEN_FUNCPTR *VertexAttribI2ui)(GLuint index, GLuint x, GLuint y); + extern void (CODEGEN_FUNCPTR *VertexAttribI3ui)(GLuint index, GLuint x, GLuint y, GLuint z); + extern void (CODEGEN_FUNCPTR *VertexAttribI4ui)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); + extern void (CODEGEN_FUNCPTR *VertexAttribI1iv)(GLuint index, const GLint *v); + extern void (CODEGEN_FUNCPTR *VertexAttribI2iv)(GLuint index, const GLint *v); + extern void (CODEGEN_FUNCPTR *VertexAttribI3iv)(GLuint index, const GLint *v); + extern void (CODEGEN_FUNCPTR *VertexAttribI4iv)(GLuint index, const GLint *v); + extern void (CODEGEN_FUNCPTR *VertexAttribI1uiv)(GLuint index, const GLuint *v); + extern void (CODEGEN_FUNCPTR *VertexAttribI2uiv)(GLuint index, const GLuint *v); + extern void (CODEGEN_FUNCPTR *VertexAttribI3uiv)(GLuint index, const GLuint *v); + extern void (CODEGEN_FUNCPTR *VertexAttribI4uiv)(GLuint index, const GLuint *v); + extern void (CODEGEN_FUNCPTR *VertexAttribI4bv)(GLuint index, const GLbyte *v); + extern void (CODEGEN_FUNCPTR *VertexAttribI4sv)(GLuint index, const GLshort *v); + extern void (CODEGEN_FUNCPTR *VertexAttribI4ubv)(GLuint index, const GLubyte *v); + extern void (CODEGEN_FUNCPTR *VertexAttribI4usv)(GLuint index, const GLushort *v); + extern void (CODEGEN_FUNCPTR *GetUniformuiv)(GLuint program, GLint location, GLuint *params); + extern void (CODEGEN_FUNCPTR *BindFragDataLocation)(GLuint program, GLuint color, const GLchar *name); + extern GLint (CODEGEN_FUNCPTR *GetFragDataLocation)(GLuint program, const GLchar *name); + extern void (CODEGEN_FUNCPTR *Uniform1ui)(GLint location, GLuint v0); + extern void (CODEGEN_FUNCPTR *Uniform2ui)(GLint location, GLuint v0, GLuint v1); + extern void (CODEGEN_FUNCPTR *Uniform3ui)(GLint location, GLuint v0, GLuint v1, GLuint v2); + extern void (CODEGEN_FUNCPTR *Uniform4ui)(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); + extern void (CODEGEN_FUNCPTR *Uniform1uiv)(GLint location, GLsizei count, const GLuint *value); + extern void (CODEGEN_FUNCPTR *Uniform2uiv)(GLint location, GLsizei count, const GLuint *value); + extern void (CODEGEN_FUNCPTR *Uniform3uiv)(GLint location, GLsizei count, const GLuint *value); + extern void (CODEGEN_FUNCPTR *Uniform4uiv)(GLint location, GLsizei count, const GLuint *value); + extern void (CODEGEN_FUNCPTR *TexParameterIiv)(GLenum target, GLenum pname, const GLint *params); + extern void (CODEGEN_FUNCPTR *TexParameterIuiv)(GLenum target, GLenum pname, const GLuint *params); + extern void (CODEGEN_FUNCPTR *GetTexParameterIiv)(GLenum target, GLenum pname, GLint *params); + extern void (CODEGEN_FUNCPTR *GetTexParameterIuiv)(GLenum target, GLenum pname, GLuint *params); + extern void (CODEGEN_FUNCPTR *ClearBufferiv)(GLenum buffer, GLint drawbuffer, const GLint *value); + extern void (CODEGEN_FUNCPTR *ClearBufferuiv)(GLenum buffer, GLint drawbuffer, const GLuint *value); + extern void (CODEGEN_FUNCPTR *ClearBufferfv)(GLenum buffer, GLint drawbuffer, const GLfloat *value); + extern void (CODEGEN_FUNCPTR *ClearBufferfi)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); + extern const GLubyte * (CODEGEN_FUNCPTR *GetStringi)(GLenum name, GLuint index); - // Extension: 3.0 - extern void (CODEGEN_FUNCPTR *ColorMaski)(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); - extern void (CODEGEN_FUNCPTR *GetBooleani_v)(GLenum target, GLuint index, GLboolean *data); - extern void (CODEGEN_FUNCPTR *GetIntegeri_v)(GLenum target, GLuint index, GLint *data); - extern void (CODEGEN_FUNCPTR *Enablei)(GLenum target, GLuint index); - extern void (CODEGEN_FUNCPTR *Disablei)(GLenum target, GLuint index); - extern GLboolean (CODEGEN_FUNCPTR *IsEnabledi)(GLenum target, GLuint index); - extern void (CODEGEN_FUNCPTR *BeginTransformFeedback)(GLenum primitiveMode); - extern void (CODEGEN_FUNCPTR *EndTransformFeedback)(); - extern void (CODEGEN_FUNCPTR *BindBufferRange)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); - extern void (CODEGEN_FUNCPTR *BindBufferBase)(GLenum target, GLuint index, GLuint buffer); - extern void (CODEGEN_FUNCPTR *TransformFeedbackVaryings)(GLuint program, GLsizei count, const GLchar* const *varyings, GLenum bufferMode); - extern void (CODEGEN_FUNCPTR *GetTransformFeedbackVarying)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); - extern void (CODEGEN_FUNCPTR *ClampColor)(GLenum target, GLenum clamp); - extern void (CODEGEN_FUNCPTR *BeginConditionalRender)(GLuint id, GLenum mode); - extern void (CODEGEN_FUNCPTR *EndConditionalRender)(); - extern void (CODEGEN_FUNCPTR *VertexAttribIPointer)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); - extern void (CODEGEN_FUNCPTR *GetVertexAttribIiv)(GLuint index, GLenum pname, GLint *params); - extern void (CODEGEN_FUNCPTR *GetVertexAttribIuiv)(GLuint index, GLenum pname, GLuint *params); - extern void (CODEGEN_FUNCPTR *VertexAttribI1i)(GLuint index, GLint x); - extern void (CODEGEN_FUNCPTR *VertexAttribI2i)(GLuint index, GLint x, GLint y); - extern void (CODEGEN_FUNCPTR *VertexAttribI3i)(GLuint index, GLint x, GLint y, GLint z); - extern void (CODEGEN_FUNCPTR *VertexAttribI4i)(GLuint index, GLint x, GLint y, GLint z, GLint w); - extern void (CODEGEN_FUNCPTR *VertexAttribI1ui)(GLuint index, GLuint x); - extern void (CODEGEN_FUNCPTR *VertexAttribI2ui)(GLuint index, GLuint x, GLuint y); - extern void (CODEGEN_FUNCPTR *VertexAttribI3ui)(GLuint index, GLuint x, GLuint y, GLuint z); - extern void (CODEGEN_FUNCPTR *VertexAttribI4ui)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); - extern void (CODEGEN_FUNCPTR *VertexAttribI1iv)(GLuint index, const GLint *v); - extern void (CODEGEN_FUNCPTR *VertexAttribI2iv)(GLuint index, const GLint *v); - extern void (CODEGEN_FUNCPTR *VertexAttribI3iv)(GLuint index, const GLint *v); - extern void (CODEGEN_FUNCPTR *VertexAttribI4iv)(GLuint index, const GLint *v); - extern void (CODEGEN_FUNCPTR *VertexAttribI1uiv)(GLuint index, const GLuint *v); - extern void (CODEGEN_FUNCPTR *VertexAttribI2uiv)(GLuint index, const GLuint *v); - extern void (CODEGEN_FUNCPTR *VertexAttribI3uiv)(GLuint index, const GLuint *v); - extern void (CODEGEN_FUNCPTR *VertexAttribI4uiv)(GLuint index, const GLuint *v); - extern void (CODEGEN_FUNCPTR *VertexAttribI4bv)(GLuint index, const GLbyte *v); - extern void (CODEGEN_FUNCPTR *VertexAttribI4sv)(GLuint index, const GLshort *v); - extern void (CODEGEN_FUNCPTR *VertexAttribI4ubv)(GLuint index, const GLubyte *v); - extern void (CODEGEN_FUNCPTR *VertexAttribI4usv)(GLuint index, const GLushort *v); - extern void (CODEGEN_FUNCPTR *GetUniformuiv)(GLuint program, GLint location, GLuint *params); - extern void (CODEGEN_FUNCPTR *BindFragDataLocation)(GLuint program, GLuint color, const GLchar *name); - extern GLint (CODEGEN_FUNCPTR *GetFragDataLocation)(GLuint program, const GLchar *name); - extern void (CODEGEN_FUNCPTR *Uniform1ui)(GLint location, GLuint v0); - extern void (CODEGEN_FUNCPTR *Uniform2ui)(GLint location, GLuint v0, GLuint v1); - extern void (CODEGEN_FUNCPTR *Uniform3ui)(GLint location, GLuint v0, GLuint v1, GLuint v2); - extern void (CODEGEN_FUNCPTR *Uniform4ui)(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); - extern void (CODEGEN_FUNCPTR *Uniform1uiv)(GLint location, GLsizei count, const GLuint *value); - extern void (CODEGEN_FUNCPTR *Uniform2uiv)(GLint location, GLsizei count, const GLuint *value); - extern void (CODEGEN_FUNCPTR *Uniform3uiv)(GLint location, GLsizei count, const GLuint *value); - extern void (CODEGEN_FUNCPTR *Uniform4uiv)(GLint location, GLsizei count, const GLuint *value); - extern void (CODEGEN_FUNCPTR *TexParameterIiv)(GLenum target, GLenum pname, const GLint *params); - extern void (CODEGEN_FUNCPTR *TexParameterIuiv)(GLenum target, GLenum pname, const GLuint *params); - extern void (CODEGEN_FUNCPTR *GetTexParameterIiv)(GLenum target, GLenum pname, GLint *params); - extern void (CODEGEN_FUNCPTR *GetTexParameterIuiv)(GLenum target, GLenum pname, GLuint *params); - extern void (CODEGEN_FUNCPTR *ClearBufferiv)(GLenum buffer, GLint drawbuffer, const GLint *value); - extern void (CODEGEN_FUNCPTR *ClearBufferuiv)(GLenum buffer, GLint drawbuffer, const GLuint *value); - extern void (CODEGEN_FUNCPTR *ClearBufferfv)(GLenum buffer, GLint drawbuffer, const GLfloat *value); - extern void (CODEGEN_FUNCPTR *ClearBufferfi)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); - extern const GLubyte * (CODEGEN_FUNCPTR *GetStringi)(GLenum name, GLuint index); + // Extension: ARB_uniform_buffer_object + extern void (CODEGEN_FUNCPTR *GetUniformIndices)(GLuint program, GLsizei uniformCount, const GLchar* const *uniformNames, GLuint *uniformIndices); + extern void (CODEGEN_FUNCPTR *GetActiveUniformsiv)(GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); + extern void (CODEGEN_FUNCPTR *GetActiveUniformName)(GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); + extern GLuint (CODEGEN_FUNCPTR *GetUniformBlockIndex)(GLuint program, const GLchar *uniformBlockName); + extern void (CODEGEN_FUNCPTR *GetActiveUniformBlockiv)(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); + extern void (CODEGEN_FUNCPTR *GetActiveUniformBlockName)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); + extern void (CODEGEN_FUNCPTR *UniformBlockBinding)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); - // Extension: ARB_uniform_buffer_object - extern void (CODEGEN_FUNCPTR *GetUniformIndices)(GLuint program, GLsizei uniformCount, const GLchar* const *uniformNames, GLuint *uniformIndices); - extern void (CODEGEN_FUNCPTR *GetActiveUniformsiv)(GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); - extern void (CODEGEN_FUNCPTR *GetActiveUniformName)(GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); - extern GLuint (CODEGEN_FUNCPTR *GetUniformBlockIndex)(GLuint program, const GLchar *uniformBlockName); - extern void (CODEGEN_FUNCPTR *GetActiveUniformBlockiv)(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); - extern void (CODEGEN_FUNCPTR *GetActiveUniformBlockName)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); - extern void (CODEGEN_FUNCPTR *UniformBlockBinding)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); + // Extension: ARB_copy_buffer + extern void (CODEGEN_FUNCPTR *CopyBufferSubData)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); - // Extension: ARB_copy_buffer - extern void (CODEGEN_FUNCPTR *CopyBufferSubData)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); + // Extension: 3.1 + extern void (CODEGEN_FUNCPTR *DrawArraysInstanced)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount); + extern void (CODEGEN_FUNCPTR *DrawElementsInstanced)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount); + extern void (CODEGEN_FUNCPTR *TexBuffer)(GLenum target, GLenum internalformat, GLuint buffer); + extern void (CODEGEN_FUNCPTR *PrimitiveRestartIndex)(GLuint index); - // Extension: 3.1 - extern void (CODEGEN_FUNCPTR *DrawArraysInstanced)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount); - extern void (CODEGEN_FUNCPTR *DrawElementsInstanced)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount); - extern void (CODEGEN_FUNCPTR *TexBuffer)(GLenum target, GLenum internalformat, GLuint buffer); - extern void (CODEGEN_FUNCPTR *PrimitiveRestartIndex)(GLuint index); - - // Legacy - enum - { - VERTEX_ARRAY = 0x8074, - NORMAL_ARRAY = 0x8075, - COLOR_ARRAY = 0x8076, - TEXTURE_COORD_ARRAY = 0x8078, - - TEXTURE_ENV = 0x2300, - TEXTURE_ENV_MODE = 0x2200, - - MODELVIEW = 0x1700, - PROJECTION = 0x1701, - LIGHTING = 0x0B50 - }; - - extern void (CODEGEN_FUNCPTR *EnableClientState)(GLenum cap); - extern void (CODEGEN_FUNCPTR *DisableClientState)(GLenum cap); - extern void (CODEGEN_FUNCPTR *VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr); - extern void (CODEGEN_FUNCPTR *NormalPointer)(GLenum type, GLsizei stride, const GLvoid *ptr); - extern void (CODEGEN_FUNCPTR *ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr); - extern void (CODEGEN_FUNCPTR *TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr); - - extern void (CODEGEN_FUNCPTR *TexEnvi)(GLenum target, GLenum pname, GLint param); - - extern void (CODEGEN_FUNCPTR *MatrixMode)(GLenum mode); - extern void (CODEGEN_FUNCPTR *LoadIdentity)(void); - extern void (CODEGEN_FUNCPTR *Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val); - - extern void (CODEGEN_FUNCPTR *Color3d)(GLdouble red, GLdouble green, GLdouble blue); - - namespace sys - { - void CheckExtensions(); - } + // Legacy + extern void (CODEGEN_FUNCPTR *EnableClientState)(GLenum cap); + extern void (CODEGEN_FUNCPTR *DisableClientState)(GLenum cap); + extern void (CODEGEN_FUNCPTR *VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr); + extern void (CODEGEN_FUNCPTR *NormalPointer)(GLenum type, GLsizei stride, const GLvoid *ptr); + extern void (CODEGEN_FUNCPTR *ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr); + extern void (CODEGEN_FUNCPTR *TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr); + extern void (CODEGEN_FUNCPTR *TexEnvi)(GLenum target, GLenum pname, GLint param); + extern void (CODEGEN_FUNCPTR *MatrixMode)(GLenum mode); + extern void (CODEGEN_FUNCPTR *LoadIdentity)(void); + extern void (CODEGEN_FUNCPTR *Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val); + extern void (CODEGEN_FUNCPTR *Color3d)(GLdouble red, GLdouble green, GLdouble blue); } -#endif //OPENGL_NOLOAD_STYLE_HPP + +#endif // OPENGL_NOLOAD_STYLE_HPP diff --git a/modules/core/src/opengl_interop.cpp b/modules/core/src/opengl_interop.cpp index e3ac95facd..add58a70ed 100644 --- a/modules/core/src/opengl_interop.cpp +++ b/modules/core/src/opengl_interop.cpp @@ -327,7 +327,7 @@ public: static const Ptr& empty(); Impl(GLuint bufId, bool autoRelease); - Impl(GLsizeiptr size, const GLvoid* data, GLenum target); + Impl(GLsizeiptr size, const GLvoid* data, GLenum target, bool autoRelease); ~Impl(); void bind(GLenum target) const; @@ -337,7 +337,7 @@ public: void copyFrom(GLsizeiptr size, const GLvoid* data); void copyTo(GLsizeiptr size, GLvoid* data) const; - void* mapHost(); + void* mapHost(GLenum access); void unmapHost(); #ifdef HAVE_CUDA @@ -377,7 +377,7 @@ cv::GlBuffer::Impl::Impl(GLuint abufId, bool autoRelease) : bufId_(abufId), auto { } -cv::GlBuffer::Impl::Impl(GLsizeiptr size, const GLvoid* data, GLenum target) : bufId_(0), autoRelease_(true) +cv::GlBuffer::Impl::Impl(GLsizeiptr size, const GLvoid* data, GLenum target, bool autoRelease) : bufId_(0), autoRelease_(autoRelease) { gl::GenBuffers(1, &bufId_); CV_CheckGlError(); @@ -436,12 +436,12 @@ void cv::GlBuffer::Impl::copyTo(GLsizeiptr size, GLvoid* data) const CV_CheckGlError(); } -void* cv::GlBuffer::Impl::mapHost() +void* cv::GlBuffer::Impl::mapHost(GLenum access) { gl::BindBuffer(gl::COPY_READ_BUFFER, bufId_); CV_CheckGlError(); - GLvoid* data = gl::MapBuffer(gl::COPY_READ_BUFFER, gl::READ_WRITE); + GLvoid* data = gl::MapBuffer(gl::COPY_READ_BUFFER, access); CV_CheckGlError(); return data; @@ -521,17 +521,17 @@ cv::GlBuffer::GlBuffer(Size asize, int atype, unsigned int abufId, bool autoRele #endif } -cv::GlBuffer::GlBuffer(int arows, int acols, int atype, Target target) : rows_(0), cols_(0), type_(0) +cv::GlBuffer::GlBuffer(int arows, int acols, int atype, Target target, bool autoRelease) : rows_(0), cols_(0), type_(0) { - create(arows, acols, atype, target); + create(arows, acols, atype, target, autoRelease); } -cv::GlBuffer::GlBuffer(Size asize, int atype, Target target) : rows_(0), cols_(0), type_(0) +cv::GlBuffer::GlBuffer(Size asize, int atype, Target target, bool autoRelease) : rows_(0), cols_(0), type_(0) { - create(asize, atype, target); + create(asize, atype, target, autoRelease); } -cv::GlBuffer::GlBuffer(InputArray arr, Target target) : rows_(0), cols_(0), type_(0) +cv::GlBuffer::GlBuffer(InputArray arr, Target target, bool autoRelease) : rows_(0), cols_(0), type_(0) { #ifndef HAVE_OPENGL (void) arr; @@ -544,19 +544,19 @@ cv::GlBuffer::GlBuffer(InputArray arr, Target target) : rows_(0), cols_(0), type { case _InputArray::OPENGL_BUFFER: { - copyFrom(arr, target); + copyFrom(arr, target, autoRelease); break; } case _InputArray::OPENGL_TEXTURE2D: { - copyFrom(arr, target); + copyFrom(arr, target, autoRelease); break; } case _InputArray::GPU_MAT: { - copyFrom(arr, target); + copyFrom(arr, target, autoRelease); break; } @@ -565,7 +565,7 @@ cv::GlBuffer::GlBuffer(InputArray arr, Target target) : rows_(0), cols_(0), type Mat mat = arr.getMat(); CV_Assert( mat.isContinuous() ); const GLsizeiptr asize = mat.rows * mat.cols * mat.elemSize(); - impl_ = new Impl(asize, mat.data, target); + impl_ = new Impl(asize, mat.data, target, autoRelease); rows_ = mat.rows; cols_ = mat.cols; type_ = mat.type(); @@ -575,7 +575,7 @@ cv::GlBuffer::GlBuffer(InputArray arr, Target target) : rows_(0), cols_(0), type #endif } -void cv::GlBuffer::create(int arows, int acols, int atype, Target target) +void cv::GlBuffer::create(int arows, int acols, int atype, Target target, bool autoRelease) { #ifndef HAVE_OPENGL (void) arows; @@ -587,7 +587,7 @@ void cv::GlBuffer::create(int arows, int acols, int atype, Target target) if (rows_ != arows || cols_ != acols || type_ != atype) { const GLsizeiptr asize = arows * acols * CV_ELEM_SIZE(atype); - impl_ = new Impl(asize, 0, target); + impl_ = new Impl(asize, 0, target, autoRelease); rows_ = arows; cols_ = acols; type_ = atype; @@ -598,6 +598,8 @@ void cv::GlBuffer::create(int arows, int acols, int atype, Target target) void cv::GlBuffer::release() { #ifdef HAVE_OPENGL + if (*impl_.refcount == 1) + impl_->setAutoRelease(true); impl_ = Impl::empty(); rows_ = 0; cols_ = 0; @@ -615,7 +617,7 @@ void cv::GlBuffer::setAutoRelease(bool flag) #endif } -void cv::GlBuffer::copyFrom(InputArray arr, Target target) +void cv::GlBuffer::copyFrom(InputArray arr, Target target, bool autoRelease) { #ifndef HAVE_OPENGL (void) arr; @@ -628,12 +630,13 @@ void cv::GlBuffer::copyFrom(InputArray arr, Target target) { GlTexture2D tex = arr.getGlTexture2D(); tex.copyTo(*this); + setAutoRelease(autoRelease); return; } const Size asize = arr.size(); const int atype = arr.type(); - create(asize, atype, target); + create(asize, atype, target, autoRelease); switch (kind) { @@ -747,13 +750,14 @@ void cv::GlBuffer::unbind(Target target) #endif } -Mat cv::GlBuffer::mapHost() +Mat cv::GlBuffer::mapHost(Access access) { #ifndef HAVE_OPENGL + (void) access; throw_nogl(); return Mat(); #else - return Mat(rows_, cols_, type_, impl_->mapHost()); + return Mat(rows_, cols_, type_, impl_->mapHost(access)); #endif } @@ -826,7 +830,7 @@ public: static const Ptr empty(); Impl(GLuint texId, bool autoRelease); - Impl(GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels); + Impl(GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels, bool autoRelease); ~Impl(); void copyFrom(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); @@ -859,7 +863,7 @@ cv::GlTexture2D::Impl::Impl(GLuint atexId, bool autoRelease) : texId_(atexId), a { } -cv::GlTexture2D::Impl::Impl(GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels) : texId_(0), autoRelease_(true) +cv::GlTexture2D::Impl::Impl(GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels, bool autoRelease) : texId_(0), autoRelease_(autoRelease) { gl::GenTextures(1, &texId_); CV_CheckGlError(); @@ -962,17 +966,17 @@ cv::GlTexture2D::GlTexture2D(Size asize, Format aformat, unsigned int atexId, bo #endif } -cv::GlTexture2D::GlTexture2D(int arows, int acols, Format aformat) : rows_(0), cols_(0), format_(NONE) +cv::GlTexture2D::GlTexture2D(int arows, int acols, Format aformat, bool autoRelease) : rows_(0), cols_(0), format_(NONE) { - create(arows, acols, aformat); + create(arows, acols, aformat, autoRelease); } -cv::GlTexture2D::GlTexture2D(Size asize, Format aformat) : rows_(0), cols_(0), format_(NONE) +cv::GlTexture2D::GlTexture2D(Size asize, Format aformat, bool autoRelease) : rows_(0), cols_(0), format_(NONE) { - create(asize, aformat); + create(asize, aformat, autoRelease); } -cv::GlTexture2D::GlTexture2D(InputArray arr) : rows_(0), cols_(0), format_(NONE) +cv::GlTexture2D::GlTexture2D(InputArray arr, bool autoRelease) : rows_(0), cols_(0), format_(NONE) { #ifndef HAVE_OPENGL (void) arr; @@ -1004,7 +1008,7 @@ cv::GlTexture2D::GlTexture2D(InputArray arr) : rows_(0), cols_(0), format_(NONE) { GlBuffer buf = arr.getGlBuffer(); buf.bind(GlBuffer::PIXEL_UNPACK_BUFFER); - impl_ = new Impl(internalFormats[cn], asize.width, asize.height, srcFormats[cn], gl_types[depth], 0); + impl_ = new Impl(internalFormats[cn], asize.width, asize.height, srcFormats[cn], gl_types[depth], 0, autoRelease); GlBuffer::unbind(GlBuffer::PIXEL_UNPACK_BUFFER); break; } @@ -1017,7 +1021,7 @@ cv::GlTexture2D::GlTexture2D(InputArray arr) : rows_(0), cols_(0), format_(NONE) GpuMat dmat = arr.getGpuMat(); GlBuffer buf(dmat, GlBuffer::PIXEL_UNPACK_BUFFER); buf.bind(GlBuffer::PIXEL_UNPACK_BUFFER); - impl_ = new Impl(internalFormats[cn], asize.width, asize.height, srcFormats[cn], gl_types[depth], 0); + impl_ = new Impl(internalFormats[cn], asize.width, asize.height, srcFormats[cn], gl_types[depth], 0, autoRelease); GlBuffer::unbind(GlBuffer::PIXEL_UNPACK_BUFFER); #endif @@ -1029,7 +1033,7 @@ cv::GlTexture2D::GlTexture2D(InputArray arr) : rows_(0), cols_(0), format_(NONE) Mat mat = arr.getMat(); CV_Assert( mat.isContinuous() ); GlBuffer::unbind(GlBuffer::PIXEL_UNPACK_BUFFER); - impl_ = new Impl(internalFormats[cn], asize.width, asize.height, srcFormats[cn], gl_types[depth], mat.data); + impl_ = new Impl(internalFormats[cn], asize.width, asize.height, srcFormats[cn], gl_types[depth], mat.data, autoRelease); break; } } @@ -1040,7 +1044,7 @@ cv::GlTexture2D::GlTexture2D(InputArray arr) : rows_(0), cols_(0), format_(NONE) #endif } -void cv::GlTexture2D::create(int arows, int acols, Format aformat) +void cv::GlTexture2D::create(int arows, int acols, Format aformat, bool autoRelease) { #ifndef HAVE_OPENGL (void) arows; @@ -1051,7 +1055,7 @@ void cv::GlTexture2D::create(int arows, int acols, Format aformat) if (rows_ != arows || cols_ != acols || format_ != aformat) { GlBuffer::unbind(GlBuffer::PIXEL_UNPACK_BUFFER); - impl_ = new Impl(aformat, acols, arows, aformat, gl::FLOAT, 0); + impl_ = new Impl(aformat, acols, arows, aformat, gl::FLOAT, 0, autoRelease); rows_ = arows; cols_ = acols; format_ = aformat; @@ -1062,6 +1066,8 @@ void cv::GlTexture2D::create(int arows, int acols, Format aformat) void cv::GlTexture2D::release() { #ifdef HAVE_OPENGL + if (*impl_.refcount == 1) + impl_->setAutoRelease(true); impl_ = Impl::empty(); rows_ = 0; cols_ = 0; @@ -1079,7 +1085,7 @@ void cv::GlTexture2D::setAutoRelease(bool flag) #endif } -void cv::GlTexture2D::copyFrom(InputArray arr) +void cv::GlTexture2D::copyFrom(InputArray arr, bool autoRelease) { #ifndef HAVE_OPENGL (void) arr; @@ -1105,7 +1111,7 @@ void cv::GlTexture2D::copyFrom(InputArray arr) 0, gl::DEPTH_COMPONENT, 0, gl::BGR, gl::BGRA }; - create(asize, internalFormats[cn]); + create(asize, internalFormats[cn], autoRelease); switch(kind) { diff --git a/modules/gpu/test/test_opengl.cpp b/modules/gpu/test/test_opengl.cpp index bbb10e1e32..990027b40a 100644 --- a/modules/gpu/test/test_opengl.cpp +++ b/modules/gpu/test/test_opengl.cpp @@ -351,14 +351,14 @@ TEST_P(GlBuffer, Clone) cv::destroyAllWindows(); } -TEST_P(GlBuffer, MapHost) +TEST_P(GlBuffer, MapHostRead) { cv::namedWindow("test", cv::WINDOW_OPENGL); cv::Mat gold = randomMat(size, type); cv::GlBuffer buf(gold); - cv::Mat dst = buf.mapHost(); + cv::Mat dst = buf.mapHost(cv::GlBuffer::READ_ONLY); EXPECT_MAT_NEAR(gold, dst, 0); @@ -368,6 +368,27 @@ TEST_P(GlBuffer, MapHost) cv::destroyAllWindows(); } +TEST_P(GlBuffer, MapHostWrite) +{ + cv::namedWindow("test", cv::WINDOW_OPENGL); + + cv::Mat gold = randomMat(size, type); + cv::GlBuffer buf(size, type); + + cv::Mat dst = buf.mapHost(cv::GlBuffer::WRITE_ONLY); + gold.copyTo(dst); + buf.unmapHost(); + dst.release(); + + cv::Mat bufData; + buf.copyTo(bufData); + + EXPECT_MAT_NEAR(gold, bufData, 0); + + buf.release(); + cv::destroyAllWindows(); +} + TEST_P(GlBuffer, MapDevice) { cv::namedWindow("test", cv::WINDOW_OPENGL); diff --git a/samples/gpu/opengl.cpp b/samples/gpu/opengl.cpp index acd59e2942..ec6fbf8795 100644 --- a/samples/gpu/opengl.cpp +++ b/samples/gpu/opengl.cpp @@ -56,14 +56,18 @@ void CV_CDECL draw(void* userdata) glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - gluLookAt(0, 0, 4, 0, 0, 0, 0, 1, 0); + gluLookAt(0, 0, 3, 0, 0, 0, 0, 1, 0); glRotated(angle, 0, 1, 0); glEnable(GL_TEXTURE_2D); data->tex.bind(); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexEnvi(GL_TEXTURE_2D, GL_TEXTURE_ENV_MODE, GL_REPLACE); + glDisable(GL_CULL_FACE); - glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST); render(data->arr, data->indices, RenderMode::TRIANGLES); @@ -101,13 +105,8 @@ int main(int argc, char* argv[]) data.arr.setVertexArray(vertex); data.arr.setTexCoordArray(texCoords); - data.arr.setAutoRelease(false); - data.indices.copyFrom(indices); - data.indices.setAutoRelease(false); - data.tex.copyFrom(img); - data.tex.setAutoRelease(false); setOpenGlDrawCallback("OpenGL", draw, &data);