1 /*M/////////////////////////////////////////////////////////////////////////////////////// 2 // 3 // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 // 5 // By downloading, copying, installing or using the software you agree to this license. 6 // If you do not agree to this license, do not download, install, 7 // copy or use the software. 8 // 9 // 10 // License Agreement 11 // For Open Source Computer Vision Library 12 // 13 // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 // Third party copyrights are property of their respective owners. 16 // 17 // Redistribution and use in source and binary forms, with or without modification, 18 // are permitted provided that the following conditions are met: 19 // 20 // * Redistribution's of source code must retain the above copyright notice, 21 // this list of conditions and the following disclaimer. 22 // 23 // * Redistribution's in binary form must reproduce the above copyright notice, 24 // this list of conditions and the following disclaimer in the documentation 25 // and/or other materials provided with the distribution. 26 // 27 // * The name of the copyright holders may not be used to endorse or promote products 28 // derived from this software without specific prior written permission. 29 // 30 // This software is provided by the copyright holders and contributors "as is" and 31 // any express or implied warranties, including, but not limited to, the implied 32 // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 // In no event shall the Intel Corporation or contributors be liable for any direct, 34 // indirect, incidental, special, exemplary, or consequential damages 35 // (including, but not limited to, procurement of substitute goods or services; 36 // loss of use, data, or profits; or business interruption) however caused 37 // and on any theory of liability, whether in contract, strict liability, 38 // or tort (including negligence or otherwise) arising in any way out of 39 // the use of this software, even if advised of the possibility of such damage. 40 // 41 //M*/ 42 43 #include "precomp.hpp" 44 #include "gl_core_3_1.hpp" 45 46 #ifdef HAVE_OPENGL 47 48 #ifdef __APPLE__ 49 #include <dlfcn.h> 50 AppleGLGetProcAddress(const char * name)51 static void* AppleGLGetProcAddress (const char* name) 52 { 53 static bool initialized = false; 54 static void * handle = NULL; 55 if (!handle) 56 { 57 if (!initialized) 58 { 59 initialized = true; 60 const char * const path = "/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL"; 61 62 handle = dlopen(path, RTLD_LAZY | RTLD_GLOBAL); 63 } 64 if (!handle) 65 return NULL; 66 } 67 return dlsym(handle, name); 68 } 69 #endif // __APPLE__ 70 71 #if defined(__sgi) || defined (__sun) 72 #include <dlfcn.h> 73 #include <stdio.h> 74 SunGetProcAddress(const char * name)75 static void* SunGetProcAddress (const char* name) 76 { 77 typedef void* (func_t*)(const GLubyte*); 78 79 static void* h = 0; 80 static func_t gpa = 0; 81 82 if (!h) 83 { 84 h = dlopen(NULL, RTLD_LAZY | RTLD_LOCAL); 85 if (!h) 86 return 0; 87 gpa = (func_t) dlsym(h, "glXGetProcAddress"); 88 } 89 90 return gpa ? gpa((const GLubyte*) name) : dlsym(h, name); 91 } 92 #endif // __sgi || __sun 93 94 #if defined(_WIN32) 95 #ifdef _MSC_VER 96 #pragma warning(disable: 4055) 97 #pragma warning(disable: 4054) 98 #endif 99 TestPointer(const PROC pTest)100 static int TestPointer(const PROC pTest) 101 { 102 if(!pTest) 103 return 0; 104 105 ptrdiff_t iTest = (ptrdiff_t) pTest; 106 107 if (iTest == 1 || iTest == 2 || iTest == 3 || iTest == -1) 108 return 0; 109 110 return 1; 111 } 112 WinGetProcAddress(const char * name)113 static PROC WinGetProcAddress(const char* name) 114 { 115 PROC pFunc = wglGetProcAddress((LPCSTR) name); 116 if (TestPointer(pFunc)) 117 return pFunc; 118 119 HMODULE glMod = GetModuleHandleA("OpenGL32.dll"); 120 return (PROC) GetProcAddress(glMod, (LPCSTR) name); 121 } 122 #endif // _WIN32 123 124 #if defined(_WIN32) 125 #define CV_GL_GET_PROC_ADDRESS(name) WinGetProcAddress(name) 126 #elif defined(__APPLE__) 127 #define CV_GL_GET_PROC_ADDRESS(name) AppleGLGetProcAddress(name) 128 #elif defined(__sgi) || defined(__sun) 129 #define CV_GL_GET_PROC_ADDRESS(name) SunGetProcAddress(name) 130 #else // GLX 131 #include <GL/glx.h> 132 133 #define CV_GL_GET_PROC_ADDRESS(name) glXGetProcAddressARB((const GLubyte*) name) 134 #endif 135 IntGetProcAddress(const char * name)136 static void* IntGetProcAddress(const char* name) 137 { 138 void* func = (void*) CV_GL_GET_PROC_ADDRESS(name); 139 if (!func) 140 { 141 CV_Error(cv::Error::OpenGlApiCallError, cv::format("Can't load OpenGL extension [%s]", name) ); 142 } 143 return func; 144 } 145 #else IntGetProcAddress(const char *)146 static void* IntGetProcAddress(const char*) 147 { 148 CV_Error(cv::Error::OpenGlNotSupported, "The library is compiled without OpenGL support"); 149 return 0; 150 } 151 #endif 152 153 namespace gl 154 { 155 ////////////////////////////////////////////// 156 // Function pointer types 157 158 // Extension: 1.1 159 typedef void (CODEGEN_FUNCPTR *PFNCULLFACEPROC)(GLenum ); 160 typedef void (CODEGEN_FUNCPTR *PFNFRONTFACEPROC)(GLenum ); 161 typedef void (CODEGEN_FUNCPTR *PFNHINTPROC)(GLenum , GLenum ); 162 typedef void (CODEGEN_FUNCPTR *PFNLINEWIDTHPROC)(GLfloat ); 163 typedef void (CODEGEN_FUNCPTR *PFNPOINTSIZEPROC)(GLfloat ); 164 typedef void (CODEGEN_FUNCPTR *PFNPOLYGONMODEPROC)(GLenum , GLenum ); 165 typedef void (CODEGEN_FUNCPTR *PFNSCISSORPROC)(GLint , GLint , GLsizei , GLsizei ); 166 typedef void (CODEGEN_FUNCPTR *PFNTEXPARAMETERFPROC)(GLenum , GLenum , GLfloat ); 167 typedef void (CODEGEN_FUNCPTR *PFNTEXPARAMETERFVPROC)(GLenum , GLenum , const GLfloat *); 168 typedef void (CODEGEN_FUNCPTR *PFNTEXPARAMETERIPROC)(GLenum , GLenum , GLint ); 169 typedef void (CODEGEN_FUNCPTR *PFNTEXPARAMETERIVPROC)(GLenum , GLenum , const GLint *); 170 typedef void (CODEGEN_FUNCPTR *PFNTEXIMAGE1DPROC)(GLenum , GLint , GLint , GLsizei , GLint , GLenum , GLenum , const GLvoid *); 171 typedef void (CODEGEN_FUNCPTR *PFNTEXIMAGE2DPROC)(GLenum , GLint , GLint , GLsizei , GLsizei , GLint , GLenum , GLenum , const GLvoid *); 172 typedef void (CODEGEN_FUNCPTR *PFNDRAWBUFFERPROC)(GLenum ); 173 typedef void (CODEGEN_FUNCPTR *PFNCLEARPROC)(GLbitfield ); 174 typedef void (CODEGEN_FUNCPTR *PFNCLEARCOLORPROC)(GLfloat , GLfloat , GLfloat , GLfloat ); 175 typedef void (CODEGEN_FUNCPTR *PFNCLEARSTENCILPROC)(GLint ); 176 typedef void (CODEGEN_FUNCPTR *PFNCLEARDEPTHPROC)(GLdouble ); 177 typedef void (CODEGEN_FUNCPTR *PFNSTENCILMASKPROC)(GLuint ); 178 typedef void (CODEGEN_FUNCPTR *PFNCOLORMASKPROC)(GLboolean , GLboolean , GLboolean , GLboolean ); 179 typedef void (CODEGEN_FUNCPTR *PFNDEPTHMASKPROC)(GLboolean ); 180 typedef void (CODEGEN_FUNCPTR *PFNDISABLEPROC)(GLenum ); 181 typedef void (CODEGEN_FUNCPTR *PFNENABLEPROC)(GLenum ); 182 typedef void (CODEGEN_FUNCPTR *PFNFINISHPROC)(); 183 typedef void (CODEGEN_FUNCPTR *PFNFLUSHPROC)(); 184 typedef void (CODEGEN_FUNCPTR *PFNBLENDFUNCPROC)(GLenum , GLenum ); 185 typedef void (CODEGEN_FUNCPTR *PFNLOGICOPPROC)(GLenum ); 186 typedef void (CODEGEN_FUNCPTR *PFNSTENCILFUNCPROC)(GLenum , GLint , GLuint ); 187 typedef void (CODEGEN_FUNCPTR *PFNSTENCILOPPROC)(GLenum , GLenum , GLenum ); 188 typedef void (CODEGEN_FUNCPTR *PFNDEPTHFUNCPROC)(GLenum ); 189 typedef void (CODEGEN_FUNCPTR *PFNPIXELSTOREFPROC)(GLenum , GLfloat ); 190 typedef void (CODEGEN_FUNCPTR *PFNPIXELSTOREIPROC)(GLenum , GLint ); 191 typedef void (CODEGEN_FUNCPTR *PFNREADBUFFERPROC)(GLenum ); 192 typedef void (CODEGEN_FUNCPTR *PFNREADPIXELSPROC)(GLint , GLint , GLsizei , GLsizei , GLenum , GLenum , GLvoid *); 193 typedef void (CODEGEN_FUNCPTR *PFNGETBOOLEANVPROC)(GLenum , GLboolean *); 194 typedef void (CODEGEN_FUNCPTR *PFNGETDOUBLEVPROC)(GLenum , GLdouble *); 195 typedef GLenum (CODEGEN_FUNCPTR *PFNGETERRORPROC)(); 196 typedef void (CODEGEN_FUNCPTR *PFNGETFLOATVPROC)(GLenum , GLfloat *); 197 typedef void (CODEGEN_FUNCPTR *PFNGETINTEGERVPROC)(GLenum , GLint *); 198 typedef const GLubyte * (CODEGEN_FUNCPTR *PFNGETSTRINGPROC)(GLenum ); 199 typedef void (CODEGEN_FUNCPTR *PFNGETTEXIMAGEPROC)(GLenum , GLint , GLenum , GLenum , GLvoid *); 200 typedef void (CODEGEN_FUNCPTR *PFNGETTEXPARAMETERFVPROC)(GLenum , GLenum , GLfloat *); 201 typedef void (CODEGEN_FUNCPTR *PFNGETTEXPARAMETERIVPROC)(GLenum , GLenum , GLint *); 202 typedef void (CODEGEN_FUNCPTR *PFNGETTEXLEVELPARAMETERFVPROC)(GLenum , GLint , GLenum , GLfloat *); 203 typedef void (CODEGEN_FUNCPTR *PFNGETTEXLEVELPARAMETERIVPROC)(GLenum , GLint , GLenum , GLint *); 204 typedef GLboolean (CODEGEN_FUNCPTR *PFNISENABLEDPROC)(GLenum ); 205 typedef void (CODEGEN_FUNCPTR *PFNDEPTHRANGEPROC)(GLdouble , GLdouble ); 206 typedef void (CODEGEN_FUNCPTR *PFNVIEWPORTPROC)(GLint , GLint , GLsizei , GLsizei ); 207 typedef void (CODEGEN_FUNCPTR *PFNDRAWARRAYSPROC)(GLenum , GLint , GLsizei ); 208 typedef void (CODEGEN_FUNCPTR *PFNDRAWELEMENTSPROC)(GLenum , GLsizei , GLenum , const GLvoid *); 209 typedef void (CODEGEN_FUNCPTR *PFNGETPOINTERVPROC)(GLenum , GLvoid* *); 210 typedef void (CODEGEN_FUNCPTR *PFNPOLYGONOFFSETPROC)(GLfloat , GLfloat ); 211 typedef void (CODEGEN_FUNCPTR *PFNCOPYTEXIMAGE1DPROC)(GLenum , GLint , GLenum , GLint , GLint , GLsizei , GLint ); 212 typedef void (CODEGEN_FUNCPTR *PFNCOPYTEXIMAGE2DPROC)(GLenum , GLint , GLenum , GLint , GLint , GLsizei , GLsizei , GLint ); 213 typedef void (CODEGEN_FUNCPTR *PFNCOPYTEXSUBIMAGE1DPROC)(GLenum , GLint , GLint , GLint , GLint , GLsizei ); 214 typedef void (CODEGEN_FUNCPTR *PFNCOPYTEXSUBIMAGE2DPROC)(GLenum , GLint , GLint , GLint , GLint , GLint , GLsizei , GLsizei ); 215 typedef void (CODEGEN_FUNCPTR *PFNTEXSUBIMAGE1DPROC)(GLenum , GLint , GLint , GLsizei , GLenum , GLenum , const GLvoid *); 216 typedef void (CODEGEN_FUNCPTR *PFNTEXSUBIMAGE2DPROC)(GLenum , GLint , GLint , GLint , GLsizei , GLsizei , GLenum , GLenum , const GLvoid *); 217 typedef void (CODEGEN_FUNCPTR *PFNBINDTEXTUREPROC)(GLenum , GLuint ); 218 typedef void (CODEGEN_FUNCPTR *PFNDELETETEXTURESPROC)(GLsizei , const GLuint *); 219 typedef void (CODEGEN_FUNCPTR *PFNGENTEXTURESPROC)(GLsizei , GLuint *); 220 typedef GLboolean (CODEGEN_FUNCPTR *PFNISTEXTUREPROC)(GLuint ); 221 typedef void (CODEGEN_FUNCPTR *PFNINDEXUBPROC)(GLubyte ); 222 typedef void (CODEGEN_FUNCPTR *PFNINDEXUBVPROC)(const GLubyte *); 223 224 // Extension: 1.2 225 typedef void (CODEGEN_FUNCPTR *PFNBLENDCOLORPROC)(GLfloat , GLfloat , GLfloat , GLfloat ); 226 typedef void (CODEGEN_FUNCPTR *PFNBLENDEQUATIONPROC)(GLenum ); 227 typedef void (CODEGEN_FUNCPTR *PFNDRAWRANGEELEMENTSPROC)(GLenum , GLuint , GLuint , GLsizei , GLenum , const GLvoid *); 228 typedef void (CODEGEN_FUNCPTR *PFNTEXSUBIMAGE3DPROC)(GLenum , GLint , GLint , GLint , GLint , GLsizei , GLsizei , GLsizei , GLenum , GLenum , const GLvoid *); 229 typedef void (CODEGEN_FUNCPTR *PFNCOPYTEXSUBIMAGE3DPROC)(GLenum , GLint , GLint , GLint , GLint , GLint , GLint , GLsizei , GLsizei ); 230 231 // Extension: 1.3 232 typedef void (CODEGEN_FUNCPTR *PFNACTIVETEXTUREPROC)(GLenum ); 233 typedef void (CODEGEN_FUNCPTR *PFNSAMPLECOVERAGEPROC)(GLfloat , GLboolean ); 234 typedef void (CODEGEN_FUNCPTR *PFNCOMPRESSEDTEXIMAGE3DPROC)(GLenum , GLint , GLenum , GLsizei , GLsizei , GLsizei , GLint , GLsizei , const GLvoid *); 235 typedef void (CODEGEN_FUNCPTR *PFNCOMPRESSEDTEXIMAGE2DPROC)(GLenum , GLint , GLenum , GLsizei , GLsizei , GLint , GLsizei , const GLvoid *); 236 typedef void (CODEGEN_FUNCPTR *PFNCOMPRESSEDTEXIMAGE1DPROC)(GLenum , GLint , GLenum , GLsizei , GLint , GLsizei , const GLvoid *); 237 typedef void (CODEGEN_FUNCPTR *PFNCOMPRESSEDTEXSUBIMAGE3DPROC)(GLenum , GLint , GLint , GLint , GLint , GLsizei , GLsizei , GLsizei , GLenum , GLsizei , const GLvoid *); 238 typedef void (CODEGEN_FUNCPTR *PFNCOMPRESSEDTEXSUBIMAGE2DPROC)(GLenum , GLint , GLint , GLint , GLsizei , GLsizei , GLenum , GLsizei , const GLvoid *); 239 typedef void (CODEGEN_FUNCPTR *PFNCOMPRESSEDTEXSUBIMAGE1DPROC)(GLenum , GLint , GLint , GLsizei , GLenum , GLsizei , const GLvoid *); 240 typedef void (CODEGEN_FUNCPTR *PFNGETCOMPRESSEDTEXIMAGEPROC)(GLenum , GLint , GLvoid *); 241 242 // Extension: 1.4 243 typedef void (CODEGEN_FUNCPTR *PFNBLENDFUNCSEPARATEPROC)(GLenum , GLenum , GLenum , GLenum ); 244 typedef void (CODEGEN_FUNCPTR *PFNMULTIDRAWARRAYSPROC)(GLenum , const GLint *, const GLsizei *, GLsizei ); 245 typedef void (CODEGEN_FUNCPTR *PFNMULTIDRAWELEMENTSPROC)(GLenum , const GLsizei *, GLenum , const GLvoid* const *, GLsizei ); 246 typedef void (CODEGEN_FUNCPTR *PFNPOINTPARAMETERFPROC)(GLenum , GLfloat ); 247 typedef void (CODEGEN_FUNCPTR *PFNPOINTPARAMETERFVPROC)(GLenum , const GLfloat *); 248 typedef void (CODEGEN_FUNCPTR *PFNPOINTPARAMETERIPROC)(GLenum , GLint ); 249 typedef void (CODEGEN_FUNCPTR *PFNPOINTPARAMETERIVPROC)(GLenum , const GLint *); 250 251 // Extension: 1.5 252 typedef void (CODEGEN_FUNCPTR *PFNGENQUERIESPROC)(GLsizei , GLuint *); 253 typedef void (CODEGEN_FUNCPTR *PFNDELETEQUERIESPROC)(GLsizei , const GLuint *); 254 typedef GLboolean (CODEGEN_FUNCPTR *PFNISQUERYPROC)(GLuint ); 255 typedef void (CODEGEN_FUNCPTR *PFNBEGINQUERYPROC)(GLenum , GLuint ); 256 typedef void (CODEGEN_FUNCPTR *PFNENDQUERYPROC)(GLenum ); 257 typedef void (CODEGEN_FUNCPTR *PFNGETQUERYIVPROC)(GLenum , GLenum , GLint *); 258 typedef void (CODEGEN_FUNCPTR *PFNGETQUERYOBJECTIVPROC)(GLuint , GLenum , GLint *); 259 typedef void (CODEGEN_FUNCPTR *PFNGETQUERYOBJECTUIVPROC)(GLuint , GLenum , GLuint *); 260 typedef void (CODEGEN_FUNCPTR *PFNBINDBUFFERPROC)(GLenum , GLuint ); 261 typedef void (CODEGEN_FUNCPTR *PFNDELETEBUFFERSPROC)(GLsizei , const GLuint *); 262 typedef void (CODEGEN_FUNCPTR *PFNGENBUFFERSPROC)(GLsizei , GLuint *); 263 typedef GLboolean (CODEGEN_FUNCPTR *PFNISBUFFERPROC)(GLuint ); 264 typedef void (CODEGEN_FUNCPTR *PFNBUFFERDATAPROC)(GLenum , GLsizeiptr , const GLvoid *, GLenum ); 265 typedef void (CODEGEN_FUNCPTR *PFNBUFFERSUBDATAPROC)(GLenum , GLintptr , GLsizeiptr , const GLvoid *); 266 typedef void (CODEGEN_FUNCPTR *PFNGETBUFFERSUBDATAPROC)(GLenum , GLintptr , GLsizeiptr , GLvoid *); 267 typedef GLvoid* (CODEGEN_FUNCPTR *PFNMAPBUFFERPROC)(GLenum , GLenum ); 268 typedef GLboolean (CODEGEN_FUNCPTR *PFNUNMAPBUFFERPROC)(GLenum ); 269 typedef void (CODEGEN_FUNCPTR *PFNGETBUFFERPARAMETERIVPROC)(GLenum , GLenum , GLint *); 270 typedef void (CODEGEN_FUNCPTR *PFNGETBUFFERPOINTERVPROC)(GLenum , GLenum , GLvoid* *); 271 272 // Extension: 2.0 273 typedef void (CODEGEN_FUNCPTR *PFNBLENDEQUATIONSEPARATEPROC)(GLenum , GLenum ); 274 typedef void (CODEGEN_FUNCPTR *PFNDRAWBUFFERSPROC)(GLsizei , const GLenum *); 275 typedef void (CODEGEN_FUNCPTR *PFNSTENCILOPSEPARATEPROC)(GLenum , GLenum , GLenum , GLenum ); 276 typedef void (CODEGEN_FUNCPTR *PFNSTENCILFUNCSEPARATEPROC)(GLenum , GLenum , GLint , GLuint ); 277 typedef void (CODEGEN_FUNCPTR *PFNSTENCILMASKSEPARATEPROC)(GLenum , GLuint ); 278 typedef void (CODEGEN_FUNCPTR *PFNATTACHSHADERPROC)(GLuint , GLuint ); 279 typedef void (CODEGEN_FUNCPTR *PFNBINDATTRIBLOCATIONPROC)(GLuint , GLuint , const GLchar *); 280 typedef void (CODEGEN_FUNCPTR *PFNCOMPILESHADERPROC)(GLuint ); 281 typedef GLuint (CODEGEN_FUNCPTR *PFNCREATEPROGRAMPROC)(); 282 typedef GLuint (CODEGEN_FUNCPTR *PFNCREATESHADERPROC)(GLenum ); 283 typedef void (CODEGEN_FUNCPTR *PFNDELETEPROGRAMPROC)(GLuint ); 284 typedef void (CODEGEN_FUNCPTR *PFNDELETESHADERPROC)(GLuint ); 285 typedef void (CODEGEN_FUNCPTR *PFNDETACHSHADERPROC)(GLuint , GLuint ); 286 typedef void (CODEGEN_FUNCPTR *PFNDISABLEVERTEXATTRIBARRAYPROC)(GLuint ); 287 typedef void (CODEGEN_FUNCPTR *PFNENABLEVERTEXATTRIBARRAYPROC)(GLuint ); 288 typedef void (CODEGEN_FUNCPTR *PFNGETACTIVEATTRIBPROC)(GLuint , GLuint , GLsizei , GLsizei *, GLint *, GLenum *, GLchar *); 289 typedef void (CODEGEN_FUNCPTR *PFNGETACTIVEUNIFORMPROC)(GLuint , GLuint , GLsizei , GLsizei *, GLint *, GLenum *, GLchar *); 290 typedef void (CODEGEN_FUNCPTR *PFNGETATTACHEDSHADERSPROC)(GLuint , GLsizei , GLsizei *, GLuint *); 291 typedef GLint (CODEGEN_FUNCPTR *PFNGETATTRIBLOCATIONPROC)(GLuint , const GLchar *); 292 typedef void (CODEGEN_FUNCPTR *PFNGETPROGRAMIVPROC)(GLuint , GLenum , GLint *); 293 typedef void (CODEGEN_FUNCPTR *PFNGETPROGRAMINFOLOGPROC)(GLuint , GLsizei , GLsizei *, GLchar *); 294 typedef void (CODEGEN_FUNCPTR *PFNGETSHADERIVPROC)(GLuint , GLenum , GLint *); 295 typedef void (CODEGEN_FUNCPTR *PFNGETSHADERINFOLOGPROC)(GLuint , GLsizei , GLsizei *, GLchar *); 296 typedef void (CODEGEN_FUNCPTR *PFNGETSHADERSOURCEPROC)(GLuint , GLsizei , GLsizei *, GLchar *); 297 typedef GLint (CODEGEN_FUNCPTR *PFNGETUNIFORMLOCATIONPROC)(GLuint , const GLchar *); 298 typedef void (CODEGEN_FUNCPTR *PFNGETUNIFORMFVPROC)(GLuint , GLint , GLfloat *); 299 typedef void (CODEGEN_FUNCPTR *PFNGETUNIFORMIVPROC)(GLuint , GLint , GLint *); 300 typedef void (CODEGEN_FUNCPTR *PFNGETVERTEXATTRIBDVPROC)(GLuint , GLenum , GLdouble *); 301 typedef void (CODEGEN_FUNCPTR *PFNGETVERTEXATTRIBFVPROC)(GLuint , GLenum , GLfloat *); 302 typedef void (CODEGEN_FUNCPTR *PFNGETVERTEXATTRIBIVPROC)(GLuint , GLenum , GLint *); 303 typedef void (CODEGEN_FUNCPTR *PFNGETVERTEXATTRIBPOINTERVPROC)(GLuint , GLenum , GLvoid* *); 304 typedef GLboolean (CODEGEN_FUNCPTR *PFNISPROGRAMPROC)(GLuint ); 305 typedef GLboolean (CODEGEN_FUNCPTR *PFNISSHADERPROC)(GLuint ); 306 typedef void (CODEGEN_FUNCPTR *PFNLINKPROGRAMPROC)(GLuint ); 307 typedef void (CODEGEN_FUNCPTR *PFNSHADERSOURCEPROC)(GLuint , GLsizei , const GLchar* const *, const GLint *); 308 typedef void (CODEGEN_FUNCPTR *PFNUSEPROGRAMPROC)(GLuint ); 309 typedef void (CODEGEN_FUNCPTR *PFNUNIFORM1FPROC)(GLint , GLfloat ); 310 typedef void (CODEGEN_FUNCPTR *PFNUNIFORM2FPROC)(GLint , GLfloat , GLfloat ); 311 typedef void (CODEGEN_FUNCPTR *PFNUNIFORM3FPROC)(GLint , GLfloat , GLfloat , GLfloat ); 312 typedef void (CODEGEN_FUNCPTR *PFNUNIFORM4FPROC)(GLint , GLfloat , GLfloat , GLfloat , GLfloat ); 313 typedef void (CODEGEN_FUNCPTR *PFNUNIFORM1IPROC)(GLint , GLint ); 314 typedef void (CODEGEN_FUNCPTR *PFNUNIFORM2IPROC)(GLint , GLint , GLint ); 315 typedef void (CODEGEN_FUNCPTR *PFNUNIFORM3IPROC)(GLint , GLint , GLint , GLint ); 316 typedef void (CODEGEN_FUNCPTR *PFNUNIFORM4IPROC)(GLint , GLint , GLint , GLint , GLint ); 317 typedef void (CODEGEN_FUNCPTR *PFNUNIFORM1FVPROC)(GLint , GLsizei , const GLfloat *); 318 typedef void (CODEGEN_FUNCPTR *PFNUNIFORM2FVPROC)(GLint , GLsizei , const GLfloat *); 319 typedef void (CODEGEN_FUNCPTR *PFNUNIFORM3FVPROC)(GLint , GLsizei , const GLfloat *); 320 typedef void (CODEGEN_FUNCPTR *PFNUNIFORM4FVPROC)(GLint , GLsizei , const GLfloat *); 321 typedef void (CODEGEN_FUNCPTR *PFNUNIFORM1IVPROC)(GLint , GLsizei , const GLint *); 322 typedef void (CODEGEN_FUNCPTR *PFNUNIFORM2IVPROC)(GLint , GLsizei , const GLint *); 323 typedef void (CODEGEN_FUNCPTR *PFNUNIFORM3IVPROC)(GLint , GLsizei , const GLint *); 324 typedef void (CODEGEN_FUNCPTR *PFNUNIFORM4IVPROC)(GLint , GLsizei , const GLint *); 325 typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX2FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); 326 typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX3FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); 327 typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX4FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); 328 typedef void (CODEGEN_FUNCPTR *PFNVALIDATEPROGRAMPROC)(GLuint ); 329 typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBPOINTERPROC)(GLuint , GLint , GLenum , GLboolean , GLsizei , const GLvoid *); 330 331 // Extension: 2.1 332 typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX2X3FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); 333 typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX3X2FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); 334 typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX2X4FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); 335 typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX4X2FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); 336 typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX3X4FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); 337 typedef void (CODEGEN_FUNCPTR *PFNUNIFORMMATRIX4X3FVPROC)(GLint , GLsizei , GLboolean , const GLfloat *); 338 339 // Extension: ARB_vertex_array_object 340 typedef void (CODEGEN_FUNCPTR *PFNBINDVERTEXARRAYPROC)(GLuint ); 341 typedef void (CODEGEN_FUNCPTR *PFNDELETEVERTEXARRAYSPROC)(GLsizei , const GLuint *); 342 typedef void (CODEGEN_FUNCPTR *PFNGENVERTEXARRAYSPROC)(GLsizei , GLuint *); 343 typedef GLboolean (CODEGEN_FUNCPTR *PFNISVERTEXARRAYPROC)(GLuint ); 344 345 // Extension: ARB_map_buffer_range 346 typedef GLvoid* (CODEGEN_FUNCPTR *PFNMAPBUFFERRANGEPROC)(GLenum , GLintptr , GLsizeiptr , GLbitfield ); 347 typedef void (CODEGEN_FUNCPTR *PFNFLUSHMAPPEDBUFFERRANGEPROC)(GLenum , GLintptr , GLsizeiptr ); 348 349 // Extension: ARB_framebuffer_object 350 typedef GLboolean (CODEGEN_FUNCPTR *PFNISRENDERBUFFERPROC)(GLuint ); 351 typedef void (CODEGEN_FUNCPTR *PFNBINDRENDERBUFFERPROC)(GLenum , GLuint ); 352 typedef void (CODEGEN_FUNCPTR *PFNDELETERENDERBUFFERSPROC)(GLsizei , const GLuint *); 353 typedef void (CODEGEN_FUNCPTR *PFNGENRENDERBUFFERSPROC)(GLsizei , GLuint *); 354 typedef void (CODEGEN_FUNCPTR *PFNRENDERBUFFERSTORAGEPROC)(GLenum , GLenum , GLsizei , GLsizei ); 355 typedef void (CODEGEN_FUNCPTR *PFNGETRENDERBUFFERPARAMETERIVPROC)(GLenum , GLenum , GLint *); 356 typedef GLboolean (CODEGEN_FUNCPTR *PFNISFRAMEBUFFERPROC)(GLuint ); 357 typedef void (CODEGEN_FUNCPTR *PFNBINDFRAMEBUFFERPROC)(GLenum , GLuint ); 358 typedef void (CODEGEN_FUNCPTR *PFNDELETEFRAMEBUFFERSPROC)(GLsizei , const GLuint *); 359 typedef void (CODEGEN_FUNCPTR *PFNGENFRAMEBUFFERSPROC)(GLsizei , GLuint *); 360 typedef GLenum (CODEGEN_FUNCPTR *PFNCHECKFRAMEBUFFERSTATUSPROC)(GLenum ); 361 typedef void (CODEGEN_FUNCPTR *PFNFRAMEBUFFERTEXTURE1DPROC)(GLenum , GLenum , GLenum , GLuint , GLint ); 362 typedef void (CODEGEN_FUNCPTR *PFNFRAMEBUFFERTEXTURE2DPROC)(GLenum , GLenum , GLenum , GLuint , GLint ); 363 typedef void (CODEGEN_FUNCPTR *PFNFRAMEBUFFERTEXTURE3DPROC)(GLenum , GLenum , GLenum , GLuint , GLint , GLint ); 364 typedef void (CODEGEN_FUNCPTR *PFNFRAMEBUFFERRENDERBUFFERPROC)(GLenum , GLenum , GLenum , GLuint ); 365 typedef void (CODEGEN_FUNCPTR *PFNGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLenum , GLenum , GLenum , GLint *); 366 typedef void (CODEGEN_FUNCPTR *PFNGENERATEMIPMAPPROC)(GLenum ); 367 typedef void (CODEGEN_FUNCPTR *PFNBLITFRAMEBUFFERPROC)(GLint , GLint , GLint , GLint , GLint , GLint , GLint , GLint , GLbitfield , GLenum ); 368 typedef void (CODEGEN_FUNCPTR *PFNRENDERBUFFERSTORAGEMULTISAMPLEPROC)(GLenum , GLsizei , GLenum , GLsizei , GLsizei ); 369 typedef void (CODEGEN_FUNCPTR *PFNFRAMEBUFFERTEXTURELAYERPROC)(GLenum , GLenum , GLuint , GLint , GLint ); 370 371 // Extension: 3.0 372 typedef void (CODEGEN_FUNCPTR *PFNCOLORMASKIPROC)(GLuint , GLboolean , GLboolean , GLboolean , GLboolean ); 373 typedef void (CODEGEN_FUNCPTR *PFNGETBOOLEANI_VPROC)(GLenum , GLuint , GLboolean *); 374 typedef void (CODEGEN_FUNCPTR *PFNGETINTEGERI_VPROC)(GLenum , GLuint , GLint *); 375 typedef void (CODEGEN_FUNCPTR *PFNENABLEIPROC)(GLenum , GLuint ); 376 typedef void (CODEGEN_FUNCPTR *PFNDISABLEIPROC)(GLenum , GLuint ); 377 typedef GLboolean (CODEGEN_FUNCPTR *PFNISENABLEDIPROC)(GLenum , GLuint ); 378 typedef void (CODEGEN_FUNCPTR *PFNBEGINTRANSFORMFEEDBACKPROC)(GLenum ); 379 typedef void (CODEGEN_FUNCPTR *PFNENDTRANSFORMFEEDBACKPROC)(); 380 typedef void (CODEGEN_FUNCPTR *PFNBINDBUFFERRANGEPROC)(GLenum , GLuint , GLuint , GLintptr , GLsizeiptr ); 381 typedef void (CODEGEN_FUNCPTR *PFNBINDBUFFERBASEPROC)(GLenum , GLuint , GLuint ); 382 typedef void (CODEGEN_FUNCPTR *PFNTRANSFORMFEEDBACKVARYINGSPROC)(GLuint , GLsizei , const GLchar* const *, GLenum ); 383 typedef void (CODEGEN_FUNCPTR *PFNGETTRANSFORMFEEDBACKVARYINGPROC)(GLuint , GLuint , GLsizei , GLsizei *, GLsizei *, GLenum *, GLchar *); 384 typedef void (CODEGEN_FUNCPTR *PFNCLAMPCOLORPROC)(GLenum , GLenum ); 385 typedef void (CODEGEN_FUNCPTR *PFNBEGINCONDITIONALRENDERPROC)(GLuint , GLenum ); 386 typedef void (CODEGEN_FUNCPTR *PFNENDCONDITIONALRENDERPROC)(); 387 typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBIPOINTERPROC)(GLuint , GLint , GLenum , GLsizei , const GLvoid *); 388 typedef void (CODEGEN_FUNCPTR *PFNGETVERTEXATTRIBIIVPROC)(GLuint , GLenum , GLint *); 389 typedef void (CODEGEN_FUNCPTR *PFNGETVERTEXATTRIBIUIVPROC)(GLuint , GLenum , GLuint *); 390 typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI1IPROC)(GLuint , GLint ); 391 typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI2IPROC)(GLuint , GLint , GLint ); 392 typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI3IPROC)(GLuint , GLint , GLint , GLint ); 393 typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI4IPROC)(GLuint , GLint , GLint , GLint , GLint ); 394 typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI1UIPROC)(GLuint , GLuint ); 395 typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI2UIPROC)(GLuint , GLuint , GLuint ); 396 typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI3UIPROC)(GLuint , GLuint , GLuint , GLuint ); 397 typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI4UIPROC)(GLuint , GLuint , GLuint , GLuint , GLuint ); 398 typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI1IVPROC)(GLuint , const GLint *); 399 typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI2IVPROC)(GLuint , const GLint *); 400 typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI3IVPROC)(GLuint , const GLint *); 401 typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI4IVPROC)(GLuint , const GLint *); 402 typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI1UIVPROC)(GLuint , const GLuint *); 403 typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI2UIVPROC)(GLuint , const GLuint *); 404 typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI3UIVPROC)(GLuint , const GLuint *); 405 typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI4UIVPROC)(GLuint , const GLuint *); 406 typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI4BVPROC)(GLuint , const GLbyte *); 407 typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI4SVPROC)(GLuint , const GLshort *); 408 typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI4UBVPROC)(GLuint , const GLubyte *); 409 typedef void (CODEGEN_FUNCPTR *PFNVERTEXATTRIBI4USVPROC)(GLuint , const GLushort *); 410 typedef void (CODEGEN_FUNCPTR *PFNGETUNIFORMUIVPROC)(GLuint , GLint , GLuint *); 411 typedef void (CODEGEN_FUNCPTR *PFNBINDFRAGDATALOCATIONPROC)(GLuint , GLuint , const GLchar *); 412 typedef GLint (CODEGEN_FUNCPTR *PFNGETFRAGDATALOCATIONPROC)(GLuint , const GLchar *); 413 typedef void (CODEGEN_FUNCPTR *PFNUNIFORM1UIPROC)(GLint , GLuint ); 414 typedef void (CODEGEN_FUNCPTR *PFNUNIFORM2UIPROC)(GLint , GLuint , GLuint ); 415 typedef void (CODEGEN_FUNCPTR *PFNUNIFORM3UIPROC)(GLint , GLuint , GLuint , GLuint ); 416 typedef void (CODEGEN_FUNCPTR *PFNUNIFORM4UIPROC)(GLint , GLuint , GLuint , GLuint , GLuint ); 417 typedef void (CODEGEN_FUNCPTR *PFNUNIFORM1UIVPROC)(GLint , GLsizei , const GLuint *); 418 typedef void (CODEGEN_FUNCPTR *PFNUNIFORM2UIVPROC)(GLint , GLsizei , const GLuint *); 419 typedef void (CODEGEN_FUNCPTR *PFNUNIFORM3UIVPROC)(GLint , GLsizei , const GLuint *); 420 typedef void (CODEGEN_FUNCPTR *PFNUNIFORM4UIVPROC)(GLint , GLsizei , const GLuint *); 421 typedef void (CODEGEN_FUNCPTR *PFNTEXPARAMETERIIVPROC)(GLenum , GLenum , const GLint *); 422 typedef void (CODEGEN_FUNCPTR *PFNTEXPARAMETERIUIVPROC)(GLenum , GLenum , const GLuint *); 423 typedef void (CODEGEN_FUNCPTR *PFNGETTEXPARAMETERIIVPROC)(GLenum , GLenum , GLint *); 424 typedef void (CODEGEN_FUNCPTR *PFNGETTEXPARAMETERIUIVPROC)(GLenum , GLenum , GLuint *); 425 typedef void (CODEGEN_FUNCPTR *PFNCLEARBUFFERIVPROC)(GLenum , GLint , const GLint *); 426 typedef void (CODEGEN_FUNCPTR *PFNCLEARBUFFERUIVPROC)(GLenum , GLint , const GLuint *); 427 typedef void (CODEGEN_FUNCPTR *PFNCLEARBUFFERFVPROC)(GLenum , GLint , const GLfloat *); 428 typedef void (CODEGEN_FUNCPTR *PFNCLEARBUFFERFIPROC)(GLenum , GLint , GLfloat , GLint ); 429 typedef const GLubyte * (CODEGEN_FUNCPTR *PFNGETSTRINGIPROC)(GLenum , GLuint ); 430 431 // Extension: ARB_uniform_buffer_object 432 typedef void (CODEGEN_FUNCPTR *PFNGETUNIFORMINDICESPROC)(GLuint , GLsizei , const GLchar* const *, GLuint *); 433 typedef void (CODEGEN_FUNCPTR *PFNGETACTIVEUNIFORMSIVPROC)(GLuint , GLsizei , const GLuint *, GLenum , GLint *); 434 typedef void (CODEGEN_FUNCPTR *PFNGETACTIVEUNIFORMNAMEPROC)(GLuint , GLuint , GLsizei , GLsizei *, GLchar *); 435 typedef GLuint (CODEGEN_FUNCPTR *PFNGETUNIFORMBLOCKINDEXPROC)(GLuint , const GLchar *); 436 typedef void (CODEGEN_FUNCPTR *PFNGETACTIVEUNIFORMBLOCKIVPROC)(GLuint , GLuint , GLenum , GLint *); 437 typedef void (CODEGEN_FUNCPTR *PFNGETACTIVEUNIFORMBLOCKNAMEPROC)(GLuint , GLuint , GLsizei , GLsizei *, GLchar *); 438 typedef void (CODEGEN_FUNCPTR *PFNUNIFORMBLOCKBINDINGPROC)(GLuint , GLuint , GLuint ); 439 440 // Extension: ARB_copy_buffer 441 typedef void (CODEGEN_FUNCPTR *PFNCOPYBUFFERSUBDATAPROC)(GLenum , GLenum , GLintptr , GLintptr , GLsizeiptr ); 442 443 // Extension: 3.1 444 typedef void (CODEGEN_FUNCPTR *PFNDRAWARRAYSINSTANCEDPROC)(GLenum , GLint , GLsizei , GLsizei ); 445 typedef void (CODEGEN_FUNCPTR *PFNDRAWELEMENTSINSTANCEDPROC)(GLenum , GLsizei , GLenum , const GLvoid *, GLsizei ); 446 typedef void (CODEGEN_FUNCPTR *PFNTEXBUFFERPROC)(GLenum , GLenum , GLuint ); 447 typedef void (CODEGEN_FUNCPTR *PFNPRIMITIVERESTARTINDEXPROC)(GLuint ); 448 449 // Legacy 450 typedef void (CODEGEN_FUNCPTR *PFNENABLECLIENTSTATEPROC)(GLenum ); 451 typedef void (CODEGEN_FUNCPTR *PFNDISABLECLIENTSTATEPROC)(GLenum ); 452 typedef void (CODEGEN_FUNCPTR *PFNVERTEXPOINTERPROC)(GLint , GLenum , GLsizei , const GLvoid *); 453 typedef void (CODEGEN_FUNCPTR *PFNNORMALPOINTERPROC)(GLenum , GLsizei , const GLvoid *); 454 typedef void (CODEGEN_FUNCPTR *PFNCOLORPOINTERPROC)(GLint , GLenum , GLsizei , const GLvoid *); 455 typedef void (CODEGEN_FUNCPTR *PFNTEXCOORDPOINTERPROC)(GLint , GLenum , GLsizei , const GLvoid *); 456 typedef void (CODEGEN_FUNCPTR *PFNTEXENVIPROC)(GLenum , GLenum , GLint ); 457 typedef void (CODEGEN_FUNCPTR *PFNMATRIXMODEPROC)(GLenum ); 458 typedef void (CODEGEN_FUNCPTR *PFNLOADIDENTITYPROC)(void); 459 typedef void (CODEGEN_FUNCPTR *PFNORTHOPROC)(GLdouble , GLdouble , GLdouble , GLdouble , GLdouble , GLdouble ); 460 typedef void (CODEGEN_FUNCPTR *PFNCOLOR3DPROC)(GLdouble , GLdouble , GLdouble ); 461 462 ////////////////////////////////////////////// 463 // Function pointers 464 465 // Extension: 1.1 466 PFNCULLFACEPROC CullFace; 467 PFNFRONTFACEPROC FrontFace; 468 PFNHINTPROC Hint; 469 PFNLINEWIDTHPROC LineWidth; 470 PFNPOINTSIZEPROC PointSize; 471 PFNPOLYGONMODEPROC PolygonMode; 472 PFNSCISSORPROC Scissor; 473 PFNTEXPARAMETERFPROC TexParameterf; 474 PFNTEXPARAMETERFVPROC TexParameterfv; 475 PFNTEXPARAMETERIPROC TexParameteri; 476 PFNTEXPARAMETERIVPROC TexParameteriv; 477 PFNTEXIMAGE1DPROC TexImage1D; 478 PFNTEXIMAGE2DPROC TexImage2D; 479 PFNDRAWBUFFERPROC DrawBuffer; 480 PFNCLEARPROC Clear; 481 PFNCLEARCOLORPROC ClearColor; 482 PFNCLEARSTENCILPROC ClearStencil; 483 PFNCLEARDEPTHPROC ClearDepth; 484 PFNSTENCILMASKPROC StencilMask; 485 PFNCOLORMASKPROC ColorMask; 486 PFNDEPTHMASKPROC DepthMask; 487 PFNDISABLEPROC Disable; 488 PFNENABLEPROC Enable; 489 PFNFINISHPROC Finish; 490 PFNFLUSHPROC Flush; 491 PFNBLENDFUNCPROC BlendFunc; 492 PFNLOGICOPPROC LogicOp; 493 PFNSTENCILFUNCPROC StencilFunc; 494 PFNSTENCILOPPROC StencilOp; 495 PFNDEPTHFUNCPROC DepthFunc; 496 PFNPIXELSTOREFPROC PixelStoref; 497 PFNPIXELSTOREIPROC PixelStorei; 498 PFNREADBUFFERPROC ReadBuffer; 499 PFNREADPIXELSPROC ReadPixels; 500 PFNGETBOOLEANVPROC GetBooleanv; 501 PFNGETDOUBLEVPROC GetDoublev; 502 PFNGETERRORPROC GetError; 503 PFNGETFLOATVPROC GetFloatv; 504 PFNGETINTEGERVPROC GetIntegerv; 505 PFNGETSTRINGPROC GetString; 506 PFNGETTEXIMAGEPROC GetTexImage; 507 PFNGETTEXPARAMETERFVPROC GetTexParameterfv; 508 PFNGETTEXPARAMETERIVPROC GetTexParameteriv; 509 PFNGETTEXLEVELPARAMETERFVPROC GetTexLevelParameterfv; 510 PFNGETTEXLEVELPARAMETERIVPROC GetTexLevelParameteriv; 511 PFNISENABLEDPROC IsEnabled; 512 PFNDEPTHRANGEPROC DepthRange; 513 PFNVIEWPORTPROC Viewport; 514 PFNDRAWARRAYSPROC DrawArrays; 515 PFNDRAWELEMENTSPROC DrawElements; 516 PFNGETPOINTERVPROC GetPointerv; 517 PFNPOLYGONOFFSETPROC PolygonOffset; 518 PFNCOPYTEXIMAGE1DPROC CopyTexImage1D; 519 PFNCOPYTEXIMAGE2DPROC CopyTexImage2D; 520 PFNCOPYTEXSUBIMAGE1DPROC CopyTexSubImage1D; 521 PFNCOPYTEXSUBIMAGE2DPROC CopyTexSubImage2D; 522 PFNTEXSUBIMAGE1DPROC TexSubImage1D; 523 PFNTEXSUBIMAGE2DPROC TexSubImage2D; 524 PFNBINDTEXTUREPROC BindTexture; 525 PFNDELETETEXTURESPROC DeleteTextures; 526 PFNGENTEXTURESPROC GenTextures; 527 PFNISTEXTUREPROC IsTexture; 528 PFNINDEXUBPROC Indexub; 529 PFNINDEXUBVPROC Indexubv; 530 531 // Extension: 1.2 532 PFNBLENDCOLORPROC BlendColor; 533 PFNBLENDEQUATIONPROC BlendEquation; 534 PFNDRAWRANGEELEMENTSPROC DrawRangeElements; 535 PFNTEXSUBIMAGE3DPROC TexSubImage3D; 536 PFNCOPYTEXSUBIMAGE3DPROC CopyTexSubImage3D; 537 538 // Extension: 1.3 539 PFNACTIVETEXTUREPROC ActiveTexture; 540 PFNSAMPLECOVERAGEPROC SampleCoverage; 541 PFNCOMPRESSEDTEXIMAGE3DPROC CompressedTexImage3D; 542 PFNCOMPRESSEDTEXIMAGE2DPROC CompressedTexImage2D; 543 PFNCOMPRESSEDTEXIMAGE1DPROC CompressedTexImage1D; 544 PFNCOMPRESSEDTEXSUBIMAGE3DPROC CompressedTexSubImage3D; 545 PFNCOMPRESSEDTEXSUBIMAGE2DPROC CompressedTexSubImage2D; 546 PFNCOMPRESSEDTEXSUBIMAGE1DPROC CompressedTexSubImage1D; 547 PFNGETCOMPRESSEDTEXIMAGEPROC GetCompressedTexImage; 548 549 // Extension: 1.4 550 PFNBLENDFUNCSEPARATEPROC BlendFuncSeparate; 551 PFNMULTIDRAWARRAYSPROC MultiDrawArrays; 552 PFNMULTIDRAWELEMENTSPROC MultiDrawElements; 553 PFNPOINTPARAMETERFPROC PointParameterf; 554 PFNPOINTPARAMETERFVPROC PointParameterfv; 555 PFNPOINTPARAMETERIPROC PointParameteri; 556 PFNPOINTPARAMETERIVPROC PointParameteriv; 557 558 // Extension: 1.5 559 PFNGENQUERIESPROC GenQueries; 560 PFNDELETEQUERIESPROC DeleteQueries; 561 PFNISQUERYPROC IsQuery; 562 PFNBEGINQUERYPROC BeginQuery; 563 PFNENDQUERYPROC EndQuery; 564 PFNGETQUERYIVPROC GetQueryiv; 565 PFNGETQUERYOBJECTIVPROC GetQueryObjectiv; 566 PFNGETQUERYOBJECTUIVPROC GetQueryObjectuiv; 567 PFNBINDBUFFERPROC BindBuffer; 568 PFNDELETEBUFFERSPROC DeleteBuffers; 569 PFNGENBUFFERSPROC GenBuffers; 570 PFNISBUFFERPROC IsBuffer; 571 PFNBUFFERDATAPROC BufferData; 572 PFNBUFFERSUBDATAPROC BufferSubData; 573 PFNGETBUFFERSUBDATAPROC GetBufferSubData; 574 PFNMAPBUFFERPROC MapBuffer; 575 PFNUNMAPBUFFERPROC UnmapBuffer; 576 PFNGETBUFFERPARAMETERIVPROC GetBufferParameteriv; 577 PFNGETBUFFERPOINTERVPROC GetBufferPointerv; 578 579 // Extension: 2.0 580 PFNBLENDEQUATIONSEPARATEPROC BlendEquationSeparate; 581 PFNDRAWBUFFERSPROC DrawBuffers; 582 PFNSTENCILOPSEPARATEPROC StencilOpSeparate; 583 PFNSTENCILFUNCSEPARATEPROC StencilFuncSeparate; 584 PFNSTENCILMASKSEPARATEPROC StencilMaskSeparate; 585 PFNATTACHSHADERPROC AttachShader; 586 PFNBINDATTRIBLOCATIONPROC BindAttribLocation; 587 PFNCOMPILESHADERPROC CompileShader; 588 PFNCREATEPROGRAMPROC CreateProgram; 589 PFNCREATESHADERPROC CreateShader; 590 PFNDELETEPROGRAMPROC DeleteProgram; 591 PFNDELETESHADERPROC DeleteShader; 592 PFNDETACHSHADERPROC DetachShader; 593 PFNDISABLEVERTEXATTRIBARRAYPROC DisableVertexAttribArray; 594 PFNENABLEVERTEXATTRIBARRAYPROC EnableVertexAttribArray; 595 PFNGETACTIVEATTRIBPROC GetActiveAttrib; 596 PFNGETACTIVEUNIFORMPROC GetActiveUniform; 597 PFNGETATTACHEDSHADERSPROC GetAttachedShaders; 598 PFNGETATTRIBLOCATIONPROC GetAttribLocation; 599 PFNGETPROGRAMIVPROC GetProgramiv; 600 PFNGETPROGRAMINFOLOGPROC GetProgramInfoLog; 601 PFNGETSHADERIVPROC GetShaderiv; 602 PFNGETSHADERINFOLOGPROC GetShaderInfoLog; 603 PFNGETSHADERSOURCEPROC GetShaderSource; 604 PFNGETUNIFORMLOCATIONPROC GetUniformLocation; 605 PFNGETUNIFORMFVPROC GetUniformfv; 606 PFNGETUNIFORMIVPROC GetUniformiv; 607 PFNGETVERTEXATTRIBDVPROC GetVertexAttribdv; 608 PFNGETVERTEXATTRIBFVPROC GetVertexAttribfv; 609 PFNGETVERTEXATTRIBIVPROC GetVertexAttribiv; 610 PFNGETVERTEXATTRIBPOINTERVPROC GetVertexAttribPointerv; 611 PFNISPROGRAMPROC IsProgram; 612 PFNISSHADERPROC IsShader; 613 PFNLINKPROGRAMPROC LinkProgram; 614 PFNSHADERSOURCEPROC ShaderSource; 615 PFNUSEPROGRAMPROC UseProgram; 616 PFNUNIFORM1FPROC Uniform1f; 617 PFNUNIFORM2FPROC Uniform2f; 618 PFNUNIFORM3FPROC Uniform3f; 619 PFNUNIFORM4FPROC Uniform4f; 620 PFNUNIFORM1IPROC Uniform1i; 621 PFNUNIFORM2IPROC Uniform2i; 622 PFNUNIFORM3IPROC Uniform3i; 623 PFNUNIFORM4IPROC Uniform4i; 624 PFNUNIFORM1FVPROC Uniform1fv; 625 PFNUNIFORM2FVPROC Uniform2fv; 626 PFNUNIFORM3FVPROC Uniform3fv; 627 PFNUNIFORM4FVPROC Uniform4fv; 628 PFNUNIFORM1IVPROC Uniform1iv; 629 PFNUNIFORM2IVPROC Uniform2iv; 630 PFNUNIFORM3IVPROC Uniform3iv; 631 PFNUNIFORM4IVPROC Uniform4iv; 632 PFNUNIFORMMATRIX2FVPROC UniformMatrix2fv; 633 PFNUNIFORMMATRIX3FVPROC UniformMatrix3fv; 634 PFNUNIFORMMATRIX4FVPROC UniformMatrix4fv; 635 PFNVALIDATEPROGRAMPROC ValidateProgram; 636 PFNVERTEXATTRIBPOINTERPROC VertexAttribPointer; 637 638 // Extension: 2.1 639 PFNUNIFORMMATRIX2X3FVPROC UniformMatrix2x3fv; 640 PFNUNIFORMMATRIX3X2FVPROC UniformMatrix3x2fv; 641 PFNUNIFORMMATRIX2X4FVPROC UniformMatrix2x4fv; 642 PFNUNIFORMMATRIX4X2FVPROC UniformMatrix4x2fv; 643 PFNUNIFORMMATRIX3X4FVPROC UniformMatrix3x4fv; 644 PFNUNIFORMMATRIX4X3FVPROC UniformMatrix4x3fv; 645 646 // Extension: ARB_vertex_array_object 647 PFNBINDVERTEXARRAYPROC BindVertexArray; 648 PFNDELETEVERTEXARRAYSPROC DeleteVertexArrays; 649 PFNGENVERTEXARRAYSPROC GenVertexArrays; 650 PFNISVERTEXARRAYPROC IsVertexArray; 651 652 // Extension: ARB_map_buffer_range 653 PFNMAPBUFFERRANGEPROC MapBufferRange; 654 PFNFLUSHMAPPEDBUFFERRANGEPROC FlushMappedBufferRange; 655 656 // Extension: ARB_framebuffer_object 657 PFNISRENDERBUFFERPROC IsRenderbuffer; 658 PFNBINDRENDERBUFFERPROC BindRenderbuffer; 659 PFNDELETERENDERBUFFERSPROC DeleteRenderbuffers; 660 PFNGENRENDERBUFFERSPROC GenRenderbuffers; 661 PFNRENDERBUFFERSTORAGEPROC RenderbufferStorage; 662 PFNGETRENDERBUFFERPARAMETERIVPROC GetRenderbufferParameteriv; 663 PFNISFRAMEBUFFERPROC IsFramebuffer; 664 PFNBINDFRAMEBUFFERPROC BindFramebuffer; 665 PFNDELETEFRAMEBUFFERSPROC DeleteFramebuffers; 666 PFNGENFRAMEBUFFERSPROC GenFramebuffers; 667 PFNCHECKFRAMEBUFFERSTATUSPROC CheckFramebufferStatus; 668 PFNFRAMEBUFFERTEXTURE1DPROC FramebufferTexture1D; 669 PFNFRAMEBUFFERTEXTURE2DPROC FramebufferTexture2D; 670 PFNFRAMEBUFFERTEXTURE3DPROC FramebufferTexture3D; 671 PFNFRAMEBUFFERRENDERBUFFERPROC FramebufferRenderbuffer; 672 PFNGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC GetFramebufferAttachmentParameteriv; 673 PFNGENERATEMIPMAPPROC GenerateMipmap; 674 PFNBLITFRAMEBUFFERPROC BlitFramebuffer; 675 PFNRENDERBUFFERSTORAGEMULTISAMPLEPROC RenderbufferStorageMultisample; 676 PFNFRAMEBUFFERTEXTURELAYERPROC FramebufferTextureLayer; 677 678 // Extension: 3.0 679 PFNCOLORMASKIPROC ColorMaski; 680 PFNGETBOOLEANI_VPROC GetBooleani_v; 681 PFNGETINTEGERI_VPROC GetIntegeri_v; 682 PFNENABLEIPROC Enablei; 683 PFNDISABLEIPROC Disablei; 684 PFNISENABLEDIPROC IsEnabledi; 685 PFNBEGINTRANSFORMFEEDBACKPROC BeginTransformFeedback; 686 PFNENDTRANSFORMFEEDBACKPROC EndTransformFeedback; 687 PFNBINDBUFFERRANGEPROC BindBufferRange; 688 PFNBINDBUFFERBASEPROC BindBufferBase; 689 PFNTRANSFORMFEEDBACKVARYINGSPROC TransformFeedbackVaryings; 690 PFNGETTRANSFORMFEEDBACKVARYINGPROC GetTransformFeedbackVarying; 691 PFNCLAMPCOLORPROC ClampColor; 692 PFNBEGINCONDITIONALRENDERPROC BeginConditionalRender; 693 PFNENDCONDITIONALRENDERPROC EndConditionalRender; 694 PFNVERTEXATTRIBIPOINTERPROC VertexAttribIPointer; 695 PFNGETVERTEXATTRIBIIVPROC GetVertexAttribIiv; 696 PFNGETVERTEXATTRIBIUIVPROC GetVertexAttribIuiv; 697 PFNVERTEXATTRIBI1IPROC VertexAttribI1i; 698 PFNVERTEXATTRIBI2IPROC VertexAttribI2i; 699 PFNVERTEXATTRIBI3IPROC VertexAttribI3i; 700 PFNVERTEXATTRIBI4IPROC VertexAttribI4i; 701 PFNVERTEXATTRIBI1UIPROC VertexAttribI1ui; 702 PFNVERTEXATTRIBI2UIPROC VertexAttribI2ui; 703 PFNVERTEXATTRIBI3UIPROC VertexAttribI3ui; 704 PFNVERTEXATTRIBI4UIPROC VertexAttribI4ui; 705 PFNVERTEXATTRIBI1IVPROC VertexAttribI1iv; 706 PFNVERTEXATTRIBI2IVPROC VertexAttribI2iv; 707 PFNVERTEXATTRIBI3IVPROC VertexAttribI3iv; 708 PFNVERTEXATTRIBI4IVPROC VertexAttribI4iv; 709 PFNVERTEXATTRIBI1UIVPROC VertexAttribI1uiv; 710 PFNVERTEXATTRIBI2UIVPROC VertexAttribI2uiv; 711 PFNVERTEXATTRIBI3UIVPROC VertexAttribI3uiv; 712 PFNVERTEXATTRIBI4UIVPROC VertexAttribI4uiv; 713 PFNVERTEXATTRIBI4BVPROC VertexAttribI4bv; 714 PFNVERTEXATTRIBI4SVPROC VertexAttribI4sv; 715 PFNVERTEXATTRIBI4UBVPROC VertexAttribI4ubv; 716 PFNVERTEXATTRIBI4USVPROC VertexAttribI4usv; 717 PFNGETUNIFORMUIVPROC GetUniformuiv; 718 PFNBINDFRAGDATALOCATIONPROC BindFragDataLocation; 719 PFNGETFRAGDATALOCATIONPROC GetFragDataLocation; 720 PFNUNIFORM1UIPROC Uniform1ui; 721 PFNUNIFORM2UIPROC Uniform2ui; 722 PFNUNIFORM3UIPROC Uniform3ui; 723 PFNUNIFORM4UIPROC Uniform4ui; 724 PFNUNIFORM1UIVPROC Uniform1uiv; 725 PFNUNIFORM2UIVPROC Uniform2uiv; 726 PFNUNIFORM3UIVPROC Uniform3uiv; 727 PFNUNIFORM4UIVPROC Uniform4uiv; 728 PFNTEXPARAMETERIIVPROC TexParameterIiv; 729 PFNTEXPARAMETERIUIVPROC TexParameterIuiv; 730 PFNGETTEXPARAMETERIIVPROC GetTexParameterIiv; 731 PFNGETTEXPARAMETERIUIVPROC GetTexParameterIuiv; 732 PFNCLEARBUFFERIVPROC ClearBufferiv; 733 PFNCLEARBUFFERUIVPROC ClearBufferuiv; 734 PFNCLEARBUFFERFVPROC ClearBufferfv; 735 PFNCLEARBUFFERFIPROC ClearBufferfi; 736 PFNGETSTRINGIPROC GetStringi; 737 738 // Extension: ARB_uniform_buffer_object 739 PFNGETUNIFORMINDICESPROC GetUniformIndices; 740 PFNGETACTIVEUNIFORMSIVPROC GetActiveUniformsiv; 741 PFNGETACTIVEUNIFORMNAMEPROC GetActiveUniformName; 742 PFNGETUNIFORMBLOCKINDEXPROC GetUniformBlockIndex; 743 PFNGETACTIVEUNIFORMBLOCKIVPROC GetActiveUniformBlockiv; 744 PFNGETACTIVEUNIFORMBLOCKNAMEPROC GetActiveUniformBlockName; 745 PFNUNIFORMBLOCKBINDINGPROC UniformBlockBinding; 746 747 // Extension: ARB_copy_buffer 748 PFNCOPYBUFFERSUBDATAPROC CopyBufferSubData; 749 750 // Extension: 3.1 751 PFNDRAWARRAYSINSTANCEDPROC DrawArraysInstanced; 752 PFNDRAWELEMENTSINSTANCEDPROC DrawElementsInstanced; 753 PFNTEXBUFFERPROC TexBuffer; 754 PFNPRIMITIVERESTARTINDEXPROC PrimitiveRestartIndex; 755 756 // Legacy 757 PFNENABLECLIENTSTATEPROC EnableClientState; 758 PFNDISABLECLIENTSTATEPROC DisableClientState; 759 PFNVERTEXPOINTERPROC VertexPointer; 760 PFNNORMALPOINTERPROC NormalPointer; 761 PFNCOLORPOINTERPROC ColorPointer; 762 PFNTEXCOORDPOINTERPROC TexCoordPointer; 763 764 PFNTEXENVIPROC TexEnvi; 765 766 PFNMATRIXMODEPROC MatrixMode; 767 PFNLOADIDENTITYPROC LoadIdentity; 768 PFNORTHOPROC Ortho; 769 770 PFNCOLOR3DPROC Color3d; 771 772 ////////////////////////////////////////////// 773 // Switch functions 774 775 // Extension: 1.1 776 Switch_CullFace(GLenum mode)777 static void CODEGEN_FUNCPTR Switch_CullFace(GLenum mode) 778 { 779 CullFace = (PFNCULLFACEPROC)IntGetProcAddress("glCullFace"); 780 CullFace(mode); 781 } 782 Switch_FrontFace(GLenum mode)783 static void CODEGEN_FUNCPTR Switch_FrontFace(GLenum mode) 784 { 785 FrontFace = (PFNFRONTFACEPROC)IntGetProcAddress("glFrontFace"); 786 FrontFace(mode); 787 } 788 Switch_Hint(GLenum target,GLenum mode)789 static void CODEGEN_FUNCPTR Switch_Hint(GLenum target, GLenum mode) 790 { 791 Hint = (PFNHINTPROC)IntGetProcAddress("glHint"); 792 Hint(target, mode); 793 } 794 Switch_LineWidth(GLfloat width)795 static void CODEGEN_FUNCPTR Switch_LineWidth(GLfloat width) 796 { 797 LineWidth = (PFNLINEWIDTHPROC)IntGetProcAddress("glLineWidth"); 798 LineWidth(width); 799 } 800 Switch_PointSize(GLfloat size)801 static void CODEGEN_FUNCPTR Switch_PointSize(GLfloat size) 802 { 803 PointSize = (PFNPOINTSIZEPROC)IntGetProcAddress("glPointSize"); 804 PointSize(size); 805 } 806 Switch_PolygonMode(GLenum face,GLenum mode)807 static void CODEGEN_FUNCPTR Switch_PolygonMode(GLenum face, GLenum mode) 808 { 809 PolygonMode = (PFNPOLYGONMODEPROC)IntGetProcAddress("glPolygonMode"); 810 PolygonMode(face, mode); 811 } 812 Switch_Scissor(GLint x,GLint y,GLsizei width,GLsizei height)813 static void CODEGEN_FUNCPTR Switch_Scissor(GLint x, GLint y, GLsizei width, GLsizei height) 814 { 815 Scissor = (PFNSCISSORPROC)IntGetProcAddress("glScissor"); 816 Scissor(x, y, width, height); 817 } 818 Switch_TexParameterf(GLenum target,GLenum pname,GLfloat param)819 static void CODEGEN_FUNCPTR Switch_TexParameterf(GLenum target, GLenum pname, GLfloat param) 820 { 821 TexParameterf = (PFNTEXPARAMETERFPROC)IntGetProcAddress("glTexParameterf"); 822 TexParameterf(target, pname, param); 823 } 824 Switch_TexParameterfv(GLenum target,GLenum pname,const GLfloat * params)825 static void CODEGEN_FUNCPTR Switch_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) 826 { 827 TexParameterfv = (PFNTEXPARAMETERFVPROC)IntGetProcAddress("glTexParameterfv"); 828 TexParameterfv(target, pname, params); 829 } 830 Switch_TexParameteri(GLenum target,GLenum pname,GLint param)831 static void CODEGEN_FUNCPTR Switch_TexParameteri(GLenum target, GLenum pname, GLint param) 832 { 833 TexParameteri = (PFNTEXPARAMETERIPROC)IntGetProcAddress("glTexParameteri"); 834 TexParameteri(target, pname, param); 835 } 836 Switch_TexParameteriv(GLenum target,GLenum pname,const GLint * params)837 static void CODEGEN_FUNCPTR Switch_TexParameteriv(GLenum target, GLenum pname, const GLint *params) 838 { 839 TexParameteriv = (PFNTEXPARAMETERIVPROC)IntGetProcAddress("glTexParameteriv"); 840 TexParameteriv(target, pname, params); 841 } 842 Switch_TexImage1D(GLenum target,GLint level,GLint internalformat,GLsizei width,GLint border,GLenum format,GLenum type,const GLvoid * pixels)843 static void CODEGEN_FUNCPTR Switch_TexImage1D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels) 844 { 845 TexImage1D = (PFNTEXIMAGE1DPROC)IntGetProcAddress("glTexImage1D"); 846 TexImage1D(target, level, internalformat, width, border, format, type, pixels); 847 } 848 Switch_TexImage2D(GLenum target,GLint level,GLint internalformat,GLsizei width,GLsizei height,GLint border,GLenum format,GLenum type,const GLvoid * pixels)849 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) 850 { 851 TexImage2D = (PFNTEXIMAGE2DPROC)IntGetProcAddress("glTexImage2D"); 852 TexImage2D(target, level, internalformat, width, height, border, format, type, pixels); 853 } 854 Switch_DrawBuffer(GLenum mode)855 static void CODEGEN_FUNCPTR Switch_DrawBuffer(GLenum mode) 856 { 857 DrawBuffer = (PFNDRAWBUFFERPROC)IntGetProcAddress("glDrawBuffer"); 858 DrawBuffer(mode); 859 } 860 Switch_Clear(GLbitfield mask)861 static void CODEGEN_FUNCPTR Switch_Clear(GLbitfield mask) 862 { 863 Clear = (PFNCLEARPROC)IntGetProcAddress("glClear"); 864 Clear(mask); 865 } 866 Switch_ClearColor(GLfloat red,GLfloat green,GLfloat blue,GLfloat alpha)867 static void CODEGEN_FUNCPTR Switch_ClearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) 868 { 869 ClearColor = (PFNCLEARCOLORPROC)IntGetProcAddress("glClearColor"); 870 ClearColor(red, green, blue, alpha); 871 } 872 Switch_ClearStencil(GLint s)873 static void CODEGEN_FUNCPTR Switch_ClearStencil(GLint s) 874 { 875 ClearStencil = (PFNCLEARSTENCILPROC)IntGetProcAddress("glClearStencil"); 876 ClearStencil(s); 877 } 878 Switch_ClearDepth(GLdouble depth)879 static void CODEGEN_FUNCPTR Switch_ClearDepth(GLdouble depth) 880 { 881 ClearDepth = (PFNCLEARDEPTHPROC)IntGetProcAddress("glClearDepth"); 882 ClearDepth(depth); 883 } 884 Switch_StencilMask(GLuint mask)885 static void CODEGEN_FUNCPTR Switch_StencilMask(GLuint mask) 886 { 887 StencilMask = (PFNSTENCILMASKPROC)IntGetProcAddress("glStencilMask"); 888 StencilMask(mask); 889 } 890 Switch_ColorMask(GLboolean red,GLboolean green,GLboolean blue,GLboolean alpha)891 static void CODEGEN_FUNCPTR Switch_ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) 892 { 893 ColorMask = (PFNCOLORMASKPROC)IntGetProcAddress("glColorMask"); 894 ColorMask(red, green, blue, alpha); 895 } 896 Switch_DepthMask(GLboolean flag)897 static void CODEGEN_FUNCPTR Switch_DepthMask(GLboolean flag) 898 { 899 DepthMask = (PFNDEPTHMASKPROC)IntGetProcAddress("glDepthMask"); 900 DepthMask(flag); 901 } 902 Switch_Disable(GLenum cap)903 static void CODEGEN_FUNCPTR Switch_Disable(GLenum cap) 904 { 905 Disable = (PFNDISABLEPROC)IntGetProcAddress("glDisable"); 906 Disable(cap); 907 } 908 Switch_Enable(GLenum cap)909 static void CODEGEN_FUNCPTR Switch_Enable(GLenum cap) 910 { 911 Enable = (PFNENABLEPROC)IntGetProcAddress("glEnable"); 912 Enable(cap); 913 } 914 Switch_Finish()915 static void CODEGEN_FUNCPTR Switch_Finish() 916 { 917 Finish = (PFNFINISHPROC)IntGetProcAddress("glFinish"); 918 Finish(); 919 } 920 Switch_Flush()921 static void CODEGEN_FUNCPTR Switch_Flush() 922 { 923 Flush = (PFNFLUSHPROC)IntGetProcAddress("glFlush"); 924 Flush(); 925 } 926 Switch_BlendFunc(GLenum sfactor,GLenum dfactor)927 static void CODEGEN_FUNCPTR Switch_BlendFunc(GLenum sfactor, GLenum dfactor) 928 { 929 BlendFunc = (PFNBLENDFUNCPROC)IntGetProcAddress("glBlendFunc"); 930 BlendFunc(sfactor, dfactor); 931 } 932 Switch_LogicOp(GLenum opcode)933 static void CODEGEN_FUNCPTR Switch_LogicOp(GLenum opcode) 934 { 935 LogicOp = (PFNLOGICOPPROC)IntGetProcAddress("glLogicOp"); 936 LogicOp(opcode); 937 } 938 Switch_StencilFunc(GLenum func,GLint ref,GLuint mask)939 static void CODEGEN_FUNCPTR Switch_StencilFunc(GLenum func, GLint ref, GLuint mask) 940 { 941 StencilFunc = (PFNSTENCILFUNCPROC)IntGetProcAddress("glStencilFunc"); 942 StencilFunc(func, ref, mask); 943 } 944 Switch_StencilOp(GLenum fail,GLenum zfail,GLenum zpass)945 static void CODEGEN_FUNCPTR Switch_StencilOp(GLenum fail, GLenum zfail, GLenum zpass) 946 { 947 StencilOp = (PFNSTENCILOPPROC)IntGetProcAddress("glStencilOp"); 948 StencilOp(fail, zfail, zpass); 949 } 950 Switch_DepthFunc(GLenum func)951 static void CODEGEN_FUNCPTR Switch_DepthFunc(GLenum func) 952 { 953 DepthFunc = (PFNDEPTHFUNCPROC)IntGetProcAddress("glDepthFunc"); 954 DepthFunc(func); 955 } 956 Switch_PixelStoref(GLenum pname,GLfloat param)957 static void CODEGEN_FUNCPTR Switch_PixelStoref(GLenum pname, GLfloat param) 958 { 959 PixelStoref = (PFNPIXELSTOREFPROC)IntGetProcAddress("glPixelStoref"); 960 PixelStoref(pname, param); 961 } 962 Switch_PixelStorei(GLenum pname,GLint param)963 static void CODEGEN_FUNCPTR Switch_PixelStorei(GLenum pname, GLint param) 964 { 965 PixelStorei = (PFNPIXELSTOREIPROC)IntGetProcAddress("glPixelStorei"); 966 PixelStorei(pname, param); 967 } 968 Switch_ReadBuffer(GLenum mode)969 static void CODEGEN_FUNCPTR Switch_ReadBuffer(GLenum mode) 970 { 971 ReadBuffer = (PFNREADBUFFERPROC)IntGetProcAddress("glReadBuffer"); 972 ReadBuffer(mode); 973 } 974 Switch_ReadPixels(GLint x,GLint y,GLsizei width,GLsizei height,GLenum format,GLenum type,GLvoid * pixels)975 static void CODEGEN_FUNCPTR Switch_ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels) 976 { 977 ReadPixels = (PFNREADPIXELSPROC)IntGetProcAddress("glReadPixels"); 978 ReadPixels(x, y, width, height, format, type, pixels); 979 } 980 Switch_GetBooleanv(GLenum pname,GLboolean * params)981 static void CODEGEN_FUNCPTR Switch_GetBooleanv(GLenum pname, GLboolean *params) 982 { 983 GetBooleanv = (PFNGETBOOLEANVPROC)IntGetProcAddress("glGetBooleanv"); 984 GetBooleanv(pname, params); 985 } 986 Switch_GetDoublev(GLenum pname,GLdouble * params)987 static void CODEGEN_FUNCPTR Switch_GetDoublev(GLenum pname, GLdouble *params) 988 { 989 GetDoublev = (PFNGETDOUBLEVPROC)IntGetProcAddress("glGetDoublev"); 990 GetDoublev(pname, params); 991 } 992 Switch_GetError()993 static GLenum CODEGEN_FUNCPTR Switch_GetError() 994 { 995 GetError = (PFNGETERRORPROC)IntGetProcAddress("glGetError"); 996 return GetError(); 997 } 998 Switch_GetFloatv(GLenum pname,GLfloat * params)999 static void CODEGEN_FUNCPTR Switch_GetFloatv(GLenum pname, GLfloat *params) 1000 { 1001 GetFloatv = (PFNGETFLOATVPROC)IntGetProcAddress("glGetFloatv"); 1002 GetFloatv(pname, params); 1003 } 1004 Switch_GetIntegerv(GLenum pname,GLint * params)1005 static void CODEGEN_FUNCPTR Switch_GetIntegerv(GLenum pname, GLint *params) 1006 { 1007 GetIntegerv = (PFNGETINTEGERVPROC)IntGetProcAddress("glGetIntegerv"); 1008 GetIntegerv(pname, params); 1009 } 1010 Switch_GetString(GLenum name)1011 static const GLubyte * CODEGEN_FUNCPTR Switch_GetString(GLenum name) 1012 { 1013 GetString = (PFNGETSTRINGPROC)IntGetProcAddress("glGetString"); 1014 return GetString(name); 1015 } 1016 Switch_GetTexImage(GLenum target,GLint level,GLenum format,GLenum type,GLvoid * pixels)1017 static void CODEGEN_FUNCPTR Switch_GetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels) 1018 { 1019 GetTexImage = (PFNGETTEXIMAGEPROC)IntGetProcAddress("glGetTexImage"); 1020 GetTexImage(target, level, format, type, pixels); 1021 } 1022 Switch_GetTexParameterfv(GLenum target,GLenum pname,GLfloat * params)1023 static void CODEGEN_FUNCPTR Switch_GetTexParameterfv(GLenum target, GLenum pname, GLfloat *params) 1024 { 1025 GetTexParameterfv = (PFNGETTEXPARAMETERFVPROC)IntGetProcAddress("glGetTexParameterfv"); 1026 GetTexParameterfv(target, pname, params); 1027 } 1028 Switch_GetTexParameteriv(GLenum target,GLenum pname,GLint * params)1029 static void CODEGEN_FUNCPTR Switch_GetTexParameteriv(GLenum target, GLenum pname, GLint *params) 1030 { 1031 GetTexParameteriv = (PFNGETTEXPARAMETERIVPROC)IntGetProcAddress("glGetTexParameteriv"); 1032 GetTexParameteriv(target, pname, params); 1033 } 1034 Switch_GetTexLevelParameterfv(GLenum target,GLint level,GLenum pname,GLfloat * params)1035 static void CODEGEN_FUNCPTR Switch_GetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params) 1036 { 1037 GetTexLevelParameterfv = (PFNGETTEXLEVELPARAMETERFVPROC)IntGetProcAddress("glGetTexLevelParameterfv"); 1038 GetTexLevelParameterfv(target, level, pname, params); 1039 } 1040 Switch_GetTexLevelParameteriv(GLenum target,GLint level,GLenum pname,GLint * params)1041 static void CODEGEN_FUNCPTR Switch_GetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params) 1042 { 1043 GetTexLevelParameteriv = (PFNGETTEXLEVELPARAMETERIVPROC)IntGetProcAddress("glGetTexLevelParameteriv"); 1044 GetTexLevelParameteriv(target, level, pname, params); 1045 } 1046 Switch_IsEnabled(GLenum cap)1047 static GLboolean CODEGEN_FUNCPTR Switch_IsEnabled(GLenum cap) 1048 { 1049 IsEnabled = (PFNISENABLEDPROC)IntGetProcAddress("glIsEnabled"); 1050 return IsEnabled(cap); 1051 } 1052 Switch_DepthRange(GLdouble ren_near,GLdouble ren_far)1053 static void CODEGEN_FUNCPTR Switch_DepthRange(GLdouble ren_near, GLdouble ren_far) 1054 { 1055 DepthRange = (PFNDEPTHRANGEPROC)IntGetProcAddress("glDepthRange"); 1056 DepthRange(ren_near, ren_far); 1057 } 1058 Switch_Viewport(GLint x,GLint y,GLsizei width,GLsizei height)1059 static void CODEGEN_FUNCPTR Switch_Viewport(GLint x, GLint y, GLsizei width, GLsizei height) 1060 { 1061 Viewport = (PFNVIEWPORTPROC)IntGetProcAddress("glViewport"); 1062 Viewport(x, y, width, height); 1063 } 1064 Switch_DrawArrays(GLenum mode,GLint first,GLsizei count)1065 static void CODEGEN_FUNCPTR Switch_DrawArrays(GLenum mode, GLint first, GLsizei count) 1066 { 1067 DrawArrays = (PFNDRAWARRAYSPROC)IntGetProcAddress("glDrawArrays"); 1068 DrawArrays(mode, first, count); 1069 } 1070 Switch_DrawElements(GLenum mode,GLsizei count,GLenum type,const GLvoid * indices)1071 static void CODEGEN_FUNCPTR Switch_DrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices) 1072 { 1073 DrawElements = (PFNDRAWELEMENTSPROC)IntGetProcAddress("glDrawElements"); 1074 DrawElements(mode, count, type, indices); 1075 } 1076 Switch_GetPointerv(GLenum pname,GLvoid ** params)1077 static void CODEGEN_FUNCPTR Switch_GetPointerv(GLenum pname, GLvoid* *params) 1078 { 1079 GetPointerv = (PFNGETPOINTERVPROC)IntGetProcAddress("glGetPointerv"); 1080 GetPointerv(pname, params); 1081 } 1082 Switch_PolygonOffset(GLfloat factor,GLfloat units)1083 static void CODEGEN_FUNCPTR Switch_PolygonOffset(GLfloat factor, GLfloat units) 1084 { 1085 PolygonOffset = (PFNPOLYGONOFFSETPROC)IntGetProcAddress("glPolygonOffset"); 1086 PolygonOffset(factor, units); 1087 } 1088 Switch_CopyTexImage1D(GLenum target,GLint level,GLenum internalformat,GLint x,GLint y,GLsizei width,GLint border)1089 static void CODEGEN_FUNCPTR Switch_CopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) 1090 { 1091 CopyTexImage1D = (PFNCOPYTEXIMAGE1DPROC)IntGetProcAddress("glCopyTexImage1D"); 1092 CopyTexImage1D(target, level, internalformat, x, y, width, border); 1093 } 1094 Switch_CopyTexImage2D(GLenum target,GLint level,GLenum internalformat,GLint x,GLint y,GLsizei width,GLsizei height,GLint border)1095 static void CODEGEN_FUNCPTR Switch_CopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) 1096 { 1097 CopyTexImage2D = (PFNCOPYTEXIMAGE2DPROC)IntGetProcAddress("glCopyTexImage2D"); 1098 CopyTexImage2D(target, level, internalformat, x, y, width, height, border); 1099 } 1100 Switch_CopyTexSubImage1D(GLenum target,GLint level,GLint xoffset,GLint x,GLint y,GLsizei width)1101 static void CODEGEN_FUNCPTR Switch_CopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) 1102 { 1103 CopyTexSubImage1D = (PFNCOPYTEXSUBIMAGE1DPROC)IntGetProcAddress("glCopyTexSubImage1D"); 1104 CopyTexSubImage1D(target, level, xoffset, x, y, width); 1105 } 1106 Switch_CopyTexSubImage2D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint x,GLint y,GLsizei width,GLsizei height)1107 static void CODEGEN_FUNCPTR Switch_CopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) 1108 { 1109 CopyTexSubImage2D = (PFNCOPYTEXSUBIMAGE2DPROC)IntGetProcAddress("glCopyTexSubImage2D"); 1110 CopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); 1111 } 1112 Switch_TexSubImage1D(GLenum target,GLint level,GLint xoffset,GLsizei width,GLenum format,GLenum type,const GLvoid * pixels)1113 static void CODEGEN_FUNCPTR Switch_TexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels) 1114 { 1115 TexSubImage1D = (PFNTEXSUBIMAGE1DPROC)IntGetProcAddress("glTexSubImage1D"); 1116 TexSubImage1D(target, level, xoffset, width, format, type, pixels); 1117 } 1118 Switch_TexSubImage2D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLsizei width,GLsizei height,GLenum format,GLenum type,const GLvoid * pixels)1119 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) 1120 { 1121 TexSubImage2D = (PFNTEXSUBIMAGE2DPROC)IntGetProcAddress("glTexSubImage2D"); 1122 TexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); 1123 } 1124 Switch_BindTexture(GLenum target,GLuint texture)1125 static void CODEGEN_FUNCPTR Switch_BindTexture(GLenum target, GLuint texture) 1126 { 1127 BindTexture = (PFNBINDTEXTUREPROC)IntGetProcAddress("glBindTexture"); 1128 BindTexture(target, texture); 1129 } 1130 Switch_DeleteTextures(GLsizei n,const GLuint * textures)1131 static void CODEGEN_FUNCPTR Switch_DeleteTextures(GLsizei n, const GLuint *textures) 1132 { 1133 DeleteTextures = (PFNDELETETEXTURESPROC)IntGetProcAddress("glDeleteTextures"); 1134 DeleteTextures(n, textures); 1135 } 1136 Switch_GenTextures(GLsizei n,GLuint * textures)1137 static void CODEGEN_FUNCPTR Switch_GenTextures(GLsizei n, GLuint *textures) 1138 { 1139 GenTextures = (PFNGENTEXTURESPROC)IntGetProcAddress("glGenTextures"); 1140 GenTextures(n, textures); 1141 } 1142 Switch_IsTexture(GLuint texture)1143 static GLboolean CODEGEN_FUNCPTR Switch_IsTexture(GLuint texture) 1144 { 1145 IsTexture = (PFNISTEXTUREPROC)IntGetProcAddress("glIsTexture"); 1146 return IsTexture(texture); 1147 } 1148 Switch_Indexub(GLubyte c)1149 static void CODEGEN_FUNCPTR Switch_Indexub(GLubyte c) 1150 { 1151 Indexub = (PFNINDEXUBPROC)IntGetProcAddress("glIndexub"); 1152 Indexub(c); 1153 } 1154 Switch_Indexubv(const GLubyte * c)1155 static void CODEGEN_FUNCPTR Switch_Indexubv(const GLubyte *c) 1156 { 1157 Indexubv = (PFNINDEXUBVPROC)IntGetProcAddress("glIndexubv"); 1158 Indexubv(c); 1159 } 1160 1161 // Extension: 1.2 1162 Switch_BlendColor(GLfloat red,GLfloat green,GLfloat blue,GLfloat alpha)1163 static void CODEGEN_FUNCPTR Switch_BlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) 1164 { 1165 BlendColor = (PFNBLENDCOLORPROC)IntGetProcAddress("glBlendColor"); 1166 BlendColor(red, green, blue, alpha); 1167 } 1168 Switch_BlendEquation(GLenum mode)1169 static void CODEGEN_FUNCPTR Switch_BlendEquation(GLenum mode) 1170 { 1171 BlendEquation = (PFNBLENDEQUATIONPROC)IntGetProcAddress("glBlendEquation"); 1172 BlendEquation(mode); 1173 } 1174 Switch_DrawRangeElements(GLenum mode,GLuint start,GLuint end,GLsizei count,GLenum type,const GLvoid * indices)1175 static void CODEGEN_FUNCPTR Switch_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices) 1176 { 1177 DrawRangeElements = (PFNDRAWRANGEELEMENTSPROC)IntGetProcAddress("glDrawRangeElements"); 1178 DrawRangeElements(mode, start, end, count, type, indices); 1179 } 1180 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)1181 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) 1182 { 1183 TexSubImage3D = (PFNTEXSUBIMAGE3DPROC)IntGetProcAddress("glTexSubImage3D"); 1184 TexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); 1185 } 1186 Switch_CopyTexSubImage3D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLint x,GLint y,GLsizei width,GLsizei height)1187 static void CODEGEN_FUNCPTR Switch_CopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) 1188 { 1189 CopyTexSubImage3D = (PFNCOPYTEXSUBIMAGE3DPROC)IntGetProcAddress("glCopyTexSubImage3D"); 1190 CopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height); 1191 } 1192 1193 // Extension: 1.3 1194 Switch_ActiveTexture(GLenum texture)1195 static void CODEGEN_FUNCPTR Switch_ActiveTexture(GLenum texture) 1196 { 1197 ActiveTexture = (PFNACTIVETEXTUREPROC)IntGetProcAddress("glActiveTexture"); 1198 ActiveTexture(texture); 1199 } 1200 Switch_SampleCoverage(GLfloat value,GLboolean invert)1201 static void CODEGEN_FUNCPTR Switch_SampleCoverage(GLfloat value, GLboolean invert) 1202 { 1203 SampleCoverage = (PFNSAMPLECOVERAGEPROC)IntGetProcAddress("glSampleCoverage"); 1204 SampleCoverage(value, invert); 1205 } 1206 Switch_CompressedTexImage3D(GLenum target,GLint level,GLenum internalformat,GLsizei width,GLsizei height,GLsizei depth,GLint border,GLsizei imageSize,const GLvoid * data)1207 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) 1208 { 1209 CompressedTexImage3D = (PFNCOMPRESSEDTEXIMAGE3DPROC)IntGetProcAddress("glCompressedTexImage3D"); 1210 CompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data); 1211 } 1212 Switch_CompressedTexImage2D(GLenum target,GLint level,GLenum internalformat,GLsizei width,GLsizei height,GLint border,GLsizei imageSize,const GLvoid * data)1213 static void CODEGEN_FUNCPTR Switch_CompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) 1214 { 1215 CompressedTexImage2D = (PFNCOMPRESSEDTEXIMAGE2DPROC)IntGetProcAddress("glCompressedTexImage2D"); 1216 CompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data); 1217 } 1218 Switch_CompressedTexImage1D(GLenum target,GLint level,GLenum internalformat,GLsizei width,GLint border,GLsizei imageSize,const GLvoid * data)1219 static void CODEGEN_FUNCPTR Switch_CompressedTexImage1D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) 1220 { 1221 CompressedTexImage1D = (PFNCOMPRESSEDTEXIMAGE1DPROC)IntGetProcAddress("glCompressedTexImage1D"); 1222 CompressedTexImage1D(target, level, internalformat, width, border, imageSize, data); 1223 } 1224 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)1225 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) 1226 { 1227 CompressedTexSubImage3D = (PFNCOMPRESSEDTEXSUBIMAGE3DPROC)IntGetProcAddress("glCompressedTexSubImage3D"); 1228 CompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); 1229 } 1230 Switch_CompressedTexSubImage2D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLsizei width,GLsizei height,GLenum format,GLsizei imageSize,const GLvoid * data)1231 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) 1232 { 1233 CompressedTexSubImage2D = (PFNCOMPRESSEDTEXSUBIMAGE2DPROC)IntGetProcAddress("glCompressedTexSubImage2D"); 1234 CompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data); 1235 } 1236 Switch_CompressedTexSubImage1D(GLenum target,GLint level,GLint xoffset,GLsizei width,GLenum format,GLsizei imageSize,const GLvoid * data)1237 static void CODEGEN_FUNCPTR Switch_CompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) 1238 { 1239 CompressedTexSubImage1D = (PFNCOMPRESSEDTEXSUBIMAGE1DPROC)IntGetProcAddress("glCompressedTexSubImage1D"); 1240 CompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data); 1241 } 1242 Switch_GetCompressedTexImage(GLenum target,GLint level,GLvoid * img)1243 static void CODEGEN_FUNCPTR Switch_GetCompressedTexImage(GLenum target, GLint level, GLvoid *img) 1244 { 1245 GetCompressedTexImage = (PFNGETCOMPRESSEDTEXIMAGEPROC)IntGetProcAddress("glGetCompressedTexImage"); 1246 GetCompressedTexImage(target, level, img); 1247 } 1248 1249 // Extension: 1.4 1250 Switch_BlendFuncSeparate(GLenum sfactorRGB,GLenum dfactorRGB,GLenum sfactorAlpha,GLenum dfactorAlpha)1251 static void CODEGEN_FUNCPTR Switch_BlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) 1252 { 1253 BlendFuncSeparate = (PFNBLENDFUNCSEPARATEPROC)IntGetProcAddress("glBlendFuncSeparate"); 1254 BlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); 1255 } 1256 Switch_MultiDrawArrays(GLenum mode,const GLint * first,const GLsizei * count,GLsizei drawcount)1257 static void CODEGEN_FUNCPTR Switch_MultiDrawArrays(GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount) 1258 { 1259 MultiDrawArrays = (PFNMULTIDRAWARRAYSPROC)IntGetProcAddress("glMultiDrawArrays"); 1260 MultiDrawArrays(mode, first, count, drawcount); 1261 } 1262 Switch_MultiDrawElements(GLenum mode,const GLsizei * count,GLenum type,const GLvoid * const * indices,GLsizei drawcount)1263 static void CODEGEN_FUNCPTR Switch_MultiDrawElements(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount) 1264 { 1265 MultiDrawElements = (PFNMULTIDRAWELEMENTSPROC)IntGetProcAddress("glMultiDrawElements"); 1266 MultiDrawElements(mode, count, type, indices, drawcount); 1267 } 1268 Switch_PointParameterf(GLenum pname,GLfloat param)1269 static void CODEGEN_FUNCPTR Switch_PointParameterf(GLenum pname, GLfloat param) 1270 { 1271 PointParameterf = (PFNPOINTPARAMETERFPROC)IntGetProcAddress("glPointParameterf"); 1272 PointParameterf(pname, param); 1273 } 1274 Switch_PointParameterfv(GLenum pname,const GLfloat * params)1275 static void CODEGEN_FUNCPTR Switch_PointParameterfv(GLenum pname, const GLfloat *params) 1276 { 1277 PointParameterfv = (PFNPOINTPARAMETERFVPROC)IntGetProcAddress("glPointParameterfv"); 1278 PointParameterfv(pname, params); 1279 } 1280 Switch_PointParameteri(GLenum pname,GLint param)1281 static void CODEGEN_FUNCPTR Switch_PointParameteri(GLenum pname, GLint param) 1282 { 1283 PointParameteri = (PFNPOINTPARAMETERIPROC)IntGetProcAddress("glPointParameteri"); 1284 PointParameteri(pname, param); 1285 } 1286 Switch_PointParameteriv(GLenum pname,const GLint * params)1287 static void CODEGEN_FUNCPTR Switch_PointParameteriv(GLenum pname, const GLint *params) 1288 { 1289 PointParameteriv = (PFNPOINTPARAMETERIVPROC)IntGetProcAddress("glPointParameteriv"); 1290 PointParameteriv(pname, params); 1291 } 1292 1293 // Extension: 1.5 1294 Switch_GenQueries(GLsizei n,GLuint * ids)1295 static void CODEGEN_FUNCPTR Switch_GenQueries(GLsizei n, GLuint *ids) 1296 { 1297 GenQueries = (PFNGENQUERIESPROC)IntGetProcAddress("glGenQueries"); 1298 GenQueries(n, ids); 1299 } 1300 Switch_DeleteQueries(GLsizei n,const GLuint * ids)1301 static void CODEGEN_FUNCPTR Switch_DeleteQueries(GLsizei n, const GLuint *ids) 1302 { 1303 DeleteQueries = (PFNDELETEQUERIESPROC)IntGetProcAddress("glDeleteQueries"); 1304 DeleteQueries(n, ids); 1305 } 1306 Switch_IsQuery(GLuint id)1307 static GLboolean CODEGEN_FUNCPTR Switch_IsQuery(GLuint id) 1308 { 1309 IsQuery = (PFNISQUERYPROC)IntGetProcAddress("glIsQuery"); 1310 return IsQuery(id); 1311 } 1312 Switch_BeginQuery(GLenum target,GLuint id)1313 static void CODEGEN_FUNCPTR Switch_BeginQuery(GLenum target, GLuint id) 1314 { 1315 BeginQuery = (PFNBEGINQUERYPROC)IntGetProcAddress("glBeginQuery"); 1316 BeginQuery(target, id); 1317 } 1318 Switch_EndQuery(GLenum target)1319 static void CODEGEN_FUNCPTR Switch_EndQuery(GLenum target) 1320 { 1321 EndQuery = (PFNENDQUERYPROC)IntGetProcAddress("glEndQuery"); 1322 EndQuery(target); 1323 } 1324 Switch_GetQueryiv(GLenum target,GLenum pname,GLint * params)1325 static void CODEGEN_FUNCPTR Switch_GetQueryiv(GLenum target, GLenum pname, GLint *params) 1326 { 1327 GetQueryiv = (PFNGETQUERYIVPROC)IntGetProcAddress("glGetQueryiv"); 1328 GetQueryiv(target, pname, params); 1329 } 1330 Switch_GetQueryObjectiv(GLuint id,GLenum pname,GLint * params)1331 static void CODEGEN_FUNCPTR Switch_GetQueryObjectiv(GLuint id, GLenum pname, GLint *params) 1332 { 1333 GetQueryObjectiv = (PFNGETQUERYOBJECTIVPROC)IntGetProcAddress("glGetQueryObjectiv"); 1334 GetQueryObjectiv(id, pname, params); 1335 } 1336 Switch_GetQueryObjectuiv(GLuint id,GLenum pname,GLuint * params)1337 static void CODEGEN_FUNCPTR Switch_GetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params) 1338 { 1339 GetQueryObjectuiv = (PFNGETQUERYOBJECTUIVPROC)IntGetProcAddress("glGetQueryObjectuiv"); 1340 GetQueryObjectuiv(id, pname, params); 1341 } 1342 Switch_BindBuffer(GLenum target,GLuint buffer)1343 static void CODEGEN_FUNCPTR Switch_BindBuffer(GLenum target, GLuint buffer) 1344 { 1345 BindBuffer = (PFNBINDBUFFERPROC)IntGetProcAddress("glBindBuffer"); 1346 BindBuffer(target, buffer); 1347 } 1348 Switch_DeleteBuffers(GLsizei n,const GLuint * buffers)1349 static void CODEGEN_FUNCPTR Switch_DeleteBuffers(GLsizei n, const GLuint *buffers) 1350 { 1351 DeleteBuffers = (PFNDELETEBUFFERSPROC)IntGetProcAddress("glDeleteBuffers"); 1352 DeleteBuffers(n, buffers); 1353 } 1354 Switch_GenBuffers(GLsizei n,GLuint * buffers)1355 static void CODEGEN_FUNCPTR Switch_GenBuffers(GLsizei n, GLuint *buffers) 1356 { 1357 GenBuffers = (PFNGENBUFFERSPROC)IntGetProcAddress("glGenBuffers"); 1358 GenBuffers(n, buffers); 1359 } 1360 Switch_IsBuffer(GLuint buffer)1361 static GLboolean CODEGEN_FUNCPTR Switch_IsBuffer(GLuint buffer) 1362 { 1363 IsBuffer = (PFNISBUFFERPROC)IntGetProcAddress("glIsBuffer"); 1364 return IsBuffer(buffer); 1365 } 1366 Switch_BufferData(GLenum target,GLsizeiptr size,const GLvoid * data,GLenum usage)1367 static void CODEGEN_FUNCPTR Switch_BufferData(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage) 1368 { 1369 BufferData = (PFNBUFFERDATAPROC)IntGetProcAddress("glBufferData"); 1370 BufferData(target, size, data, usage); 1371 } 1372 Switch_BufferSubData(GLenum target,GLintptr offset,GLsizeiptr size,const GLvoid * data)1373 static void CODEGEN_FUNCPTR Switch_BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data) 1374 { 1375 BufferSubData = (PFNBUFFERSUBDATAPROC)IntGetProcAddress("glBufferSubData"); 1376 BufferSubData(target, offset, size, data); 1377 } 1378 Switch_GetBufferSubData(GLenum target,GLintptr offset,GLsizeiptr size,GLvoid * data)1379 static void CODEGEN_FUNCPTR Switch_GetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data) 1380 { 1381 GetBufferSubData = (PFNGETBUFFERSUBDATAPROC)IntGetProcAddress("glGetBufferSubData"); 1382 GetBufferSubData(target, offset, size, data); 1383 } 1384 Switch_MapBuffer(GLenum target,GLenum access)1385 static GLvoid* CODEGEN_FUNCPTR Switch_MapBuffer(GLenum target, GLenum access) 1386 { 1387 MapBuffer = (PFNMAPBUFFERPROC)IntGetProcAddress("glMapBuffer"); 1388 return MapBuffer(target, access); 1389 } 1390 Switch_UnmapBuffer(GLenum target)1391 static GLboolean CODEGEN_FUNCPTR Switch_UnmapBuffer(GLenum target) 1392 { 1393 UnmapBuffer = (PFNUNMAPBUFFERPROC)IntGetProcAddress("glUnmapBuffer"); 1394 return UnmapBuffer(target); 1395 } 1396 Switch_GetBufferParameteriv(GLenum target,GLenum pname,GLint * params)1397 static void CODEGEN_FUNCPTR Switch_GetBufferParameteriv(GLenum target, GLenum pname, GLint *params) 1398 { 1399 GetBufferParameteriv = (PFNGETBUFFERPARAMETERIVPROC)IntGetProcAddress("glGetBufferParameteriv"); 1400 GetBufferParameteriv(target, pname, params); 1401 } 1402 Switch_GetBufferPointerv(GLenum target,GLenum pname,GLvoid ** params)1403 static void CODEGEN_FUNCPTR Switch_GetBufferPointerv(GLenum target, GLenum pname, GLvoid* *params) 1404 { 1405 GetBufferPointerv = (PFNGETBUFFERPOINTERVPROC)IntGetProcAddress("glGetBufferPointerv"); 1406 GetBufferPointerv(target, pname, params); 1407 } 1408 1409 // Extension: 2.0 1410 Switch_BlendEquationSeparate(GLenum modeRGB,GLenum modeAlpha)1411 static void CODEGEN_FUNCPTR Switch_BlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) 1412 { 1413 BlendEquationSeparate = (PFNBLENDEQUATIONSEPARATEPROC)IntGetProcAddress("glBlendEquationSeparate"); 1414 BlendEquationSeparate(modeRGB, modeAlpha); 1415 } 1416 Switch_DrawBuffers(GLsizei n,const GLenum * bufs)1417 static void CODEGEN_FUNCPTR Switch_DrawBuffers(GLsizei n, const GLenum *bufs) 1418 { 1419 DrawBuffers = (PFNDRAWBUFFERSPROC)IntGetProcAddress("glDrawBuffers"); 1420 DrawBuffers(n, bufs); 1421 } 1422 Switch_StencilOpSeparate(GLenum face,GLenum sfail,GLenum dpfail,GLenum dppass)1423 static void CODEGEN_FUNCPTR Switch_StencilOpSeparate(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass) 1424 { 1425 StencilOpSeparate = (PFNSTENCILOPSEPARATEPROC)IntGetProcAddress("glStencilOpSeparate"); 1426 StencilOpSeparate(face, sfail, dpfail, dppass); 1427 } 1428 Switch_StencilFuncSeparate(GLenum face,GLenum func,GLint ref,GLuint mask)1429 static void CODEGEN_FUNCPTR Switch_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) 1430 { 1431 StencilFuncSeparate = (PFNSTENCILFUNCSEPARATEPROC)IntGetProcAddress("glStencilFuncSeparate"); 1432 StencilFuncSeparate(face, func, ref, mask); 1433 } 1434 Switch_StencilMaskSeparate(GLenum face,GLuint mask)1435 static void CODEGEN_FUNCPTR Switch_StencilMaskSeparate(GLenum face, GLuint mask) 1436 { 1437 StencilMaskSeparate = (PFNSTENCILMASKSEPARATEPROC)IntGetProcAddress("glStencilMaskSeparate"); 1438 StencilMaskSeparate(face, mask); 1439 } 1440 Switch_AttachShader(GLuint program,GLuint shader)1441 static void CODEGEN_FUNCPTR Switch_AttachShader(GLuint program, GLuint shader) 1442 { 1443 AttachShader = (PFNATTACHSHADERPROC)IntGetProcAddress("glAttachShader"); 1444 AttachShader(program, shader); 1445 } 1446 Switch_BindAttribLocation(GLuint program,GLuint index,const GLchar * name)1447 static void CODEGEN_FUNCPTR Switch_BindAttribLocation(GLuint program, GLuint index, const GLchar *name) 1448 { 1449 BindAttribLocation = (PFNBINDATTRIBLOCATIONPROC)IntGetProcAddress("glBindAttribLocation"); 1450 BindAttribLocation(program, index, name); 1451 } 1452 Switch_CompileShader(GLuint shader)1453 static void CODEGEN_FUNCPTR Switch_CompileShader(GLuint shader) 1454 { 1455 CompileShader = (PFNCOMPILESHADERPROC)IntGetProcAddress("glCompileShader"); 1456 CompileShader(shader); 1457 } 1458 Switch_CreateProgram()1459 static GLuint CODEGEN_FUNCPTR Switch_CreateProgram() 1460 { 1461 CreateProgram = (PFNCREATEPROGRAMPROC)IntGetProcAddress("glCreateProgram"); 1462 return CreateProgram(); 1463 } 1464 Switch_CreateShader(GLenum type)1465 static GLuint CODEGEN_FUNCPTR Switch_CreateShader(GLenum type) 1466 { 1467 CreateShader = (PFNCREATESHADERPROC)IntGetProcAddress("glCreateShader"); 1468 return CreateShader(type); 1469 } 1470 Switch_DeleteProgram(GLuint program)1471 static void CODEGEN_FUNCPTR Switch_DeleteProgram(GLuint program) 1472 { 1473 DeleteProgram = (PFNDELETEPROGRAMPROC)IntGetProcAddress("glDeleteProgram"); 1474 DeleteProgram(program); 1475 } 1476 Switch_DeleteShader(GLuint shader)1477 static void CODEGEN_FUNCPTR Switch_DeleteShader(GLuint shader) 1478 { 1479 DeleteShader = (PFNDELETESHADERPROC)IntGetProcAddress("glDeleteShader"); 1480 DeleteShader(shader); 1481 } 1482 Switch_DetachShader(GLuint program,GLuint shader)1483 static void CODEGEN_FUNCPTR Switch_DetachShader(GLuint program, GLuint shader) 1484 { 1485 DetachShader = (PFNDETACHSHADERPROC)IntGetProcAddress("glDetachShader"); 1486 DetachShader(program, shader); 1487 } 1488 Switch_DisableVertexAttribArray(GLuint index)1489 static void CODEGEN_FUNCPTR Switch_DisableVertexAttribArray(GLuint index) 1490 { 1491 DisableVertexAttribArray = (PFNDISABLEVERTEXATTRIBARRAYPROC)IntGetProcAddress("glDisableVertexAttribArray"); 1492 DisableVertexAttribArray(index); 1493 } 1494 Switch_EnableVertexAttribArray(GLuint index)1495 static void CODEGEN_FUNCPTR Switch_EnableVertexAttribArray(GLuint index) 1496 { 1497 EnableVertexAttribArray = (PFNENABLEVERTEXATTRIBARRAYPROC)IntGetProcAddress("glEnableVertexAttribArray"); 1498 EnableVertexAttribArray(index); 1499 } 1500 Switch_GetActiveAttrib(GLuint program,GLuint index,GLsizei bufSize,GLsizei * length,GLint * size,GLenum * type,GLchar * name)1501 static void CODEGEN_FUNCPTR Switch_GetActiveAttrib(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name) 1502 { 1503 GetActiveAttrib = (PFNGETACTIVEATTRIBPROC)IntGetProcAddress("glGetActiveAttrib"); 1504 GetActiveAttrib(program, index, bufSize, length, size, type, name); 1505 } 1506 Switch_GetActiveUniform(GLuint program,GLuint index,GLsizei bufSize,GLsizei * length,GLint * size,GLenum * type,GLchar * name)1507 static void CODEGEN_FUNCPTR Switch_GetActiveUniform(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name) 1508 { 1509 GetActiveUniform = (PFNGETACTIVEUNIFORMPROC)IntGetProcAddress("glGetActiveUniform"); 1510 GetActiveUniform(program, index, bufSize, length, size, type, name); 1511 } 1512 Switch_GetAttachedShaders(GLuint program,GLsizei maxCount,GLsizei * count,GLuint * obj)1513 static void CODEGEN_FUNCPTR Switch_GetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj) 1514 { 1515 GetAttachedShaders = (PFNGETATTACHEDSHADERSPROC)IntGetProcAddress("glGetAttachedShaders"); 1516 GetAttachedShaders(program, maxCount, count, obj); 1517 } 1518 Switch_GetAttribLocation(GLuint program,const GLchar * name)1519 static GLint CODEGEN_FUNCPTR Switch_GetAttribLocation(GLuint program, const GLchar *name) 1520 { 1521 GetAttribLocation = (PFNGETATTRIBLOCATIONPROC)IntGetProcAddress("glGetAttribLocation"); 1522 return GetAttribLocation(program, name); 1523 } 1524 Switch_GetProgramiv(GLuint program,GLenum pname,GLint * params)1525 static void CODEGEN_FUNCPTR Switch_GetProgramiv(GLuint program, GLenum pname, GLint *params) 1526 { 1527 GetProgramiv = (PFNGETPROGRAMIVPROC)IntGetProcAddress("glGetProgramiv"); 1528 GetProgramiv(program, pname, params); 1529 } 1530 Switch_GetProgramInfoLog(GLuint program,GLsizei bufSize,GLsizei * length,GLchar * infoLog)1531 static void CODEGEN_FUNCPTR Switch_GetProgramInfoLog(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog) 1532 { 1533 GetProgramInfoLog = (PFNGETPROGRAMINFOLOGPROC)IntGetProcAddress("glGetProgramInfoLog"); 1534 GetProgramInfoLog(program, bufSize, length, infoLog); 1535 } 1536 Switch_GetShaderiv(GLuint shader,GLenum pname,GLint * params)1537 static void CODEGEN_FUNCPTR Switch_GetShaderiv(GLuint shader, GLenum pname, GLint *params) 1538 { 1539 GetShaderiv = (PFNGETSHADERIVPROC)IntGetProcAddress("glGetShaderiv"); 1540 GetShaderiv(shader, pname, params); 1541 } 1542 Switch_GetShaderInfoLog(GLuint shader,GLsizei bufSize,GLsizei * length,GLchar * infoLog)1543 static void CODEGEN_FUNCPTR Switch_GetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog) 1544 { 1545 GetShaderInfoLog = (PFNGETSHADERINFOLOGPROC)IntGetProcAddress("glGetShaderInfoLog"); 1546 GetShaderInfoLog(shader, bufSize, length, infoLog); 1547 } 1548 Switch_GetShaderSource(GLuint shader,GLsizei bufSize,GLsizei * length,GLchar * source)1549 static void CODEGEN_FUNCPTR Switch_GetShaderSource(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source) 1550 { 1551 GetShaderSource = (PFNGETSHADERSOURCEPROC)IntGetProcAddress("glGetShaderSource"); 1552 GetShaderSource(shader, bufSize, length, source); 1553 } 1554 Switch_GetUniformLocation(GLuint program,const GLchar * name)1555 static GLint CODEGEN_FUNCPTR Switch_GetUniformLocation(GLuint program, const GLchar *name) 1556 { 1557 GetUniformLocation = (PFNGETUNIFORMLOCATIONPROC)IntGetProcAddress("glGetUniformLocation"); 1558 return GetUniformLocation(program, name); 1559 } 1560 Switch_GetUniformfv(GLuint program,GLint location,GLfloat * params)1561 static void CODEGEN_FUNCPTR Switch_GetUniformfv(GLuint program, GLint location, GLfloat *params) 1562 { 1563 GetUniformfv = (PFNGETUNIFORMFVPROC)IntGetProcAddress("glGetUniformfv"); 1564 GetUniformfv(program, location, params); 1565 } 1566 Switch_GetUniformiv(GLuint program,GLint location,GLint * params)1567 static void CODEGEN_FUNCPTR Switch_GetUniformiv(GLuint program, GLint location, GLint *params) 1568 { 1569 GetUniformiv = (PFNGETUNIFORMIVPROC)IntGetProcAddress("glGetUniformiv"); 1570 GetUniformiv(program, location, params); 1571 } 1572 Switch_GetVertexAttribdv(GLuint index,GLenum pname,GLdouble * params)1573 static void CODEGEN_FUNCPTR Switch_GetVertexAttribdv(GLuint index, GLenum pname, GLdouble *params) 1574 { 1575 GetVertexAttribdv = (PFNGETVERTEXATTRIBDVPROC)IntGetProcAddress("glGetVertexAttribdv"); 1576 GetVertexAttribdv(index, pname, params); 1577 } 1578 Switch_GetVertexAttribfv(GLuint index,GLenum pname,GLfloat * params)1579 static void CODEGEN_FUNCPTR Switch_GetVertexAttribfv(GLuint index, GLenum pname, GLfloat *params) 1580 { 1581 GetVertexAttribfv = (PFNGETVERTEXATTRIBFVPROC)IntGetProcAddress("glGetVertexAttribfv"); 1582 GetVertexAttribfv(index, pname, params); 1583 } 1584 Switch_GetVertexAttribiv(GLuint index,GLenum pname,GLint * params)1585 static void CODEGEN_FUNCPTR Switch_GetVertexAttribiv(GLuint index, GLenum pname, GLint *params) 1586 { 1587 GetVertexAttribiv = (PFNGETVERTEXATTRIBIVPROC)IntGetProcAddress("glGetVertexAttribiv"); 1588 GetVertexAttribiv(index, pname, params); 1589 } 1590 Switch_GetVertexAttribPointerv(GLuint index,GLenum pname,GLvoid ** pointer)1591 static void CODEGEN_FUNCPTR Switch_GetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid* *pointer) 1592 { 1593 GetVertexAttribPointerv = (PFNGETVERTEXATTRIBPOINTERVPROC)IntGetProcAddress("glGetVertexAttribPointerv"); 1594 GetVertexAttribPointerv(index, pname, pointer); 1595 } 1596 Switch_IsProgram(GLuint program)1597 static GLboolean CODEGEN_FUNCPTR Switch_IsProgram(GLuint program) 1598 { 1599 IsProgram = (PFNISPROGRAMPROC)IntGetProcAddress("glIsProgram"); 1600 return IsProgram(program); 1601 } 1602 Switch_IsShader(GLuint shader)1603 static GLboolean CODEGEN_FUNCPTR Switch_IsShader(GLuint shader) 1604 { 1605 IsShader = (PFNISSHADERPROC)IntGetProcAddress("glIsShader"); 1606 return IsShader(shader); 1607 } 1608 Switch_LinkProgram(GLuint program)1609 static void CODEGEN_FUNCPTR Switch_LinkProgram(GLuint program) 1610 { 1611 LinkProgram = (PFNLINKPROGRAMPROC)IntGetProcAddress("glLinkProgram"); 1612 LinkProgram(program); 1613 } 1614 Switch_ShaderSource(GLuint shader,GLsizei count,const GLchar * const * string,const GLint * length)1615 static void CODEGEN_FUNCPTR Switch_ShaderSource(GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length) 1616 { 1617 ShaderSource = (PFNSHADERSOURCEPROC)IntGetProcAddress("glShaderSource"); 1618 ShaderSource(shader, count, string, length); 1619 } 1620 Switch_UseProgram(GLuint program)1621 static void CODEGEN_FUNCPTR Switch_UseProgram(GLuint program) 1622 { 1623 UseProgram = (PFNUSEPROGRAMPROC)IntGetProcAddress("glUseProgram"); 1624 UseProgram(program); 1625 } 1626 Switch_Uniform1f(GLint location,GLfloat v0)1627 static void CODEGEN_FUNCPTR Switch_Uniform1f(GLint location, GLfloat v0) 1628 { 1629 Uniform1f = (PFNUNIFORM1FPROC)IntGetProcAddress("glUniform1f"); 1630 Uniform1f(location, v0); 1631 } 1632 Switch_Uniform2f(GLint location,GLfloat v0,GLfloat v1)1633 static void CODEGEN_FUNCPTR Switch_Uniform2f(GLint location, GLfloat v0, GLfloat v1) 1634 { 1635 Uniform2f = (PFNUNIFORM2FPROC)IntGetProcAddress("glUniform2f"); 1636 Uniform2f(location, v0, v1); 1637 } 1638 Switch_Uniform3f(GLint location,GLfloat v0,GLfloat v1,GLfloat v2)1639 static void CODEGEN_FUNCPTR Switch_Uniform3f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) 1640 { 1641 Uniform3f = (PFNUNIFORM3FPROC)IntGetProcAddress("glUniform3f"); 1642 Uniform3f(location, v0, v1, v2); 1643 } 1644 Switch_Uniform4f(GLint location,GLfloat v0,GLfloat v1,GLfloat v2,GLfloat v3)1645 static void CODEGEN_FUNCPTR Switch_Uniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) 1646 { 1647 Uniform4f = (PFNUNIFORM4FPROC)IntGetProcAddress("glUniform4f"); 1648 Uniform4f(location, v0, v1, v2, v3); 1649 } 1650 Switch_Uniform1i(GLint location,GLint v0)1651 static void CODEGEN_FUNCPTR Switch_Uniform1i(GLint location, GLint v0) 1652 { 1653 Uniform1i = (PFNUNIFORM1IPROC)IntGetProcAddress("glUniform1i"); 1654 Uniform1i(location, v0); 1655 } 1656 Switch_Uniform2i(GLint location,GLint v0,GLint v1)1657 static void CODEGEN_FUNCPTR Switch_Uniform2i(GLint location, GLint v0, GLint v1) 1658 { 1659 Uniform2i = (PFNUNIFORM2IPROC)IntGetProcAddress("glUniform2i"); 1660 Uniform2i(location, v0, v1); 1661 } 1662 Switch_Uniform3i(GLint location,GLint v0,GLint v1,GLint v2)1663 static void CODEGEN_FUNCPTR Switch_Uniform3i(GLint location, GLint v0, GLint v1, GLint v2) 1664 { 1665 Uniform3i = (PFNUNIFORM3IPROC)IntGetProcAddress("glUniform3i"); 1666 Uniform3i(location, v0, v1, v2); 1667 } 1668 Switch_Uniform4i(GLint location,GLint v0,GLint v1,GLint v2,GLint v3)1669 static void CODEGEN_FUNCPTR Switch_Uniform4i(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) 1670 { 1671 Uniform4i = (PFNUNIFORM4IPROC)IntGetProcAddress("glUniform4i"); 1672 Uniform4i(location, v0, v1, v2, v3); 1673 } 1674 Switch_Uniform1fv(GLint location,GLsizei count,const GLfloat * value)1675 static void CODEGEN_FUNCPTR Switch_Uniform1fv(GLint location, GLsizei count, const GLfloat *value) 1676 { 1677 Uniform1fv = (PFNUNIFORM1FVPROC)IntGetProcAddress("glUniform1fv"); 1678 Uniform1fv(location, count, value); 1679 } 1680 Switch_Uniform2fv(GLint location,GLsizei count,const GLfloat * value)1681 static void CODEGEN_FUNCPTR Switch_Uniform2fv(GLint location, GLsizei count, const GLfloat *value) 1682 { 1683 Uniform2fv = (PFNUNIFORM2FVPROC)IntGetProcAddress("glUniform2fv"); 1684 Uniform2fv(location, count, value); 1685 } 1686 Switch_Uniform3fv(GLint location,GLsizei count,const GLfloat * value)1687 static void CODEGEN_FUNCPTR Switch_Uniform3fv(GLint location, GLsizei count, const GLfloat *value) 1688 { 1689 Uniform3fv = (PFNUNIFORM3FVPROC)IntGetProcAddress("glUniform3fv"); 1690 Uniform3fv(location, count, value); 1691 } 1692 Switch_Uniform4fv(GLint location,GLsizei count,const GLfloat * value)1693 static void CODEGEN_FUNCPTR Switch_Uniform4fv(GLint location, GLsizei count, const GLfloat *value) 1694 { 1695 Uniform4fv = (PFNUNIFORM4FVPROC)IntGetProcAddress("glUniform4fv"); 1696 Uniform4fv(location, count, value); 1697 } 1698 Switch_Uniform1iv(GLint location,GLsizei count,const GLint * value)1699 static void CODEGEN_FUNCPTR Switch_Uniform1iv(GLint location, GLsizei count, const GLint *value) 1700 { 1701 Uniform1iv = (PFNUNIFORM1IVPROC)IntGetProcAddress("glUniform1iv"); 1702 Uniform1iv(location, count, value); 1703 } 1704 Switch_Uniform2iv(GLint location,GLsizei count,const GLint * value)1705 static void CODEGEN_FUNCPTR Switch_Uniform2iv(GLint location, GLsizei count, const GLint *value) 1706 { 1707 Uniform2iv = (PFNUNIFORM2IVPROC)IntGetProcAddress("glUniform2iv"); 1708 Uniform2iv(location, count, value); 1709 } 1710 Switch_Uniform3iv(GLint location,GLsizei count,const GLint * value)1711 static void CODEGEN_FUNCPTR Switch_Uniform3iv(GLint location, GLsizei count, const GLint *value) 1712 { 1713 Uniform3iv = (PFNUNIFORM3IVPROC)IntGetProcAddress("glUniform3iv"); 1714 Uniform3iv(location, count, value); 1715 } 1716 Switch_Uniform4iv(GLint location,GLsizei count,const GLint * value)1717 static void CODEGEN_FUNCPTR Switch_Uniform4iv(GLint location, GLsizei count, const GLint *value) 1718 { 1719 Uniform4iv = (PFNUNIFORM4IVPROC)IntGetProcAddress("glUniform4iv"); 1720 Uniform4iv(location, count, value); 1721 } 1722 Switch_UniformMatrix2fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)1723 static void CODEGEN_FUNCPTR Switch_UniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 1724 { 1725 UniformMatrix2fv = (PFNUNIFORMMATRIX2FVPROC)IntGetProcAddress("glUniformMatrix2fv"); 1726 UniformMatrix2fv(location, count, transpose, value); 1727 } 1728 Switch_UniformMatrix3fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)1729 static void CODEGEN_FUNCPTR Switch_UniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 1730 { 1731 UniformMatrix3fv = (PFNUNIFORMMATRIX3FVPROC)IntGetProcAddress("glUniformMatrix3fv"); 1732 UniformMatrix3fv(location, count, transpose, value); 1733 } 1734 Switch_UniformMatrix4fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)1735 static void CODEGEN_FUNCPTR Switch_UniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 1736 { 1737 UniformMatrix4fv = (PFNUNIFORMMATRIX4FVPROC)IntGetProcAddress("glUniformMatrix4fv"); 1738 UniformMatrix4fv(location, count, transpose, value); 1739 } 1740 Switch_ValidateProgram(GLuint program)1741 static void CODEGEN_FUNCPTR Switch_ValidateProgram(GLuint program) 1742 { 1743 ValidateProgram = (PFNVALIDATEPROGRAMPROC)IntGetProcAddress("glValidateProgram"); 1744 ValidateProgram(program); 1745 } 1746 Switch_VertexAttribPointer(GLuint index,GLint size,GLenum type,GLboolean normalized,GLsizei stride,const GLvoid * pointer)1747 static void CODEGEN_FUNCPTR Switch_VertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer) 1748 { 1749 VertexAttribPointer = (PFNVERTEXATTRIBPOINTERPROC)IntGetProcAddress("glVertexAttribPointer"); 1750 VertexAttribPointer(index, size, type, normalized, stride, pointer); 1751 } 1752 1753 // Extension: 2.1 1754 Switch_UniformMatrix2x3fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)1755 static void CODEGEN_FUNCPTR Switch_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 1756 { 1757 UniformMatrix2x3fv = (PFNUNIFORMMATRIX2X3FVPROC)IntGetProcAddress("glUniformMatrix2x3fv"); 1758 UniformMatrix2x3fv(location, count, transpose, value); 1759 } 1760 Switch_UniformMatrix3x2fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)1761 static void CODEGEN_FUNCPTR Switch_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 1762 { 1763 UniformMatrix3x2fv = (PFNUNIFORMMATRIX3X2FVPROC)IntGetProcAddress("glUniformMatrix3x2fv"); 1764 UniformMatrix3x2fv(location, count, transpose, value); 1765 } 1766 Switch_UniformMatrix2x4fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)1767 static void CODEGEN_FUNCPTR Switch_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 1768 { 1769 UniformMatrix2x4fv = (PFNUNIFORMMATRIX2X4FVPROC)IntGetProcAddress("glUniformMatrix2x4fv"); 1770 UniformMatrix2x4fv(location, count, transpose, value); 1771 } 1772 Switch_UniformMatrix4x2fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)1773 static void CODEGEN_FUNCPTR Switch_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 1774 { 1775 UniformMatrix4x2fv = (PFNUNIFORMMATRIX4X2FVPROC)IntGetProcAddress("glUniformMatrix4x2fv"); 1776 UniformMatrix4x2fv(location, count, transpose, value); 1777 } 1778 Switch_UniformMatrix3x4fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)1779 static void CODEGEN_FUNCPTR Switch_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 1780 { 1781 UniformMatrix3x4fv = (PFNUNIFORMMATRIX3X4FVPROC)IntGetProcAddress("glUniformMatrix3x4fv"); 1782 UniformMatrix3x4fv(location, count, transpose, value); 1783 } 1784 Switch_UniformMatrix4x3fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)1785 static void CODEGEN_FUNCPTR Switch_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 1786 { 1787 UniformMatrix4x3fv = (PFNUNIFORMMATRIX4X3FVPROC)IntGetProcAddress("glUniformMatrix4x3fv"); 1788 UniformMatrix4x3fv(location, count, transpose, value); 1789 } 1790 1791 // Extension: ARB_vertex_array_object 1792 Switch_BindVertexArray(GLuint ren_array)1793 static void CODEGEN_FUNCPTR Switch_BindVertexArray(GLuint ren_array) 1794 { 1795 BindVertexArray = (PFNBINDVERTEXARRAYPROC)IntGetProcAddress("glBindVertexArray"); 1796 BindVertexArray(ren_array); 1797 } 1798 Switch_DeleteVertexArrays(GLsizei n,const GLuint * arrays)1799 static void CODEGEN_FUNCPTR Switch_DeleteVertexArrays(GLsizei n, const GLuint *arrays) 1800 { 1801 DeleteVertexArrays = (PFNDELETEVERTEXARRAYSPROC)IntGetProcAddress("glDeleteVertexArrays"); 1802 DeleteVertexArrays(n, arrays); 1803 } 1804 Switch_GenVertexArrays(GLsizei n,GLuint * arrays)1805 static void CODEGEN_FUNCPTR Switch_GenVertexArrays(GLsizei n, GLuint *arrays) 1806 { 1807 GenVertexArrays = (PFNGENVERTEXARRAYSPROC)IntGetProcAddress("glGenVertexArrays"); 1808 GenVertexArrays(n, arrays); 1809 } 1810 Switch_IsVertexArray(GLuint ren_array)1811 static GLboolean CODEGEN_FUNCPTR Switch_IsVertexArray(GLuint ren_array) 1812 { 1813 IsVertexArray = (PFNISVERTEXARRAYPROC)IntGetProcAddress("glIsVertexArray"); 1814 return IsVertexArray(ren_array); 1815 } 1816 1817 // Extension: ARB_map_buffer_range 1818 Switch_MapBufferRange(GLenum target,GLintptr offset,GLsizeiptr length,GLbitfield access)1819 static GLvoid* CODEGEN_FUNCPTR Switch_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access) 1820 { 1821 MapBufferRange = (PFNMAPBUFFERRANGEPROC)IntGetProcAddress("glMapBufferRange"); 1822 return MapBufferRange(target, offset, length, access); 1823 } 1824 Switch_FlushMappedBufferRange(GLenum target,GLintptr offset,GLsizeiptr length)1825 static void CODEGEN_FUNCPTR Switch_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length) 1826 { 1827 FlushMappedBufferRange = (PFNFLUSHMAPPEDBUFFERRANGEPROC)IntGetProcAddress("glFlushMappedBufferRange"); 1828 FlushMappedBufferRange(target, offset, length); 1829 } 1830 1831 // Extension: ARB_framebuffer_object 1832 Switch_IsRenderbuffer(GLuint renderbuffer)1833 static GLboolean CODEGEN_FUNCPTR Switch_IsRenderbuffer(GLuint renderbuffer) 1834 { 1835 IsRenderbuffer = (PFNISRENDERBUFFERPROC)IntGetProcAddress("glIsRenderbuffer"); 1836 return IsRenderbuffer(renderbuffer); 1837 } 1838 Switch_BindRenderbuffer(GLenum target,GLuint renderbuffer)1839 static void CODEGEN_FUNCPTR Switch_BindRenderbuffer(GLenum target, GLuint renderbuffer) 1840 { 1841 BindRenderbuffer = (PFNBINDRENDERBUFFERPROC)IntGetProcAddress("glBindRenderbuffer"); 1842 BindRenderbuffer(target, renderbuffer); 1843 } 1844 Switch_DeleteRenderbuffers(GLsizei n,const GLuint * renderbuffers)1845 static void CODEGEN_FUNCPTR Switch_DeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers) 1846 { 1847 DeleteRenderbuffers = (PFNDELETERENDERBUFFERSPROC)IntGetProcAddress("glDeleteRenderbuffers"); 1848 DeleteRenderbuffers(n, renderbuffers); 1849 } 1850 Switch_GenRenderbuffers(GLsizei n,GLuint * renderbuffers)1851 static void CODEGEN_FUNCPTR Switch_GenRenderbuffers(GLsizei n, GLuint *renderbuffers) 1852 { 1853 GenRenderbuffers = (PFNGENRENDERBUFFERSPROC)IntGetProcAddress("glGenRenderbuffers"); 1854 GenRenderbuffers(n, renderbuffers); 1855 } 1856 Switch_RenderbufferStorage(GLenum target,GLenum internalformat,GLsizei width,GLsizei height)1857 static void CODEGEN_FUNCPTR Switch_RenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) 1858 { 1859 RenderbufferStorage = (PFNRENDERBUFFERSTORAGEPROC)IntGetProcAddress("glRenderbufferStorage"); 1860 RenderbufferStorage(target, internalformat, width, height); 1861 } 1862 Switch_GetRenderbufferParameteriv(GLenum target,GLenum pname,GLint * params)1863 static void CODEGEN_FUNCPTR Switch_GetRenderbufferParameteriv(GLenum target, GLenum pname, GLint *params) 1864 { 1865 GetRenderbufferParameteriv = (PFNGETRENDERBUFFERPARAMETERIVPROC)IntGetProcAddress("glGetRenderbufferParameteriv"); 1866 GetRenderbufferParameteriv(target, pname, params); 1867 } 1868 Switch_IsFramebuffer(GLuint framebuffer)1869 static GLboolean CODEGEN_FUNCPTR Switch_IsFramebuffer(GLuint framebuffer) 1870 { 1871 IsFramebuffer = (PFNISFRAMEBUFFERPROC)IntGetProcAddress("glIsFramebuffer"); 1872 return IsFramebuffer(framebuffer); 1873 } 1874 Switch_BindFramebuffer(GLenum target,GLuint framebuffer)1875 static void CODEGEN_FUNCPTR Switch_BindFramebuffer(GLenum target, GLuint framebuffer) 1876 { 1877 BindFramebuffer = (PFNBINDFRAMEBUFFERPROC)IntGetProcAddress("glBindFramebuffer"); 1878 BindFramebuffer(target, framebuffer); 1879 } 1880 Switch_DeleteFramebuffers(GLsizei n,const GLuint * framebuffers)1881 static void CODEGEN_FUNCPTR Switch_DeleteFramebuffers(GLsizei n, const GLuint *framebuffers) 1882 { 1883 DeleteFramebuffers = (PFNDELETEFRAMEBUFFERSPROC)IntGetProcAddress("glDeleteFramebuffers"); 1884 DeleteFramebuffers(n, framebuffers); 1885 } 1886 Switch_GenFramebuffers(GLsizei n,GLuint * framebuffers)1887 static void CODEGEN_FUNCPTR Switch_GenFramebuffers(GLsizei n, GLuint *framebuffers) 1888 { 1889 GenFramebuffers = (PFNGENFRAMEBUFFERSPROC)IntGetProcAddress("glGenFramebuffers"); 1890 GenFramebuffers(n, framebuffers); 1891 } 1892 Switch_CheckFramebufferStatus(GLenum target)1893 static GLenum CODEGEN_FUNCPTR Switch_CheckFramebufferStatus(GLenum target) 1894 { 1895 CheckFramebufferStatus = (PFNCHECKFRAMEBUFFERSTATUSPROC)IntGetProcAddress("glCheckFramebufferStatus"); 1896 return CheckFramebufferStatus(target); 1897 } 1898 Switch_FramebufferTexture1D(GLenum target,GLenum attachment,GLenum textarget,GLuint texture,GLint level)1899 static void CODEGEN_FUNCPTR Switch_FramebufferTexture1D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) 1900 { 1901 FramebufferTexture1D = (PFNFRAMEBUFFERTEXTURE1DPROC)IntGetProcAddress("glFramebufferTexture1D"); 1902 FramebufferTexture1D(target, attachment, textarget, texture, level); 1903 } 1904 Switch_FramebufferTexture2D(GLenum target,GLenum attachment,GLenum textarget,GLuint texture,GLint level)1905 static void CODEGEN_FUNCPTR Switch_FramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) 1906 { 1907 FramebufferTexture2D = (PFNFRAMEBUFFERTEXTURE2DPROC)IntGetProcAddress("glFramebufferTexture2D"); 1908 FramebufferTexture2D(target, attachment, textarget, texture, level); 1909 } 1910 Switch_FramebufferTexture3D(GLenum target,GLenum attachment,GLenum textarget,GLuint texture,GLint level,GLint zoffset)1911 static void CODEGEN_FUNCPTR Switch_FramebufferTexture3D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) 1912 { 1913 FramebufferTexture3D = (PFNFRAMEBUFFERTEXTURE3DPROC)IntGetProcAddress("glFramebufferTexture3D"); 1914 FramebufferTexture3D(target, attachment, textarget, texture, level, zoffset); 1915 } 1916 Switch_FramebufferRenderbuffer(GLenum target,GLenum attachment,GLenum renderbuffertarget,GLuint renderbuffer)1917 static void CODEGEN_FUNCPTR Switch_FramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) 1918 { 1919 FramebufferRenderbuffer = (PFNFRAMEBUFFERRENDERBUFFERPROC)IntGetProcAddress("glFramebufferRenderbuffer"); 1920 FramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer); 1921 } 1922 Switch_GetFramebufferAttachmentParameteriv(GLenum target,GLenum attachment,GLenum pname,GLint * params)1923 static void CODEGEN_FUNCPTR Switch_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint *params) 1924 { 1925 GetFramebufferAttachmentParameteriv = (PFNGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)IntGetProcAddress("glGetFramebufferAttachmentParameteriv"); 1926 GetFramebufferAttachmentParameteriv(target, attachment, pname, params); 1927 } 1928 Switch_GenerateMipmap(GLenum target)1929 static void CODEGEN_FUNCPTR Switch_GenerateMipmap(GLenum target) 1930 { 1931 GenerateMipmap = (PFNGENERATEMIPMAPPROC)IntGetProcAddress("glGenerateMipmap"); 1932 GenerateMipmap(target); 1933 } 1934 Switch_BlitFramebuffer(GLint srcX0,GLint srcY0,GLint srcX1,GLint srcY1,GLint dstX0,GLint dstY0,GLint dstX1,GLint dstY1,GLbitfield mask,GLenum filter)1935 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) 1936 { 1937 BlitFramebuffer = (PFNBLITFRAMEBUFFERPROC)IntGetProcAddress("glBlitFramebuffer"); 1938 BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); 1939 } 1940 Switch_RenderbufferStorageMultisample(GLenum target,GLsizei samples,GLenum internalformat,GLsizei width,GLsizei height)1941 static void CODEGEN_FUNCPTR Switch_RenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) 1942 { 1943 RenderbufferStorageMultisample = (PFNRENDERBUFFERSTORAGEMULTISAMPLEPROC)IntGetProcAddress("glRenderbufferStorageMultisample"); 1944 RenderbufferStorageMultisample(target, samples, internalformat, width, height); 1945 } 1946 Switch_FramebufferTextureLayer(GLenum target,GLenum attachment,GLuint texture,GLint level,GLint layer)1947 static void CODEGEN_FUNCPTR Switch_FramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) 1948 { 1949 FramebufferTextureLayer = (PFNFRAMEBUFFERTEXTURELAYERPROC)IntGetProcAddress("glFramebufferTextureLayer"); 1950 FramebufferTextureLayer(target, attachment, texture, level, layer); 1951 } 1952 1953 // Extension: 3.0 1954 Switch_ColorMaski(GLuint index,GLboolean r,GLboolean g,GLboolean b,GLboolean a)1955 static void CODEGEN_FUNCPTR Switch_ColorMaski(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a) 1956 { 1957 ColorMaski = (PFNCOLORMASKIPROC)IntGetProcAddress("glColorMaski"); 1958 ColorMaski(index, r, g, b, a); 1959 } 1960 Switch_GetBooleani_v(GLenum target,GLuint index,GLboolean * data)1961 static void CODEGEN_FUNCPTR Switch_GetBooleani_v(GLenum target, GLuint index, GLboolean *data) 1962 { 1963 GetBooleani_v = (PFNGETBOOLEANI_VPROC)IntGetProcAddress("glGetBooleani_v"); 1964 GetBooleani_v(target, index, data); 1965 } 1966 Switch_GetIntegeri_v(GLenum target,GLuint index,GLint * data)1967 static void CODEGEN_FUNCPTR Switch_GetIntegeri_v(GLenum target, GLuint index, GLint *data) 1968 { 1969 GetIntegeri_v = (PFNGETINTEGERI_VPROC)IntGetProcAddress("glGetIntegeri_v"); 1970 GetIntegeri_v(target, index, data); 1971 } 1972 Switch_Enablei(GLenum target,GLuint index)1973 static void CODEGEN_FUNCPTR Switch_Enablei(GLenum target, GLuint index) 1974 { 1975 Enablei = (PFNENABLEIPROC)IntGetProcAddress("glEnablei"); 1976 Enablei(target, index); 1977 } 1978 Switch_Disablei(GLenum target,GLuint index)1979 static void CODEGEN_FUNCPTR Switch_Disablei(GLenum target, GLuint index) 1980 { 1981 Disablei = (PFNDISABLEIPROC)IntGetProcAddress("glDisablei"); 1982 Disablei(target, index); 1983 } 1984 Switch_IsEnabledi(GLenum target,GLuint index)1985 static GLboolean CODEGEN_FUNCPTR Switch_IsEnabledi(GLenum target, GLuint index) 1986 { 1987 IsEnabledi = (PFNISENABLEDIPROC)IntGetProcAddress("glIsEnabledi"); 1988 return IsEnabledi(target, index); 1989 } 1990 Switch_BeginTransformFeedback(GLenum primitiveMode)1991 static void CODEGEN_FUNCPTR Switch_BeginTransformFeedback(GLenum primitiveMode) 1992 { 1993 BeginTransformFeedback = (PFNBEGINTRANSFORMFEEDBACKPROC)IntGetProcAddress("glBeginTransformFeedback"); 1994 BeginTransformFeedback(primitiveMode); 1995 } 1996 Switch_EndTransformFeedback()1997 static void CODEGEN_FUNCPTR Switch_EndTransformFeedback() 1998 { 1999 EndTransformFeedback = (PFNENDTRANSFORMFEEDBACKPROC)IntGetProcAddress("glEndTransformFeedback"); 2000 EndTransformFeedback(); 2001 } 2002 Switch_BindBufferRange(GLenum target,GLuint index,GLuint buffer,GLintptr offset,GLsizeiptr size)2003 static void CODEGEN_FUNCPTR Switch_BindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) 2004 { 2005 BindBufferRange = (PFNBINDBUFFERRANGEPROC)IntGetProcAddress("glBindBufferRange"); 2006 BindBufferRange(target, index, buffer, offset, size); 2007 } 2008 Switch_BindBufferBase(GLenum target,GLuint index,GLuint buffer)2009 static void CODEGEN_FUNCPTR Switch_BindBufferBase(GLenum target, GLuint index, GLuint buffer) 2010 { 2011 BindBufferBase = (PFNBINDBUFFERBASEPROC)IntGetProcAddress("glBindBufferBase"); 2012 BindBufferBase(target, index, buffer); 2013 } 2014 Switch_TransformFeedbackVaryings(GLuint program,GLsizei count,const GLchar * const * varyings,GLenum bufferMode)2015 static void CODEGEN_FUNCPTR Switch_TransformFeedbackVaryings(GLuint program, GLsizei count, const GLchar* const *varyings, GLenum bufferMode) 2016 { 2017 TransformFeedbackVaryings = (PFNTRANSFORMFEEDBACKVARYINGSPROC)IntGetProcAddress("glTransformFeedbackVaryings"); 2018 TransformFeedbackVaryings(program, count, varyings, bufferMode); 2019 } 2020 Switch_GetTransformFeedbackVarying(GLuint program,GLuint index,GLsizei bufSize,GLsizei * length,GLsizei * size,GLenum * type,GLchar * name)2021 static void CODEGEN_FUNCPTR Switch_GetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name) 2022 { 2023 GetTransformFeedbackVarying = (PFNGETTRANSFORMFEEDBACKVARYINGPROC)IntGetProcAddress("glGetTransformFeedbackVarying"); 2024 GetTransformFeedbackVarying(program, index, bufSize, length, size, type, name); 2025 } 2026 Switch_ClampColor(GLenum target,GLenum clamp)2027 static void CODEGEN_FUNCPTR Switch_ClampColor(GLenum target, GLenum clamp) 2028 { 2029 ClampColor = (PFNCLAMPCOLORPROC)IntGetProcAddress("glClampColor"); 2030 ClampColor(target, clamp); 2031 } 2032 Switch_BeginConditionalRender(GLuint id,GLenum mode)2033 static void CODEGEN_FUNCPTR Switch_BeginConditionalRender(GLuint id, GLenum mode) 2034 { 2035 BeginConditionalRender = (PFNBEGINCONDITIONALRENDERPROC)IntGetProcAddress("glBeginConditionalRender"); 2036 BeginConditionalRender(id, mode); 2037 } 2038 Switch_EndConditionalRender()2039 static void CODEGEN_FUNCPTR Switch_EndConditionalRender() 2040 { 2041 EndConditionalRender = (PFNENDCONDITIONALRENDERPROC)IntGetProcAddress("glEndConditionalRender"); 2042 EndConditionalRender(); 2043 } 2044 Switch_VertexAttribIPointer(GLuint index,GLint size,GLenum type,GLsizei stride,const GLvoid * pointer)2045 static void CODEGEN_FUNCPTR Switch_VertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) 2046 { 2047 VertexAttribIPointer = (PFNVERTEXATTRIBIPOINTERPROC)IntGetProcAddress("glVertexAttribIPointer"); 2048 VertexAttribIPointer(index, size, type, stride, pointer); 2049 } 2050 Switch_GetVertexAttribIiv(GLuint index,GLenum pname,GLint * params)2051 static void CODEGEN_FUNCPTR Switch_GetVertexAttribIiv(GLuint index, GLenum pname, GLint *params) 2052 { 2053 GetVertexAttribIiv = (PFNGETVERTEXATTRIBIIVPROC)IntGetProcAddress("glGetVertexAttribIiv"); 2054 GetVertexAttribIiv(index, pname, params); 2055 } 2056 Switch_GetVertexAttribIuiv(GLuint index,GLenum pname,GLuint * params)2057 static void CODEGEN_FUNCPTR Switch_GetVertexAttribIuiv(GLuint index, GLenum pname, GLuint *params) 2058 { 2059 GetVertexAttribIuiv = (PFNGETVERTEXATTRIBIUIVPROC)IntGetProcAddress("glGetVertexAttribIuiv"); 2060 GetVertexAttribIuiv(index, pname, params); 2061 } 2062 Switch_VertexAttribI1i(GLuint index,GLint x)2063 static void CODEGEN_FUNCPTR Switch_VertexAttribI1i(GLuint index, GLint x) 2064 { 2065 VertexAttribI1i = (PFNVERTEXATTRIBI1IPROC)IntGetProcAddress("glVertexAttribI1i"); 2066 VertexAttribI1i(index, x); 2067 } 2068 Switch_VertexAttribI2i(GLuint index,GLint x,GLint y)2069 static void CODEGEN_FUNCPTR Switch_VertexAttribI2i(GLuint index, GLint x, GLint y) 2070 { 2071 VertexAttribI2i = (PFNVERTEXATTRIBI2IPROC)IntGetProcAddress("glVertexAttribI2i"); 2072 VertexAttribI2i(index, x, y); 2073 } 2074 Switch_VertexAttribI3i(GLuint index,GLint x,GLint y,GLint z)2075 static void CODEGEN_FUNCPTR Switch_VertexAttribI3i(GLuint index, GLint x, GLint y, GLint z) 2076 { 2077 VertexAttribI3i = (PFNVERTEXATTRIBI3IPROC)IntGetProcAddress("glVertexAttribI3i"); 2078 VertexAttribI3i(index, x, y, z); 2079 } 2080 Switch_VertexAttribI4i(GLuint index,GLint x,GLint y,GLint z,GLint w)2081 static void CODEGEN_FUNCPTR Switch_VertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w) 2082 { 2083 VertexAttribI4i = (PFNVERTEXATTRIBI4IPROC)IntGetProcAddress("glVertexAttribI4i"); 2084 VertexAttribI4i(index, x, y, z, w); 2085 } 2086 Switch_VertexAttribI1ui(GLuint index,GLuint x)2087 static void CODEGEN_FUNCPTR Switch_VertexAttribI1ui(GLuint index, GLuint x) 2088 { 2089 VertexAttribI1ui = (PFNVERTEXATTRIBI1UIPROC)IntGetProcAddress("glVertexAttribI1ui"); 2090 VertexAttribI1ui(index, x); 2091 } 2092 Switch_VertexAttribI2ui(GLuint index,GLuint x,GLuint y)2093 static void CODEGEN_FUNCPTR Switch_VertexAttribI2ui(GLuint index, GLuint x, GLuint y) 2094 { 2095 VertexAttribI2ui = (PFNVERTEXATTRIBI2UIPROC)IntGetProcAddress("glVertexAttribI2ui"); 2096 VertexAttribI2ui(index, x, y); 2097 } 2098 Switch_VertexAttribI3ui(GLuint index,GLuint x,GLuint y,GLuint z)2099 static void CODEGEN_FUNCPTR Switch_VertexAttribI3ui(GLuint index, GLuint x, GLuint y, GLuint z) 2100 { 2101 VertexAttribI3ui = (PFNVERTEXATTRIBI3UIPROC)IntGetProcAddress("glVertexAttribI3ui"); 2102 VertexAttribI3ui(index, x, y, z); 2103 } 2104 Switch_VertexAttribI4ui(GLuint index,GLuint x,GLuint y,GLuint z,GLuint w)2105 static void CODEGEN_FUNCPTR Switch_VertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) 2106 { 2107 VertexAttribI4ui = (PFNVERTEXATTRIBI4UIPROC)IntGetProcAddress("glVertexAttribI4ui"); 2108 VertexAttribI4ui(index, x, y, z, w); 2109 } 2110 Switch_VertexAttribI1iv(GLuint index,const GLint * v)2111 static void CODEGEN_FUNCPTR Switch_VertexAttribI1iv(GLuint index, const GLint *v) 2112 { 2113 VertexAttribI1iv = (PFNVERTEXATTRIBI1IVPROC)IntGetProcAddress("glVertexAttribI1iv"); 2114 VertexAttribI1iv(index, v); 2115 } 2116 Switch_VertexAttribI2iv(GLuint index,const GLint * v)2117 static void CODEGEN_FUNCPTR Switch_VertexAttribI2iv(GLuint index, const GLint *v) 2118 { 2119 VertexAttribI2iv = (PFNVERTEXATTRIBI2IVPROC)IntGetProcAddress("glVertexAttribI2iv"); 2120 VertexAttribI2iv(index, v); 2121 } 2122 Switch_VertexAttribI3iv(GLuint index,const GLint * v)2123 static void CODEGEN_FUNCPTR Switch_VertexAttribI3iv(GLuint index, const GLint *v) 2124 { 2125 VertexAttribI3iv = (PFNVERTEXATTRIBI3IVPROC)IntGetProcAddress("glVertexAttribI3iv"); 2126 VertexAttribI3iv(index, v); 2127 } 2128 Switch_VertexAttribI4iv(GLuint index,const GLint * v)2129 static void CODEGEN_FUNCPTR Switch_VertexAttribI4iv(GLuint index, const GLint *v) 2130 { 2131 VertexAttribI4iv = (PFNVERTEXATTRIBI4IVPROC)IntGetProcAddress("glVertexAttribI4iv"); 2132 VertexAttribI4iv(index, v); 2133 } 2134 Switch_VertexAttribI1uiv(GLuint index,const GLuint * v)2135 static void CODEGEN_FUNCPTR Switch_VertexAttribI1uiv(GLuint index, const GLuint *v) 2136 { 2137 VertexAttribI1uiv = (PFNVERTEXATTRIBI1UIVPROC)IntGetProcAddress("glVertexAttribI1uiv"); 2138 VertexAttribI1uiv(index, v); 2139 } 2140 Switch_VertexAttribI2uiv(GLuint index,const GLuint * v)2141 static void CODEGEN_FUNCPTR Switch_VertexAttribI2uiv(GLuint index, const GLuint *v) 2142 { 2143 VertexAttribI2uiv = (PFNVERTEXATTRIBI2UIVPROC)IntGetProcAddress("glVertexAttribI2uiv"); 2144 VertexAttribI2uiv(index, v); 2145 } 2146 Switch_VertexAttribI3uiv(GLuint index,const GLuint * v)2147 static void CODEGEN_FUNCPTR Switch_VertexAttribI3uiv(GLuint index, const GLuint *v) 2148 { 2149 VertexAttribI3uiv = (PFNVERTEXATTRIBI3UIVPROC)IntGetProcAddress("glVertexAttribI3uiv"); 2150 VertexAttribI3uiv(index, v); 2151 } 2152 Switch_VertexAttribI4uiv(GLuint index,const GLuint * v)2153 static void CODEGEN_FUNCPTR Switch_VertexAttribI4uiv(GLuint index, const GLuint *v) 2154 { 2155 VertexAttribI4uiv = (PFNVERTEXATTRIBI4UIVPROC)IntGetProcAddress("glVertexAttribI4uiv"); 2156 VertexAttribI4uiv(index, v); 2157 } 2158 Switch_VertexAttribI4bv(GLuint index,const GLbyte * v)2159 static void CODEGEN_FUNCPTR Switch_VertexAttribI4bv(GLuint index, const GLbyte *v) 2160 { 2161 VertexAttribI4bv = (PFNVERTEXATTRIBI4BVPROC)IntGetProcAddress("glVertexAttribI4bv"); 2162 VertexAttribI4bv(index, v); 2163 } 2164 Switch_VertexAttribI4sv(GLuint index,const GLshort * v)2165 static void CODEGEN_FUNCPTR Switch_VertexAttribI4sv(GLuint index, const GLshort *v) 2166 { 2167 VertexAttribI4sv = (PFNVERTEXATTRIBI4SVPROC)IntGetProcAddress("glVertexAttribI4sv"); 2168 VertexAttribI4sv(index, v); 2169 } 2170 Switch_VertexAttribI4ubv(GLuint index,const GLubyte * v)2171 static void CODEGEN_FUNCPTR Switch_VertexAttribI4ubv(GLuint index, const GLubyte *v) 2172 { 2173 VertexAttribI4ubv = (PFNVERTEXATTRIBI4UBVPROC)IntGetProcAddress("glVertexAttribI4ubv"); 2174 VertexAttribI4ubv(index, v); 2175 } 2176 Switch_VertexAttribI4usv(GLuint index,const GLushort * v)2177 static void CODEGEN_FUNCPTR Switch_VertexAttribI4usv(GLuint index, const GLushort *v) 2178 { 2179 VertexAttribI4usv = (PFNVERTEXATTRIBI4USVPROC)IntGetProcAddress("glVertexAttribI4usv"); 2180 VertexAttribI4usv(index, v); 2181 } 2182 Switch_GetUniformuiv(GLuint program,GLint location,GLuint * params)2183 static void CODEGEN_FUNCPTR Switch_GetUniformuiv(GLuint program, GLint location, GLuint *params) 2184 { 2185 GetUniformuiv = (PFNGETUNIFORMUIVPROC)IntGetProcAddress("glGetUniformuiv"); 2186 GetUniformuiv(program, location, params); 2187 } 2188 Switch_BindFragDataLocation(GLuint program,GLuint color,const GLchar * name)2189 static void CODEGEN_FUNCPTR Switch_BindFragDataLocation(GLuint program, GLuint color, const GLchar *name) 2190 { 2191 BindFragDataLocation = (PFNBINDFRAGDATALOCATIONPROC)IntGetProcAddress("glBindFragDataLocation"); 2192 BindFragDataLocation(program, color, name); 2193 } 2194 Switch_GetFragDataLocation(GLuint program,const GLchar * name)2195 static GLint CODEGEN_FUNCPTR Switch_GetFragDataLocation(GLuint program, const GLchar *name) 2196 { 2197 GetFragDataLocation = (PFNGETFRAGDATALOCATIONPROC)IntGetProcAddress("glGetFragDataLocation"); 2198 return GetFragDataLocation(program, name); 2199 } 2200 Switch_Uniform1ui(GLint location,GLuint v0)2201 static void CODEGEN_FUNCPTR Switch_Uniform1ui(GLint location, GLuint v0) 2202 { 2203 Uniform1ui = (PFNUNIFORM1UIPROC)IntGetProcAddress("glUniform1ui"); 2204 Uniform1ui(location, v0); 2205 } 2206 Switch_Uniform2ui(GLint location,GLuint v0,GLuint v1)2207 static void CODEGEN_FUNCPTR Switch_Uniform2ui(GLint location, GLuint v0, GLuint v1) 2208 { 2209 Uniform2ui = (PFNUNIFORM2UIPROC)IntGetProcAddress("glUniform2ui"); 2210 Uniform2ui(location, v0, v1); 2211 } 2212 Switch_Uniform3ui(GLint location,GLuint v0,GLuint v1,GLuint v2)2213 static void CODEGEN_FUNCPTR Switch_Uniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2) 2214 { 2215 Uniform3ui = (PFNUNIFORM3UIPROC)IntGetProcAddress("glUniform3ui"); 2216 Uniform3ui(location, v0, v1, v2); 2217 } 2218 Switch_Uniform4ui(GLint location,GLuint v0,GLuint v1,GLuint v2,GLuint v3)2219 static void CODEGEN_FUNCPTR Switch_Uniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) 2220 { 2221 Uniform4ui = (PFNUNIFORM4UIPROC)IntGetProcAddress("glUniform4ui"); 2222 Uniform4ui(location, v0, v1, v2, v3); 2223 } 2224 Switch_Uniform1uiv(GLint location,GLsizei count,const GLuint * value)2225 static void CODEGEN_FUNCPTR Switch_Uniform1uiv(GLint location, GLsizei count, const GLuint *value) 2226 { 2227 Uniform1uiv = (PFNUNIFORM1UIVPROC)IntGetProcAddress("glUniform1uiv"); 2228 Uniform1uiv(location, count, value); 2229 } 2230 Switch_Uniform2uiv(GLint location,GLsizei count,const GLuint * value)2231 static void CODEGEN_FUNCPTR Switch_Uniform2uiv(GLint location, GLsizei count, const GLuint *value) 2232 { 2233 Uniform2uiv = (PFNUNIFORM2UIVPROC)IntGetProcAddress("glUniform2uiv"); 2234 Uniform2uiv(location, count, value); 2235 } 2236 Switch_Uniform3uiv(GLint location,GLsizei count,const GLuint * value)2237 static void CODEGEN_FUNCPTR Switch_Uniform3uiv(GLint location, GLsizei count, const GLuint *value) 2238 { 2239 Uniform3uiv = (PFNUNIFORM3UIVPROC)IntGetProcAddress("glUniform3uiv"); 2240 Uniform3uiv(location, count, value); 2241 } 2242 Switch_Uniform4uiv(GLint location,GLsizei count,const GLuint * value)2243 static void CODEGEN_FUNCPTR Switch_Uniform4uiv(GLint location, GLsizei count, const GLuint *value) 2244 { 2245 Uniform4uiv = (PFNUNIFORM4UIVPROC)IntGetProcAddress("glUniform4uiv"); 2246 Uniform4uiv(location, count, value); 2247 } 2248 Switch_TexParameterIiv(GLenum target,GLenum pname,const GLint * params)2249 static void CODEGEN_FUNCPTR Switch_TexParameterIiv(GLenum target, GLenum pname, const GLint *params) 2250 { 2251 TexParameterIiv = (PFNTEXPARAMETERIIVPROC)IntGetProcAddress("glTexParameterIiv"); 2252 TexParameterIiv(target, pname, params); 2253 } 2254 Switch_TexParameterIuiv(GLenum target,GLenum pname,const GLuint * params)2255 static void CODEGEN_FUNCPTR Switch_TexParameterIuiv(GLenum target, GLenum pname, const GLuint *params) 2256 { 2257 TexParameterIuiv = (PFNTEXPARAMETERIUIVPROC)IntGetProcAddress("glTexParameterIuiv"); 2258 TexParameterIuiv(target, pname, params); 2259 } 2260 Switch_GetTexParameterIiv(GLenum target,GLenum pname,GLint * params)2261 static void CODEGEN_FUNCPTR Switch_GetTexParameterIiv(GLenum target, GLenum pname, GLint *params) 2262 { 2263 GetTexParameterIiv = (PFNGETTEXPARAMETERIIVPROC)IntGetProcAddress("glGetTexParameterIiv"); 2264 GetTexParameterIiv(target, pname, params); 2265 } 2266 Switch_GetTexParameterIuiv(GLenum target,GLenum pname,GLuint * params)2267 static void CODEGEN_FUNCPTR Switch_GetTexParameterIuiv(GLenum target, GLenum pname, GLuint *params) 2268 { 2269 GetTexParameterIuiv = (PFNGETTEXPARAMETERIUIVPROC)IntGetProcAddress("glGetTexParameterIuiv"); 2270 GetTexParameterIuiv(target, pname, params); 2271 } 2272 Switch_ClearBufferiv(GLenum buffer,GLint drawbuffer,const GLint * value)2273 static void CODEGEN_FUNCPTR Switch_ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *value) 2274 { 2275 ClearBufferiv = (PFNCLEARBUFFERIVPROC)IntGetProcAddress("glClearBufferiv"); 2276 ClearBufferiv(buffer, drawbuffer, value); 2277 } 2278 Switch_ClearBufferuiv(GLenum buffer,GLint drawbuffer,const GLuint * value)2279 static void CODEGEN_FUNCPTR Switch_ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint *value) 2280 { 2281 ClearBufferuiv = (PFNCLEARBUFFERUIVPROC)IntGetProcAddress("glClearBufferuiv"); 2282 ClearBufferuiv(buffer, drawbuffer, value); 2283 } 2284 Switch_ClearBufferfv(GLenum buffer,GLint drawbuffer,const GLfloat * value)2285 static void CODEGEN_FUNCPTR Switch_ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *value) 2286 { 2287 ClearBufferfv = (PFNCLEARBUFFERFVPROC)IntGetProcAddress("glClearBufferfv"); 2288 ClearBufferfv(buffer, drawbuffer, value); 2289 } 2290 Switch_ClearBufferfi(GLenum buffer,GLint drawbuffer,GLfloat depth,GLint stencil)2291 static void CODEGEN_FUNCPTR Switch_ClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil) 2292 { 2293 ClearBufferfi = (PFNCLEARBUFFERFIPROC)IntGetProcAddress("glClearBufferfi"); 2294 ClearBufferfi(buffer, drawbuffer, depth, stencil); 2295 } 2296 Switch_GetStringi(GLenum name,GLuint index)2297 static const GLubyte * CODEGEN_FUNCPTR Switch_GetStringi(GLenum name, GLuint index) 2298 { 2299 GetStringi = (PFNGETSTRINGIPROC)IntGetProcAddress("glGetStringi"); 2300 return GetStringi(name, index); 2301 } 2302 2303 // Extension: ARB_uniform_buffer_object 2304 Switch_GetUniformIndices(GLuint program,GLsizei uniformCount,const GLchar * const * uniformNames,GLuint * uniformIndices)2305 static void CODEGEN_FUNCPTR Switch_GetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar* const *uniformNames, GLuint *uniformIndices) 2306 { 2307 GetUniformIndices = (PFNGETUNIFORMINDICESPROC)IntGetProcAddress("glGetUniformIndices"); 2308 GetUniformIndices(program, uniformCount, uniformNames, uniformIndices); 2309 } 2310 Switch_GetActiveUniformsiv(GLuint program,GLsizei uniformCount,const GLuint * uniformIndices,GLenum pname,GLint * params)2311 static void CODEGEN_FUNCPTR Switch_GetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params) 2312 { 2313 GetActiveUniformsiv = (PFNGETACTIVEUNIFORMSIVPROC)IntGetProcAddress("glGetActiveUniformsiv"); 2314 GetActiveUniformsiv(program, uniformCount, uniformIndices, pname, params); 2315 } 2316 Switch_GetActiveUniformName(GLuint program,GLuint uniformIndex,GLsizei bufSize,GLsizei * length,GLchar * uniformName)2317 static void CODEGEN_FUNCPTR Switch_GetActiveUniformName(GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName) 2318 { 2319 GetActiveUniformName = (PFNGETACTIVEUNIFORMNAMEPROC)IntGetProcAddress("glGetActiveUniformName"); 2320 GetActiveUniformName(program, uniformIndex, bufSize, length, uniformName); 2321 } 2322 Switch_GetUniformBlockIndex(GLuint program,const GLchar * uniformBlockName)2323 static GLuint CODEGEN_FUNCPTR Switch_GetUniformBlockIndex(GLuint program, const GLchar *uniformBlockName) 2324 { 2325 GetUniformBlockIndex = (PFNGETUNIFORMBLOCKINDEXPROC)IntGetProcAddress("glGetUniformBlockIndex"); 2326 return GetUniformBlockIndex(program, uniformBlockName); 2327 } 2328 Switch_GetActiveUniformBlockiv(GLuint program,GLuint uniformBlockIndex,GLenum pname,GLint * params)2329 static void CODEGEN_FUNCPTR Switch_GetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params) 2330 { 2331 GetActiveUniformBlockiv = (PFNGETACTIVEUNIFORMBLOCKIVPROC)IntGetProcAddress("glGetActiveUniformBlockiv"); 2332 GetActiveUniformBlockiv(program, uniformBlockIndex, pname, params); 2333 } 2334 Switch_GetActiveUniformBlockName(GLuint program,GLuint uniformBlockIndex,GLsizei bufSize,GLsizei * length,GLchar * uniformBlockName)2335 static void CODEGEN_FUNCPTR Switch_GetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName) 2336 { 2337 GetActiveUniformBlockName = (PFNGETACTIVEUNIFORMBLOCKNAMEPROC)IntGetProcAddress("glGetActiveUniformBlockName"); 2338 GetActiveUniformBlockName(program, uniformBlockIndex, bufSize, length, uniformBlockName); 2339 } 2340 Switch_UniformBlockBinding(GLuint program,GLuint uniformBlockIndex,GLuint uniformBlockBinding)2341 static void CODEGEN_FUNCPTR Switch_UniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding) 2342 { 2343 UniformBlockBinding = (PFNUNIFORMBLOCKBINDINGPROC)IntGetProcAddress("glUniformBlockBinding"); 2344 UniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding); 2345 } 2346 2347 // Extension: ARB_copy_buffer 2348 Switch_CopyBufferSubData(GLenum readTarget,GLenum writeTarget,GLintptr readOffset,GLintptr writeOffset,GLsizeiptr size)2349 static void CODEGEN_FUNCPTR Switch_CopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size) 2350 { 2351 CopyBufferSubData = (PFNCOPYBUFFERSUBDATAPROC)IntGetProcAddress("glCopyBufferSubData"); 2352 CopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size); 2353 } 2354 2355 // Extension: 3.1 2356 Switch_DrawArraysInstanced(GLenum mode,GLint first,GLsizei count,GLsizei instancecount)2357 static void CODEGEN_FUNCPTR Switch_DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instancecount) 2358 { 2359 DrawArraysInstanced = (PFNDRAWARRAYSINSTANCEDPROC)IntGetProcAddress("glDrawArraysInstanced"); 2360 DrawArraysInstanced(mode, first, count, instancecount); 2361 } 2362 Switch_DrawElementsInstanced(GLenum mode,GLsizei count,GLenum type,const GLvoid * indices,GLsizei instancecount)2363 static void CODEGEN_FUNCPTR Switch_DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount) 2364 { 2365 DrawElementsInstanced = (PFNDRAWELEMENTSINSTANCEDPROC)IntGetProcAddress("glDrawElementsInstanced"); 2366 DrawElementsInstanced(mode, count, type, indices, instancecount); 2367 } 2368 Switch_TexBuffer(GLenum target,GLenum internalformat,GLuint buffer)2369 static void CODEGEN_FUNCPTR Switch_TexBuffer(GLenum target, GLenum internalformat, GLuint buffer) 2370 { 2371 TexBuffer = (PFNTEXBUFFERPROC)IntGetProcAddress("glTexBuffer"); 2372 TexBuffer(target, internalformat, buffer); 2373 } 2374 Switch_PrimitiveRestartIndex(GLuint index)2375 static void CODEGEN_FUNCPTR Switch_PrimitiveRestartIndex(GLuint index) 2376 { 2377 PrimitiveRestartIndex = (PFNPRIMITIVERESTARTINDEXPROC)IntGetProcAddress("glPrimitiveRestartIndex"); 2378 PrimitiveRestartIndex(index); 2379 } 2380 2381 // Legacy 2382 Switch_EnableClientState(GLenum cap)2383 static void CODEGEN_FUNCPTR Switch_EnableClientState(GLenum cap) 2384 { 2385 EnableClientState = (PFNENABLECLIENTSTATEPROC)IntGetProcAddress("glEnableClientState"); 2386 EnableClientState(cap); 2387 } 2388 Switch_DisableClientState(GLenum cap)2389 static void CODEGEN_FUNCPTR Switch_DisableClientState(GLenum cap) 2390 { 2391 DisableClientState = (PFNDISABLECLIENTSTATEPROC)IntGetProcAddress("glDisableClientState"); 2392 DisableClientState(cap); 2393 } 2394 Switch_VertexPointer(GLint size,GLenum type,GLsizei stride,const GLvoid * ptr)2395 static void CODEGEN_FUNCPTR Switch_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) 2396 { 2397 VertexPointer = (PFNVERTEXPOINTERPROC)IntGetProcAddress("glVertexPointer"); 2398 VertexPointer(size, type, stride, ptr); 2399 } 2400 Switch_NormalPointer(GLenum type,GLsizei stride,const GLvoid * ptr)2401 static void CODEGEN_FUNCPTR Switch_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr) 2402 { 2403 NormalPointer = (PFNNORMALPOINTERPROC)IntGetProcAddress("glNormalPointer"); 2404 NormalPointer(type, stride, ptr); 2405 } 2406 Switch_ColorPointer(GLint size,GLenum type,GLsizei stride,const GLvoid * ptr)2407 static void CODEGEN_FUNCPTR Switch_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) 2408 { 2409 ColorPointer = (PFNCOLORPOINTERPROC)IntGetProcAddress("glColorPointer"); 2410 ColorPointer(size, type, stride, ptr); 2411 } 2412 Switch_TexCoordPointer(GLint size,GLenum type,GLsizei stride,const GLvoid * ptr)2413 static void CODEGEN_FUNCPTR Switch_TexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) 2414 { 2415 TexCoordPointer = (PFNTEXCOORDPOINTERPROC)IntGetProcAddress("glTexCoordPointer"); 2416 TexCoordPointer(size, type, stride, ptr); 2417 } 2418 Switch_TexEnvi(GLenum target,GLenum pname,GLint param)2419 static void CODEGEN_FUNCPTR Switch_TexEnvi(GLenum target, GLenum pname, GLint param) 2420 { 2421 TexEnvi = (PFNTEXENVIPROC)IntGetProcAddress("glTexEnvi"); 2422 TexEnvi(target, pname, param); 2423 } 2424 Switch_MatrixMode(GLenum mode)2425 static void CODEGEN_FUNCPTR Switch_MatrixMode(GLenum mode) 2426 { 2427 MatrixMode = (PFNMATRIXMODEPROC)IntGetProcAddress("glMatrixMode"); 2428 MatrixMode(mode); 2429 } 2430 Switch_LoadIdentity(void)2431 static void CODEGEN_FUNCPTR Switch_LoadIdentity(void) 2432 { 2433 LoadIdentity = (PFNLOADIDENTITYPROC)IntGetProcAddress("glLoadIdentity"); 2434 LoadIdentity(); 2435 } 2436 Switch_Ortho(GLdouble left,GLdouble right,GLdouble bottom,GLdouble top,GLdouble near_val,GLdouble far_val)2437 static void CODEGEN_FUNCPTR Switch_Ortho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val) 2438 { 2439 Ortho = (PFNORTHOPROC)IntGetProcAddress("glOrtho"); 2440 Ortho(left, right, bottom, top, near_val, far_val); 2441 } 2442 Switch_Color3d(GLdouble red,GLdouble green,GLdouble blue)2443 static void CODEGEN_FUNCPTR Switch_Color3d(GLdouble red, GLdouble green, GLdouble blue) 2444 { 2445 Color3d = (PFNCOLOR3DPROC)IntGetProcAddress("glColor3d"); 2446 Color3d(red, green, blue); 2447 } 2448 2449 struct InitializeVariables 2450 { InitializeVariablesgl::InitializeVariables2451 InitializeVariables() 2452 { 2453 // Extension: 1.1 2454 CullFace = Switch_CullFace; 2455 FrontFace = Switch_FrontFace; 2456 Hint = Switch_Hint; 2457 LineWidth = Switch_LineWidth; 2458 PointSize = Switch_PointSize; 2459 PolygonMode = Switch_PolygonMode; 2460 Scissor = Switch_Scissor; 2461 TexParameterf = Switch_TexParameterf; 2462 TexParameterfv = Switch_TexParameterfv; 2463 TexParameteri = Switch_TexParameteri; 2464 TexParameteriv = Switch_TexParameteriv; 2465 TexImage1D = Switch_TexImage1D; 2466 TexImage2D = Switch_TexImage2D; 2467 DrawBuffer = Switch_DrawBuffer; 2468 Clear = Switch_Clear; 2469 ClearColor = Switch_ClearColor; 2470 ClearStencil = Switch_ClearStencil; 2471 ClearDepth = Switch_ClearDepth; 2472 StencilMask = Switch_StencilMask; 2473 ColorMask = Switch_ColorMask; 2474 DepthMask = Switch_DepthMask; 2475 Disable = Switch_Disable; 2476 Enable = Switch_Enable; 2477 Finish = Switch_Finish; 2478 Flush = Switch_Flush; 2479 BlendFunc = Switch_BlendFunc; 2480 LogicOp = Switch_LogicOp; 2481 StencilFunc = Switch_StencilFunc; 2482 StencilOp = Switch_StencilOp; 2483 DepthFunc = Switch_DepthFunc; 2484 PixelStoref = Switch_PixelStoref; 2485 PixelStorei = Switch_PixelStorei; 2486 ReadBuffer = Switch_ReadBuffer; 2487 ReadPixels = Switch_ReadPixels; 2488 GetBooleanv = Switch_GetBooleanv; 2489 GetDoublev = Switch_GetDoublev; 2490 GetError = Switch_GetError; 2491 GetFloatv = Switch_GetFloatv; 2492 GetIntegerv = Switch_GetIntegerv; 2493 GetString = Switch_GetString; 2494 GetTexImage = Switch_GetTexImage; 2495 GetTexParameterfv = Switch_GetTexParameterfv; 2496 GetTexParameteriv = Switch_GetTexParameteriv; 2497 GetTexLevelParameterfv = Switch_GetTexLevelParameterfv; 2498 GetTexLevelParameteriv = Switch_GetTexLevelParameteriv; 2499 IsEnabled = Switch_IsEnabled; 2500 DepthRange = Switch_DepthRange; 2501 Viewport = Switch_Viewport; 2502 DrawArrays = Switch_DrawArrays; 2503 DrawElements = Switch_DrawElements; 2504 GetPointerv = Switch_GetPointerv; 2505 PolygonOffset = Switch_PolygonOffset; 2506 CopyTexImage1D = Switch_CopyTexImage1D; 2507 CopyTexImage2D = Switch_CopyTexImage2D; 2508 CopyTexSubImage1D = Switch_CopyTexSubImage1D; 2509 CopyTexSubImage2D = Switch_CopyTexSubImage2D; 2510 TexSubImage1D = Switch_TexSubImage1D; 2511 TexSubImage2D = Switch_TexSubImage2D; 2512 BindTexture = Switch_BindTexture; 2513 DeleteTextures = Switch_DeleteTextures; 2514 GenTextures = Switch_GenTextures; 2515 IsTexture = Switch_IsTexture; 2516 Indexub = Switch_Indexub; 2517 Indexubv = Switch_Indexubv; 2518 2519 // Extension: 1.2 2520 BlendColor = Switch_BlendColor; 2521 BlendEquation = Switch_BlendEquation; 2522 DrawRangeElements = Switch_DrawRangeElements; 2523 TexSubImage3D = Switch_TexSubImage3D; 2524 CopyTexSubImage3D = Switch_CopyTexSubImage3D; 2525 2526 // Extension: 1.3 2527 ActiveTexture = Switch_ActiveTexture; 2528 SampleCoverage = Switch_SampleCoverage; 2529 CompressedTexImage3D = Switch_CompressedTexImage3D; 2530 CompressedTexImage2D = Switch_CompressedTexImage2D; 2531 CompressedTexImage1D = Switch_CompressedTexImage1D; 2532 CompressedTexSubImage3D = Switch_CompressedTexSubImage3D; 2533 CompressedTexSubImage2D = Switch_CompressedTexSubImage2D; 2534 CompressedTexSubImage1D = Switch_CompressedTexSubImage1D; 2535 GetCompressedTexImage = Switch_GetCompressedTexImage; 2536 2537 // Extension: 1.4 2538 BlendFuncSeparate = Switch_BlendFuncSeparate; 2539 MultiDrawArrays = Switch_MultiDrawArrays; 2540 MultiDrawElements = Switch_MultiDrawElements; 2541 PointParameterf = Switch_PointParameterf; 2542 PointParameterfv = Switch_PointParameterfv; 2543 PointParameteri = Switch_PointParameteri; 2544 PointParameteriv = Switch_PointParameteriv; 2545 2546 // Extension: 1.5 2547 GenQueries = Switch_GenQueries; 2548 DeleteQueries = Switch_DeleteQueries; 2549 IsQuery = Switch_IsQuery; 2550 BeginQuery = Switch_BeginQuery; 2551 EndQuery = Switch_EndQuery; 2552 GetQueryiv = Switch_GetQueryiv; 2553 GetQueryObjectiv = Switch_GetQueryObjectiv; 2554 GetQueryObjectuiv = Switch_GetQueryObjectuiv; 2555 BindBuffer = Switch_BindBuffer; 2556 DeleteBuffers = Switch_DeleteBuffers; 2557 GenBuffers = Switch_GenBuffers; 2558 IsBuffer = Switch_IsBuffer; 2559 BufferData = Switch_BufferData; 2560 BufferSubData = Switch_BufferSubData; 2561 GetBufferSubData = Switch_GetBufferSubData; 2562 MapBuffer = Switch_MapBuffer; 2563 UnmapBuffer = Switch_UnmapBuffer; 2564 GetBufferParameteriv = Switch_GetBufferParameteriv; 2565 GetBufferPointerv = Switch_GetBufferPointerv; 2566 2567 // Extension: 2.0 2568 BlendEquationSeparate = Switch_BlendEquationSeparate; 2569 DrawBuffers = Switch_DrawBuffers; 2570 StencilOpSeparate = Switch_StencilOpSeparate; 2571 StencilFuncSeparate = Switch_StencilFuncSeparate; 2572 StencilMaskSeparate = Switch_StencilMaskSeparate; 2573 AttachShader = Switch_AttachShader; 2574 BindAttribLocation = Switch_BindAttribLocation; 2575 CompileShader = Switch_CompileShader; 2576 CreateProgram = Switch_CreateProgram; 2577 CreateShader = Switch_CreateShader; 2578 DeleteProgram = Switch_DeleteProgram; 2579 DeleteShader = Switch_DeleteShader; 2580 DetachShader = Switch_DetachShader; 2581 DisableVertexAttribArray = Switch_DisableVertexAttribArray; 2582 EnableVertexAttribArray = Switch_EnableVertexAttribArray; 2583 GetActiveAttrib = Switch_GetActiveAttrib; 2584 GetActiveUniform = Switch_GetActiveUniform; 2585 GetAttachedShaders = Switch_GetAttachedShaders; 2586 GetAttribLocation = Switch_GetAttribLocation; 2587 GetProgramiv = Switch_GetProgramiv; 2588 GetProgramInfoLog = Switch_GetProgramInfoLog; 2589 GetShaderiv = Switch_GetShaderiv; 2590 GetShaderInfoLog = Switch_GetShaderInfoLog; 2591 GetShaderSource = Switch_GetShaderSource; 2592 GetUniformLocation = Switch_GetUniformLocation; 2593 GetUniformfv = Switch_GetUniformfv; 2594 GetUniformiv = Switch_GetUniformiv; 2595 GetVertexAttribdv = Switch_GetVertexAttribdv; 2596 GetVertexAttribfv = Switch_GetVertexAttribfv; 2597 GetVertexAttribiv = Switch_GetVertexAttribiv; 2598 GetVertexAttribPointerv = Switch_GetVertexAttribPointerv; 2599 IsProgram = Switch_IsProgram; 2600 IsShader = Switch_IsShader; 2601 LinkProgram = Switch_LinkProgram; 2602 ShaderSource = Switch_ShaderSource; 2603 UseProgram = Switch_UseProgram; 2604 Uniform1f = Switch_Uniform1f; 2605 Uniform2f = Switch_Uniform2f; 2606 Uniform3f = Switch_Uniform3f; 2607 Uniform4f = Switch_Uniform4f; 2608 Uniform1i = Switch_Uniform1i; 2609 Uniform2i = Switch_Uniform2i; 2610 Uniform3i = Switch_Uniform3i; 2611 Uniform4i = Switch_Uniform4i; 2612 Uniform1fv = Switch_Uniform1fv; 2613 Uniform2fv = Switch_Uniform2fv; 2614 Uniform3fv = Switch_Uniform3fv; 2615 Uniform4fv = Switch_Uniform4fv; 2616 Uniform1iv = Switch_Uniform1iv; 2617 Uniform2iv = Switch_Uniform2iv; 2618 Uniform3iv = Switch_Uniform3iv; 2619 Uniform4iv = Switch_Uniform4iv; 2620 UniformMatrix2fv = Switch_UniformMatrix2fv; 2621 UniformMatrix3fv = Switch_UniformMatrix3fv; 2622 UniformMatrix4fv = Switch_UniformMatrix4fv; 2623 ValidateProgram = Switch_ValidateProgram; 2624 VertexAttribPointer = Switch_VertexAttribPointer; 2625 2626 // Extension: 2.1 2627 UniformMatrix2x3fv = Switch_UniformMatrix2x3fv; 2628 UniformMatrix3x2fv = Switch_UniformMatrix3x2fv; 2629 UniformMatrix2x4fv = Switch_UniformMatrix2x4fv; 2630 UniformMatrix4x2fv = Switch_UniformMatrix4x2fv; 2631 UniformMatrix3x4fv = Switch_UniformMatrix3x4fv; 2632 UniformMatrix4x3fv = Switch_UniformMatrix4x3fv; 2633 2634 // Extension: ARB_vertex_array_object 2635 BindVertexArray = Switch_BindVertexArray; 2636 DeleteVertexArrays = Switch_DeleteVertexArrays; 2637 GenVertexArrays = Switch_GenVertexArrays; 2638 IsVertexArray = Switch_IsVertexArray; 2639 2640 // Extension: ARB_map_buffer_range 2641 MapBufferRange = Switch_MapBufferRange; 2642 FlushMappedBufferRange = Switch_FlushMappedBufferRange; 2643 2644 // Extension: ARB_framebuffer_object 2645 IsRenderbuffer = Switch_IsRenderbuffer; 2646 BindRenderbuffer = Switch_BindRenderbuffer; 2647 DeleteRenderbuffers = Switch_DeleteRenderbuffers; 2648 GenRenderbuffers = Switch_GenRenderbuffers; 2649 RenderbufferStorage = Switch_RenderbufferStorage; 2650 GetRenderbufferParameteriv = Switch_GetRenderbufferParameteriv; 2651 IsFramebuffer = Switch_IsFramebuffer; 2652 BindFramebuffer = Switch_BindFramebuffer; 2653 DeleteFramebuffers = Switch_DeleteFramebuffers; 2654 GenFramebuffers = Switch_GenFramebuffers; 2655 CheckFramebufferStatus = Switch_CheckFramebufferStatus; 2656 FramebufferTexture1D = Switch_FramebufferTexture1D; 2657 FramebufferTexture2D = Switch_FramebufferTexture2D; 2658 FramebufferTexture3D = Switch_FramebufferTexture3D; 2659 FramebufferRenderbuffer = Switch_FramebufferRenderbuffer; 2660 GetFramebufferAttachmentParameteriv = Switch_GetFramebufferAttachmentParameteriv; 2661 GenerateMipmap = Switch_GenerateMipmap; 2662 BlitFramebuffer = Switch_BlitFramebuffer; 2663 RenderbufferStorageMultisample = Switch_RenderbufferStorageMultisample; 2664 FramebufferTextureLayer = Switch_FramebufferTextureLayer; 2665 2666 // Extension: 3.0 2667 ColorMaski = Switch_ColorMaski; 2668 GetBooleani_v = Switch_GetBooleani_v; 2669 GetIntegeri_v = Switch_GetIntegeri_v; 2670 Enablei = Switch_Enablei; 2671 Disablei = Switch_Disablei; 2672 IsEnabledi = Switch_IsEnabledi; 2673 BeginTransformFeedback = Switch_BeginTransformFeedback; 2674 EndTransformFeedback = Switch_EndTransformFeedback; 2675 BindBufferRange = Switch_BindBufferRange; 2676 BindBufferBase = Switch_BindBufferBase; 2677 TransformFeedbackVaryings = Switch_TransformFeedbackVaryings; 2678 GetTransformFeedbackVarying = Switch_GetTransformFeedbackVarying; 2679 ClampColor = Switch_ClampColor; 2680 BeginConditionalRender = Switch_BeginConditionalRender; 2681 EndConditionalRender = Switch_EndConditionalRender; 2682 VertexAttribIPointer = Switch_VertexAttribIPointer; 2683 GetVertexAttribIiv = Switch_GetVertexAttribIiv; 2684 GetVertexAttribIuiv = Switch_GetVertexAttribIuiv; 2685 VertexAttribI1i = Switch_VertexAttribI1i; 2686 VertexAttribI2i = Switch_VertexAttribI2i; 2687 VertexAttribI3i = Switch_VertexAttribI3i; 2688 VertexAttribI4i = Switch_VertexAttribI4i; 2689 VertexAttribI1ui = Switch_VertexAttribI1ui; 2690 VertexAttribI2ui = Switch_VertexAttribI2ui; 2691 VertexAttribI3ui = Switch_VertexAttribI3ui; 2692 VertexAttribI4ui = Switch_VertexAttribI4ui; 2693 VertexAttribI1iv = Switch_VertexAttribI1iv; 2694 VertexAttribI2iv = Switch_VertexAttribI2iv; 2695 VertexAttribI3iv = Switch_VertexAttribI3iv; 2696 VertexAttribI4iv = Switch_VertexAttribI4iv; 2697 VertexAttribI1uiv = Switch_VertexAttribI1uiv; 2698 VertexAttribI2uiv = Switch_VertexAttribI2uiv; 2699 VertexAttribI3uiv = Switch_VertexAttribI3uiv; 2700 VertexAttribI4uiv = Switch_VertexAttribI4uiv; 2701 VertexAttribI4bv = Switch_VertexAttribI4bv; 2702 VertexAttribI4sv = Switch_VertexAttribI4sv; 2703 VertexAttribI4ubv = Switch_VertexAttribI4ubv; 2704 VertexAttribI4usv = Switch_VertexAttribI4usv; 2705 GetUniformuiv = Switch_GetUniformuiv; 2706 BindFragDataLocation = Switch_BindFragDataLocation; 2707 GetFragDataLocation = Switch_GetFragDataLocation; 2708 Uniform1ui = Switch_Uniform1ui; 2709 Uniform2ui = Switch_Uniform2ui; 2710 Uniform3ui = Switch_Uniform3ui; 2711 Uniform4ui = Switch_Uniform4ui; 2712 Uniform1uiv = Switch_Uniform1uiv; 2713 Uniform2uiv = Switch_Uniform2uiv; 2714 Uniform3uiv = Switch_Uniform3uiv; 2715 Uniform4uiv = Switch_Uniform4uiv; 2716 TexParameterIiv = Switch_TexParameterIiv; 2717 TexParameterIuiv = Switch_TexParameterIuiv; 2718 GetTexParameterIiv = Switch_GetTexParameterIiv; 2719 GetTexParameterIuiv = Switch_GetTexParameterIuiv; 2720 ClearBufferiv = Switch_ClearBufferiv; 2721 ClearBufferuiv = Switch_ClearBufferuiv; 2722 ClearBufferfv = Switch_ClearBufferfv; 2723 ClearBufferfi = Switch_ClearBufferfi; 2724 GetStringi = Switch_GetStringi; 2725 2726 // Extension: ARB_uniform_buffer_object 2727 GetUniformIndices = Switch_GetUniformIndices; 2728 GetActiveUniformsiv = Switch_GetActiveUniformsiv; 2729 GetActiveUniformName = Switch_GetActiveUniformName; 2730 GetUniformBlockIndex = Switch_GetUniformBlockIndex; 2731 GetActiveUniformBlockiv = Switch_GetActiveUniformBlockiv; 2732 GetActiveUniformBlockName = Switch_GetActiveUniformBlockName; 2733 UniformBlockBinding = Switch_UniformBlockBinding; 2734 2735 // Extension: ARB_copy_buffer 2736 CopyBufferSubData = Switch_CopyBufferSubData; 2737 2738 // Extension: 3.1 2739 DrawArraysInstanced = Switch_DrawArraysInstanced; 2740 DrawElementsInstanced = Switch_DrawElementsInstanced; 2741 TexBuffer = Switch_TexBuffer; 2742 PrimitiveRestartIndex = Switch_PrimitiveRestartIndex; 2743 2744 // Legacy 2745 EnableClientState = Switch_EnableClientState; 2746 DisableClientState = Switch_DisableClientState; 2747 VertexPointer = Switch_VertexPointer; 2748 NormalPointer = Switch_NormalPointer; 2749 ColorPointer = Switch_ColorPointer; 2750 TexCoordPointer = Switch_TexCoordPointer; 2751 TexEnvi = Switch_TexEnvi; 2752 MatrixMode = Switch_MatrixMode; 2753 LoadIdentity = Switch_LoadIdentity; 2754 Ortho = Switch_Ortho; 2755 Color3d = Switch_Color3d; 2756 } 2757 }; 2758 2759 InitializeVariables g_initVariables; 2760 } 2761