glad.cc (61212B)
1 /* 2 3 OpenGL loader generated by glad 0.1.12a0 on Fri Jul 7 21:24:35 2017. 4 5 Language/Generator: C/C++ 6 Specification: gl 7 APIs: gl=3.3 8 Profile: core 9 Extensions: 10 GL_AMD_debug_output, 11 GL_EXT_texture_compression_s3tc, 12 GL_EXT_texture_sRGB, 13 GL_EXT_texture_sRGB_decode, 14 GL_KHR_debug 15 Loader: True 16 Local files: False 17 Omit khrplatform: True 18 19 Commandline: 20 --profile="core" --api="gl=3.3" --generator="c" --spec="gl" --omit-khrplatform --extensions="GL_AMD_debug_output,GL_EXT_texture_compression_s3tc,GL_EXT_texture_sRGB,GL_EXT_texture_sRGB_decode,GL_KHR_debug" 21 Online: 22 http://glad.dav1d.de/#profile=core&language=c&specification=gl&loader=on&api=gl%3D3.3&extensions=GL_AMD_debug_output&extensions=GL_EXT_texture_compression_s3tc&extensions=GL_EXT_texture_sRGB&extensions=GL_EXT_texture_sRGB_decode&extensions=GL_KHR_debug 23 */ 24 25 #include <stdio.h> 26 #include <stdlib.h> 27 #include <string.h> 28 #include "glad.h" 29 30 static void* get_proc(const char *namez); 31 32 #ifdef _WIN32 33 #include <windows.h> 34 static HMODULE libGL; 35 36 typedef void* (APIENTRYP PFNWGLGETPROCADDRESSPROC_PRIVATE)(const char*); 37 PFNWGLGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr; 38 39 static 40 int open_gl(void) { 41 libGL = LoadLibraryW(L"opengl32.dll"); 42 if(libGL != NULL) { 43 gladGetProcAddressPtr = (PFNWGLGETPROCADDRESSPROC_PRIVATE)GetProcAddress( 44 libGL, "wglGetProcAddress"); 45 return gladGetProcAddressPtr != NULL; 46 } 47 48 return 0; 49 } 50 51 static 52 void close_gl(void) { 53 if(libGL != NULL) { 54 FreeLibrary(libGL); 55 libGL = NULL; 56 } 57 } 58 #else 59 #include <dlfcn.h> 60 static void* libGL; 61 62 #ifndef __APPLE__ 63 typedef void* (APIENTRYP PFNGLXGETPROCADDRESSPROC_PRIVATE)(const char*); 64 PFNGLXGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr; 65 #endif 66 67 static 68 int open_gl(void) { 69 #ifdef __APPLE__ 70 static const char *NAMES[] = { 71 "../Frameworks/OpenGL.framework/OpenGL", 72 "/Library/Frameworks/OpenGL.framework/OpenGL", 73 "/System/Library/Frameworks/OpenGL.framework/OpenGL", 74 "/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL" 75 }; 76 #else 77 static const char *NAMES[] = {"libGL.so.1", "libGL.so"}; 78 #endif 79 80 unsigned int index = 0; 81 for(index = 0; index < (sizeof(NAMES) / sizeof(NAMES[0])); index++) { 82 libGL = dlopen(NAMES[index], RTLD_NOW | RTLD_GLOBAL); 83 84 if(libGL != NULL) { 85 #ifdef __APPLE__ 86 return 1; 87 #else 88 gladGetProcAddressPtr = (PFNGLXGETPROCADDRESSPROC_PRIVATE)dlsym(libGL, 89 "glXGetProcAddressARB"); 90 return gladGetProcAddressPtr != NULL; 91 #endif 92 } 93 } 94 95 return 0; 96 } 97 98 static 99 void close_gl() { 100 if(libGL != NULL) { 101 dlclose(libGL); 102 libGL = NULL; 103 } 104 } 105 #endif 106 107 static 108 void* get_proc(const char *namez) { 109 void* result = NULL; 110 if(libGL == NULL) return NULL; 111 112 #ifndef __APPLE__ 113 if(gladGetProcAddressPtr != NULL) { 114 result = gladGetProcAddressPtr(namez); 115 } 116 #endif 117 if(result == NULL) { 118 #ifdef _WIN32 119 result = (void*)GetProcAddress(libGL, namez); 120 #else 121 result = dlsym(libGL, namez); 122 #endif 123 } 124 125 return result; 126 } 127 128 int gladLoadGL(void) { 129 int status = 0; 130 131 if(open_gl()) { 132 status = gladLoadGLLoader(&get_proc); 133 close_gl(); 134 } 135 136 return status; 137 } 138 139 struct gladGLversionStruct GLVersion; 140 141 #if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0) 142 #define _GLAD_IS_SOME_NEW_VERSION 1 143 #endif 144 145 static int max_loaded_major; 146 static int max_loaded_minor; 147 148 static const char *exts = NULL; 149 static int num_exts_i = 0; 150 static const char **exts_i = NULL; 151 152 static int get_exts(void) { 153 #ifdef _GLAD_IS_SOME_NEW_VERSION 154 if(max_loaded_major < 3) { 155 #endif 156 exts = (const char *)glGetString(GL_EXTENSIONS); 157 #ifdef _GLAD_IS_SOME_NEW_VERSION 158 } else { 159 int index; 160 161 num_exts_i = 0; 162 glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i); 163 if (num_exts_i > 0) { 164 exts_i = (const char **)realloc((void *)exts_i, num_exts_i * sizeof *exts_i); 165 } 166 167 if (exts_i == NULL) { 168 return 0; 169 } 170 171 for(index = 0; index < num_exts_i; index++) { 172 exts_i[index] = (const char*)glGetStringi(GL_EXTENSIONS, index); 173 } 174 } 175 #endif 176 return 1; 177 } 178 179 static void free_exts(void) { 180 if (exts_i != NULL) { 181 free((char **)exts_i); 182 exts_i = NULL; 183 } 184 } 185 186 static int has_ext(const char *ext) { 187 #ifdef _GLAD_IS_SOME_NEW_VERSION 188 if(max_loaded_major < 3) { 189 #endif 190 const char *extensions; 191 const char *loc; 192 const char *terminator; 193 extensions = exts; 194 if(extensions == NULL || ext == NULL) { 195 return 0; 196 } 197 198 while(1) { 199 loc = strstr(extensions, ext); 200 if(loc == NULL) { 201 return 0; 202 } 203 204 terminator = loc + strlen(ext); 205 if((loc == extensions || *(loc - 1) == ' ') && 206 (*terminator == ' ' || *terminator == '\0')) { 207 return 1; 208 } 209 extensions = terminator; 210 } 211 #ifdef _GLAD_IS_SOME_NEW_VERSION 212 } else { 213 int index; 214 215 for(index = 0; index < num_exts_i; index++) { 216 const char *e = exts_i[index]; 217 218 if(strcmp(e, ext) == 0) { 219 return 1; 220 } 221 } 222 } 223 #endif 224 225 return 0; 226 } 227 int GLAD_GL_VERSION_1_0; 228 int GLAD_GL_VERSION_1_1; 229 int GLAD_GL_VERSION_1_2; 230 int GLAD_GL_VERSION_1_3; 231 int GLAD_GL_VERSION_1_4; 232 int GLAD_GL_VERSION_1_5; 233 int GLAD_GL_VERSION_2_0; 234 int GLAD_GL_VERSION_2_1; 235 int GLAD_GL_VERSION_3_0; 236 int GLAD_GL_VERSION_3_1; 237 int GLAD_GL_VERSION_3_2; 238 int GLAD_GL_VERSION_3_3; 239 PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v; 240 PFNGLUNIFORM1UIPROC glad_glUniform1ui; 241 PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation; 242 PFNGLDELETEQUERIESPROC glad_glDeleteQueries; 243 PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv; 244 PFNGLHINTPROC glad_glHint; 245 PFNGLFLUSHPROC glad_glFlush; 246 PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv; 247 PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv; 248 PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv; 249 PFNGLMULTITEXCOORDP4UIVPROC glad_glMultiTexCoordP4uiv; 250 PFNGLUNIFORM1FPROC glad_glUniform1f; 251 PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv; 252 PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange; 253 PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv; 254 PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv; 255 PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv; 256 PFNGLCLAMPCOLORPROC glad_glClampColor; 257 PFNGLDISABLEIPROC glad_glDisablei; 258 PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv; 259 PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers; 260 PFNGLUNIFORM2UIVPROC glad_glUniform2uiv; 261 PFNGLPOLYGONMODEPROC glad_glPolygonMode; 262 PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform; 263 PFNGLCLEARCOLORPROC glad_glClearColor; 264 PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv; 265 PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource; 266 PFNGLUNIFORM1FVPROC glad_glUniform1fv; 267 PFNGLISSAMPLERPROC glad_glIsSampler; 268 PFNGLMULTITEXCOORDP3UIVPROC glad_glMultiTexCoordP3uiv; 269 PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i; 270 PFNGLLOGICOPPROC glad_glLogicOp; 271 PFNGLSECONDARYCOLORP3UIPROC glad_glSecondaryColorP3ui; 272 PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D; 273 PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D; 274 PFNGLTEXPARAMETERIPROC glad_glTexParameteri; 275 PFNGLENABLEPROC glad_glEnable; 276 PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements; 277 PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv; 278 PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i; 279 PFNGLUNIFORM2IPROC glad_glUniform2i; 280 PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f; 281 PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D; 282 PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv; 283 PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v; 284 PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv; 285 PFNGLUNIFORM4FPROC glad_glUniform4f; 286 PFNGLUNIFORM1IPROC glad_glUniform1i; 287 PFNGLCOLORMASKPROC glad_glColorMask; 288 PFNGLPOINTPARAMETERIPROC glad_glPointParameteri; 289 PFNGLWAITSYNCPROC glad_glWaitSync; 290 PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus; 291 PFNGLISENABLEDIPROC glad_glIsEnabledi; 292 PFNGLTEXPARAMETERFPROC glad_glTexParameterf; 293 PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv; 294 PFNGLUNIFORM3UIVPROC glad_glUniform3uiv; 295 PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv; 296 PFNGLUNIFORM3FVPROC glad_glUniform3fv; 297 PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate; 298 PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv; 299 PFNGLMULTITEXCOORDP2UIPROC glad_glMultiTexCoordP2ui; 300 PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv; 301 PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers; 302 PFNGLCREATESHADERPROC glad_glCreateShader; 303 PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D; 304 PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D; 305 PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s; 306 PFNGLUNIFORM2FVPROC glad_glUniform2fv; 307 PFNGLTEXIMAGE3DPROC glad_glTexImage3D; 308 PFNGLISTEXTUREPROC glad_glIsTexture; 309 PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv; 310 PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv; 311 PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv; 312 PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate; 313 PFNGLCULLFACEPROC glad_glCullFace; 314 PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv; 315 PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram; 316 PFNGLGETBOOLEANVPROC glad_glGetBooleanv; 317 PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv; 318 PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui; 319 PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender; 320 PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer; 321 PFNGLDELETEPROGRAMPROC glad_glDeleteProgram; 322 PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D; 323 PFNGLBUFFERDATAPROC glad_glBufferData; 324 PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv; 325 PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv; 326 PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers; 327 PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv; 328 PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv; 329 PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv; 330 PFNGLTEXCOORDP3UIPROC glad_glTexCoordP3ui; 331 PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s; 332 PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub; 333 PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui; 334 PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate; 335 PFNGLBINDBUFFERPROC glad_glBindBuffer; 336 PFNGLLINKPROGRAMPROC glad_glLinkProgram; 337 PFNGLNORMALP3UIVPROC glad_glNormalP3uiv; 338 PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s; 339 PFNGLFRONTFACEPROC glad_glFrontFace; 340 PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv; 341 PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation; 342 PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri; 343 PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv; 344 PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers; 345 PFNGLSHADERSOURCEPROC glad_glShaderSource; 346 PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv; 347 PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s; 348 PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D; 349 PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv; 350 PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv; 351 PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback; 352 PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray; 353 PFNGLMULTITEXCOORDP2UIVPROC glad_glMultiTexCoordP2uiv; 354 PFNGLDEPTHMASKPROC glad_glDepthMask; 355 PFNGLGETSTRINGIPROC glad_glGetStringi; 356 PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays; 357 PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d; 358 PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData; 359 PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample; 360 PFNGLMULTITEXCOORDP1UIPROC glad_glMultiTexCoordP1ui; 361 PFNGLGETQUERYIVPROC glad_glGetQueryiv; 362 PFNGLVERTEXP2UIVPROC glad_glVertexP2uiv; 363 PFNGLUNIFORM4IVPROC glad_glUniform4iv; 364 PFNGLDRAWARRAYSPROC glad_glDrawArrays; 365 PFNGLSTENCILOPPROC glad_glStencilOp; 366 PFNGLGETSHADERIVPROC glad_glGetShaderiv; 367 PFNGLUNIFORM1UIVPROC glad_glUniform1uiv; 368 PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv; 369 PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer; 370 PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv; 371 PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv; 372 PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv; 373 PFNGLSTENCILMASKPROC glad_glStencilMask; 374 PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex; 375 PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying; 376 PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d; 377 PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui; 378 PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D; 379 PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv; 380 PFNGLUNIFORM1IVPROC glad_glUniform1iv; 381 PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv; 382 PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex; 383 PFNGLISENABLEDPROC glad_glIsEnabled; 384 PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage; 385 PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv; 386 PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv; 387 PFNGLCOLORP4UIPROC glad_glColorP4ui; 388 PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders; 389 PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv; 390 PFNGLDELETESYNCPROC glad_glDeleteSync; 391 PFNGLUNIFORM3IPROC glad_glUniform3i; 392 PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender; 393 PFNGLGENTEXTURESPROC glad_glGenTextures; 394 PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv; 395 PFNGLTEXBUFFERPROC glad_glTexBuffer; 396 PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer; 397 PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName; 398 PFNGLUNIFORM3IVPROC glad_glUniform3iv; 399 PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers; 400 PFNGLTEXIMAGE2DPROC glad_glTexImage2D; 401 PFNGLISPROGRAMPROC glad_glIsProgram; 402 PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i; 403 PFNGLBINDTEXTUREPROC glad_glBindTexture; 404 PFNGLCLEARPROC glad_glClear; 405 PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements; 406 PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation; 407 PFNGLGENQUERIESPROC glad_glGenQueries; 408 PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog; 409 PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv; 410 PFNGLUNIFORM4IPROC glad_glUniform4i; 411 PFNGLGENSAMPLERSPROC glad_glGenSamplers; 412 PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex; 413 PFNGLGETTEXIMAGEPROC glad_glGetTexImage; 414 PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv; 415 PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate; 416 PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i; 417 PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex; 418 PFNGLUSEPROGRAMPROC glad_glUseProgram; 419 PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D; 420 PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer; 421 PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv; 422 PFNGLCLEARSTENCILPROC glad_glClearStencil; 423 PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced; 424 PFNGLDEPTHFUNCPROC glad_glDepthFunc; 425 PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex; 426 PFNGLGETINTEGER64VPROC glad_glGetInteger64v; 427 PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays; 428 PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv; 429 PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv; 430 PFNGLTEXCOORDP2UIPROC glad_glTexCoordP2ui; 431 PFNGLPIXELSTOREIPROC glad_glPixelStorei; 432 PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D; 433 PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv; 434 PFNGLDISABLEPROC glad_glDisable; 435 PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation; 436 PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation; 437 PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv; 438 PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv; 439 PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv; 440 PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv; 441 PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv; 442 PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv; 443 PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv; 444 PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer; 445 PFNGLQUERYCOUNTERPROC glad_glQueryCounter; 446 PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D; 447 PFNGLDRAWBUFFERSPROC glad_glDrawBuffers; 448 PFNGLGETDOUBLEVPROC glad_glGetDoublev; 449 PFNGLGENBUFFERSPROC glad_glGenBuffers; 450 PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv; 451 PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray; 452 PFNGLLINEWIDTHPROC glad_glLineWidth; 453 PFNGLSTENCILFUNCPROC glad_glStencilFunc; 454 PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv; 455 PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding; 456 PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange; 457 PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv; 458 PFNGLUNIFORM4UIVPROC glad_glUniform4uiv; 459 PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv; 460 PFNGLCOLORP3UIPROC glad_glColorP3ui; 461 PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f; 462 PFNGLMULTITEXCOORDP3UIPROC glad_glMultiTexCoordP3ui; 463 PFNGLDRAWBUFFERPROC glad_glDrawBuffer; 464 PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv; 465 PFNGLBLENDEQUATIONPROC glad_glBlendEquation; 466 PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv; 467 PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf; 468 PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv; 469 PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv; 470 PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced; 471 PFNGLDRAWELEMENTSPROC glad_glDrawElements; 472 PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex; 473 PFNGLVERTEXP3UIPROC glad_glVertexP3ui; 474 PFNGLBLENDCOLORPROC glad_glBlendColor; 475 PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv; 476 PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv; 477 PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D; 478 PFNGLBINDSAMPLERPROC glad_glBindSampler; 479 PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui; 480 PFNGLGETPROGRAMIVPROC glad_glGetProgramiv; 481 PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv; 482 PFNGLCREATEPROGRAMPROC glad_glCreateProgram; 483 PFNGLISVERTEXARRAYPROC glad_glIsVertexArray; 484 PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv; 485 PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog; 486 PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv; 487 PFNGLUNIFORM4UIPROC glad_glUniform4ui; 488 PFNGLENDQUERYPROC glad_glEndQuery; 489 PFNGLTEXCOORDP3UIVPROC glad_glTexCoordP3uiv; 490 PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv; 491 PFNGLPIXELSTOREFPROC glad_glPixelStoref; 492 PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices; 493 PFNGLSAMPLEMASKIPROC glad_glSampleMaski; 494 PFNGLUNIFORM2FPROC glad_glUniform2f; 495 PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D; 496 PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v; 497 PFNGLVERTEXP2UIPROC glad_glVertexP2ui; 498 PFNGLTEXCOORDP1UIVPROC glad_glTexCoordP1uiv; 499 PFNGLGETUNIFORMFVPROC glad_glGetUniformfv; 500 PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer; 501 PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f; 502 PFNGLVERTEXP4UIVPROC glad_glVertexP4uiv; 503 PFNGLPOINTPARAMETERFPROC glad_glPointParameterf; 504 PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed; 505 PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv; 506 PFNGLBLENDFUNCPROC glad_glBlendFunc; 507 PFNGLISBUFFERPROC glad_glIsBuffer; 508 PFNGLFINISHPROC glad_glFinish; 509 PFNGLGETUNIFORMIVPROC glad_glGetUniformiv; 510 PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback; 511 PFNGLISSHADERPROC glad_glIsShader; 512 PFNGLUNIFORM3FPROC glad_glUniform3f; 513 PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv; 514 PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv; 515 PFNGLGETFLOATVPROC glad_glGetFloatv; 516 PFNGLUNIFORM3UIPROC glad_glUniform3ui; 517 PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange; 518 PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture; 519 PFNGLDETACHSHADERPROC glad_glDetachShader; 520 PFNGLTEXCOORDP2UIVPROC glad_glTexCoordP2uiv; 521 PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv; 522 PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v; 523 PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv; 524 PFNGLCOLORMASKIPROC glad_glColorMaski; 525 PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage; 526 PFNGLNORMALP3UIPROC glad_glNormalP3ui; 527 PFNGLPOINTSIZEPROC glad_glPointSize; 528 PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor; 529 PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample; 530 PFNGLUNIFORM2IVPROC glad_glUniform2iv; 531 PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage; 532 PFNGLVERTEXP4UIPROC glad_glVertexP4ui; 533 PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv; 534 PFNGLFENCESYNCPROC glad_glFenceSync; 535 PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv; 536 PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv; 537 PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v; 538 PFNGLTEXIMAGE1DPROC glad_glTexImage1D; 539 PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv; 540 PFNGLISQUERYPROC glad_glIsQuery; 541 PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv; 542 PFNGLCOMPILESHADERPROC glad_glCompileShader; 543 PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray; 544 PFNGLBUFFERSUBDATAPROC glad_glBufferSubData; 545 PFNGLCLEARDEPTHPROC glad_glClearDepth; 546 PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv; 547 PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer; 548 PFNGLGETSTRINGPROC glad_glGetString; 549 PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui; 550 PFNGLUNIFORM4FVPROC glad_glUniform4fv; 551 PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v; 552 PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv; 553 PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer; 554 PFNGLATTACHSHADERPROC glad_glAttachShader; 555 PFNGLENABLEIPROC glad_glEnablei; 556 PFNGLCOLORP4UIVPROC glad_glColorP4uiv; 557 PFNGLACTIVETEXTUREPROC glad_glActiveTexture; 558 PFNGLMULTITEXCOORDP1UIVPROC glad_glMultiTexCoordP1uiv; 559 PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName; 560 PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers; 561 PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D; 562 PFNGLVERTEXP3UIVPROC glad_glVertexP3uiv; 563 PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui; 564 PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D; 565 PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui; 566 PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays; 567 PFNGLCOLORP3UIVPROC glad_glColorP3uiv; 568 PFNGLTEXCOORDP1UIPROC glad_glTexCoordP1ui; 569 PFNGLREADBUFFERPROC glad_glReadBuffer; 570 PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex; 571 PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate; 572 PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi; 573 PFNGLTEXCOORDP4UIPROC glad_glTexCoordP4ui; 574 PFNGLGETSYNCIVPROC glad_glGetSynciv; 575 PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f; 576 PFNGLDEPTHRANGEPROC glad_glDepthRange; 577 PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D; 578 PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap; 579 PFNGLMULTITEXCOORDP4UIPROC glad_glMultiTexCoordP4ui; 580 PFNGLBEGINQUERYPROC glad_glBeginQuery; 581 PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D; 582 PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv; 583 PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings; 584 PFNGLDELETETEXTURESPROC glad_glDeleteTextures; 585 PFNGLMAPBUFFERPROC glad_glMapBuffer; 586 PFNGLSCISSORPROC glad_glScissor; 587 PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv; 588 PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib; 589 PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample; 590 PFNGLTEXCOORDP4UIVPROC glad_glTexCoordP4uiv; 591 PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData; 592 PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex; 593 PFNGLDELETESHADERPROC glad_glDeleteShader; 594 PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui; 595 PFNGLGETERRORPROC glad_glGetError; 596 PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase; 597 PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset; 598 PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv; 599 PFNGLUNIFORM2UIPROC glad_glUniform2ui; 600 PFNGLISSYNCPROC glad_glIsSync; 601 PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer; 602 PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv; 603 PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d; 604 PFNGLREADPIXELSPROC glad_glReadPixels; 605 PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer; 606 PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv; 607 PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d; 608 PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv; 609 PFNGLGETINTEGERVPROC glad_glGetIntegerv; 610 PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv; 611 PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync; 612 PFNGLVIEWPORTPROC glad_glViewport; 613 int GLAD_GL_KHR_debug; 614 int GLAD_GL_AMD_debug_output; 615 int GLAD_GL_EXT_texture_compression_s3tc; 616 int GLAD_GL_EXT_texture_sRGB_decode; 617 int GLAD_GL_EXT_texture_sRGB; 618 PFNGLDEBUGMESSAGEENABLEAMDPROC glad_glDebugMessageEnableAMD; 619 PFNGLDEBUGMESSAGEINSERTAMDPROC glad_glDebugMessageInsertAMD; 620 PFNGLDEBUGMESSAGECALLBACKAMDPROC glad_glDebugMessageCallbackAMD; 621 PFNGLGETDEBUGMESSAGELOGAMDPROC glad_glGetDebugMessageLogAMD; 622 PFNGLDEBUGMESSAGECONTROLPROC glad_glDebugMessageControl; 623 PFNGLDEBUGMESSAGEINSERTPROC glad_glDebugMessageInsert; 624 PFNGLDEBUGMESSAGECALLBACKPROC glad_glDebugMessageCallback; 625 PFNGLGETDEBUGMESSAGELOGPROC glad_glGetDebugMessageLog; 626 PFNGLPUSHDEBUGGROUPPROC glad_glPushDebugGroup; 627 PFNGLPOPDEBUGGROUPPROC glad_glPopDebugGroup; 628 PFNGLOBJECTLABELPROC glad_glObjectLabel; 629 PFNGLGETOBJECTLABELPROC glad_glGetObjectLabel; 630 PFNGLOBJECTPTRLABELPROC glad_glObjectPtrLabel; 631 PFNGLGETOBJECTPTRLABELPROC glad_glGetObjectPtrLabel; 632 PFNGLGETPOINTERVPROC glad_glGetPointerv; 633 PFNGLDEBUGMESSAGECONTROLKHRPROC glad_glDebugMessageControlKHR; 634 PFNGLDEBUGMESSAGEINSERTKHRPROC glad_glDebugMessageInsertKHR; 635 PFNGLDEBUGMESSAGECALLBACKKHRPROC glad_glDebugMessageCallbackKHR; 636 PFNGLGETDEBUGMESSAGELOGKHRPROC glad_glGetDebugMessageLogKHR; 637 PFNGLPUSHDEBUGGROUPKHRPROC glad_glPushDebugGroupKHR; 638 PFNGLPOPDEBUGGROUPKHRPROC glad_glPopDebugGroupKHR; 639 PFNGLOBJECTLABELKHRPROC glad_glObjectLabelKHR; 640 PFNGLGETOBJECTLABELKHRPROC glad_glGetObjectLabelKHR; 641 PFNGLOBJECTPTRLABELKHRPROC glad_glObjectPtrLabelKHR; 642 PFNGLGETOBJECTPTRLABELKHRPROC glad_glGetObjectPtrLabelKHR; 643 PFNGLGETPOINTERVKHRPROC glad_glGetPointervKHR; 644 static void load_GL_VERSION_1_0(GLADloadproc load) { 645 if(!GLAD_GL_VERSION_1_0) return; 646 glad_glCullFace = (PFNGLCULLFACEPROC)load("glCullFace"); 647 glad_glFrontFace = (PFNGLFRONTFACEPROC)load("glFrontFace"); 648 glad_glHint = (PFNGLHINTPROC)load("glHint"); 649 glad_glLineWidth = (PFNGLLINEWIDTHPROC)load("glLineWidth"); 650 glad_glPointSize = (PFNGLPOINTSIZEPROC)load("glPointSize"); 651 glad_glPolygonMode = (PFNGLPOLYGONMODEPROC)load("glPolygonMode"); 652 glad_glScissor = (PFNGLSCISSORPROC)load("glScissor"); 653 glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC)load("glTexParameterf"); 654 glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC)load("glTexParameterfv"); 655 glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC)load("glTexParameteri"); 656 glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC)load("glTexParameteriv"); 657 glad_glTexImage1D = (PFNGLTEXIMAGE1DPROC)load("glTexImage1D"); 658 glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC)load("glTexImage2D"); 659 glad_glDrawBuffer = (PFNGLDRAWBUFFERPROC)load("glDrawBuffer"); 660 glad_glClear = (PFNGLCLEARPROC)load("glClear"); 661 glad_glClearColor = (PFNGLCLEARCOLORPROC)load("glClearColor"); 662 glad_glClearStencil = (PFNGLCLEARSTENCILPROC)load("glClearStencil"); 663 glad_glClearDepth = (PFNGLCLEARDEPTHPROC)load("glClearDepth"); 664 glad_glStencilMask = (PFNGLSTENCILMASKPROC)load("glStencilMask"); 665 glad_glColorMask = (PFNGLCOLORMASKPROC)load("glColorMask"); 666 glad_glDepthMask = (PFNGLDEPTHMASKPROC)load("glDepthMask"); 667 glad_glDisable = (PFNGLDISABLEPROC)load("glDisable"); 668 glad_glEnable = (PFNGLENABLEPROC)load("glEnable"); 669 glad_glFinish = (PFNGLFINISHPROC)load("glFinish"); 670 glad_glFlush = (PFNGLFLUSHPROC)load("glFlush"); 671 glad_glBlendFunc = (PFNGLBLENDFUNCPROC)load("glBlendFunc"); 672 glad_glLogicOp = (PFNGLLOGICOPPROC)load("glLogicOp"); 673 glad_glStencilFunc = (PFNGLSTENCILFUNCPROC)load("glStencilFunc"); 674 glad_glStencilOp = (PFNGLSTENCILOPPROC)load("glStencilOp"); 675 glad_glDepthFunc = (PFNGLDEPTHFUNCPROC)load("glDepthFunc"); 676 glad_glPixelStoref = (PFNGLPIXELSTOREFPROC)load("glPixelStoref"); 677 glad_glPixelStorei = (PFNGLPIXELSTOREIPROC)load("glPixelStorei"); 678 glad_glReadBuffer = (PFNGLREADBUFFERPROC)load("glReadBuffer"); 679 glad_glReadPixels = (PFNGLREADPIXELSPROC)load("glReadPixels"); 680 glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC)load("glGetBooleanv"); 681 glad_glGetDoublev = (PFNGLGETDOUBLEVPROC)load("glGetDoublev"); 682 glad_glGetError = (PFNGLGETERRORPROC)load("glGetError"); 683 glad_glGetFloatv = (PFNGLGETFLOATVPROC)load("glGetFloatv"); 684 glad_glGetIntegerv = (PFNGLGETINTEGERVPROC)load("glGetIntegerv"); 685 glad_glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); 686 glad_glGetTexImage = (PFNGLGETTEXIMAGEPROC)load("glGetTexImage"); 687 glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC)load("glGetTexParameterfv"); 688 glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC)load("glGetTexParameteriv"); 689 glad_glGetTexLevelParameterfv = (PFNGLGETTEXLEVELPARAMETERFVPROC)load("glGetTexLevelParameterfv"); 690 glad_glGetTexLevelParameteriv = (PFNGLGETTEXLEVELPARAMETERIVPROC)load("glGetTexLevelParameteriv"); 691 glad_glIsEnabled = (PFNGLISENABLEDPROC)load("glIsEnabled"); 692 glad_glDepthRange = (PFNGLDEPTHRANGEPROC)load("glDepthRange"); 693 glad_glViewport = (PFNGLVIEWPORTPROC)load("glViewport"); 694 } 695 static void load_GL_VERSION_1_1(GLADloadproc load) { 696 if(!GLAD_GL_VERSION_1_1) return; 697 glad_glDrawArrays = (PFNGLDRAWARRAYSPROC)load("glDrawArrays"); 698 glad_glDrawElements = (PFNGLDRAWELEMENTSPROC)load("glDrawElements"); 699 glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC)load("glPolygonOffset"); 700 glad_glCopyTexImage1D = (PFNGLCOPYTEXIMAGE1DPROC)load("glCopyTexImage1D"); 701 glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC)load("glCopyTexImage2D"); 702 glad_glCopyTexSubImage1D = (PFNGLCOPYTEXSUBIMAGE1DPROC)load("glCopyTexSubImage1D"); 703 glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC)load("glCopyTexSubImage2D"); 704 glad_glTexSubImage1D = (PFNGLTEXSUBIMAGE1DPROC)load("glTexSubImage1D"); 705 glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC)load("glTexSubImage2D"); 706 glad_glBindTexture = (PFNGLBINDTEXTUREPROC)load("glBindTexture"); 707 glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC)load("glDeleteTextures"); 708 glad_glGenTextures = (PFNGLGENTEXTURESPROC)load("glGenTextures"); 709 glad_glIsTexture = (PFNGLISTEXTUREPROC)load("glIsTexture"); 710 } 711 static void load_GL_VERSION_1_2(GLADloadproc load) { 712 if(!GLAD_GL_VERSION_1_2) return; 713 glad_glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)load("glDrawRangeElements"); 714 glad_glTexImage3D = (PFNGLTEXIMAGE3DPROC)load("glTexImage3D"); 715 glad_glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)load("glTexSubImage3D"); 716 glad_glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)load("glCopyTexSubImage3D"); 717 } 718 static void load_GL_VERSION_1_3(GLADloadproc load) { 719 if(!GLAD_GL_VERSION_1_3) return; 720 glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC)load("glActiveTexture"); 721 glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)load("glSampleCoverage"); 722 glad_glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)load("glCompressedTexImage3D"); 723 glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)load("glCompressedTexImage2D"); 724 glad_glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)load("glCompressedTexImage1D"); 725 glad_glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)load("glCompressedTexSubImage3D"); 726 glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)load("glCompressedTexSubImage2D"); 727 glad_glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)load("glCompressedTexSubImage1D"); 728 glad_glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)load("glGetCompressedTexImage"); 729 } 730 static void load_GL_VERSION_1_4(GLADloadproc load) { 731 if(!GLAD_GL_VERSION_1_4) return; 732 glad_glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)load("glBlendFuncSeparate"); 733 glad_glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)load("glMultiDrawArrays"); 734 glad_glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)load("glMultiDrawElements"); 735 glad_glPointParameterf = (PFNGLPOINTPARAMETERFPROC)load("glPointParameterf"); 736 glad_glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)load("glPointParameterfv"); 737 glad_glPointParameteri = (PFNGLPOINTPARAMETERIPROC)load("glPointParameteri"); 738 glad_glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)load("glPointParameteriv"); 739 glad_glBlendColor = (PFNGLBLENDCOLORPROC)load("glBlendColor"); 740 glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC)load("glBlendEquation"); 741 } 742 static void load_GL_VERSION_1_5(GLADloadproc load) { 743 if(!GLAD_GL_VERSION_1_5) return; 744 glad_glGenQueries = (PFNGLGENQUERIESPROC)load("glGenQueries"); 745 glad_glDeleteQueries = (PFNGLDELETEQUERIESPROC)load("glDeleteQueries"); 746 glad_glIsQuery = (PFNGLISQUERYPROC)load("glIsQuery"); 747 glad_glBeginQuery = (PFNGLBEGINQUERYPROC)load("glBeginQuery"); 748 glad_glEndQuery = (PFNGLENDQUERYPROC)load("glEndQuery"); 749 glad_glGetQueryiv = (PFNGLGETQUERYIVPROC)load("glGetQueryiv"); 750 glad_glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)load("glGetQueryObjectiv"); 751 glad_glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)load("glGetQueryObjectuiv"); 752 glad_glBindBuffer = (PFNGLBINDBUFFERPROC)load("glBindBuffer"); 753 glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)load("glDeleteBuffers"); 754 glad_glGenBuffers = (PFNGLGENBUFFERSPROC)load("glGenBuffers"); 755 glad_glIsBuffer = (PFNGLISBUFFERPROC)load("glIsBuffer"); 756 glad_glBufferData = (PFNGLBUFFERDATAPROC)load("glBufferData"); 757 glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC)load("glBufferSubData"); 758 glad_glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)load("glGetBufferSubData"); 759 glad_glMapBuffer = (PFNGLMAPBUFFERPROC)load("glMapBuffer"); 760 glad_glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)load("glUnmapBuffer"); 761 glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)load("glGetBufferParameteriv"); 762 glad_glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)load("glGetBufferPointerv"); 763 } 764 static void load_GL_VERSION_2_0(GLADloadproc load) { 765 if(!GLAD_GL_VERSION_2_0) return; 766 glad_glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)load("glBlendEquationSeparate"); 767 glad_glDrawBuffers = (PFNGLDRAWBUFFERSPROC)load("glDrawBuffers"); 768 glad_glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)load("glStencilOpSeparate"); 769 glad_glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)load("glStencilFuncSeparate"); 770 glad_glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)load("glStencilMaskSeparate"); 771 glad_glAttachShader = (PFNGLATTACHSHADERPROC)load("glAttachShader"); 772 glad_glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)load("glBindAttribLocation"); 773 glad_glCompileShader = (PFNGLCOMPILESHADERPROC)load("glCompileShader"); 774 glad_glCreateProgram = (PFNGLCREATEPROGRAMPROC)load("glCreateProgram"); 775 glad_glCreateShader = (PFNGLCREATESHADERPROC)load("glCreateShader"); 776 glad_glDeleteProgram = (PFNGLDELETEPROGRAMPROC)load("glDeleteProgram"); 777 glad_glDeleteShader = (PFNGLDELETESHADERPROC)load("glDeleteShader"); 778 glad_glDetachShader = (PFNGLDETACHSHADERPROC)load("glDetachShader"); 779 glad_glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)load("glDisableVertexAttribArray"); 780 glad_glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)load("glEnableVertexAttribArray"); 781 glad_glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)load("glGetActiveAttrib"); 782 glad_glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)load("glGetActiveUniform"); 783 glad_glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)load("glGetAttachedShaders"); 784 glad_glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)load("glGetAttribLocation"); 785 glad_glGetProgramiv = (PFNGLGETPROGRAMIVPROC)load("glGetProgramiv"); 786 glad_glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)load("glGetProgramInfoLog"); 787 glad_glGetShaderiv = (PFNGLGETSHADERIVPROC)load("glGetShaderiv"); 788 glad_glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)load("glGetShaderInfoLog"); 789 glad_glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)load("glGetShaderSource"); 790 glad_glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)load("glGetUniformLocation"); 791 glad_glGetUniformfv = (PFNGLGETUNIFORMFVPROC)load("glGetUniformfv"); 792 glad_glGetUniformiv = (PFNGLGETUNIFORMIVPROC)load("glGetUniformiv"); 793 glad_glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)load("glGetVertexAttribdv"); 794 glad_glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)load("glGetVertexAttribfv"); 795 glad_glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)load("glGetVertexAttribiv"); 796 glad_glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)load("glGetVertexAttribPointerv"); 797 glad_glIsProgram = (PFNGLISPROGRAMPROC)load("glIsProgram"); 798 glad_glIsShader = (PFNGLISSHADERPROC)load("glIsShader"); 799 glad_glLinkProgram = (PFNGLLINKPROGRAMPROC)load("glLinkProgram"); 800 glad_glShaderSource = (PFNGLSHADERSOURCEPROC)load("glShaderSource"); 801 glad_glUseProgram = (PFNGLUSEPROGRAMPROC)load("glUseProgram"); 802 glad_glUniform1f = (PFNGLUNIFORM1FPROC)load("glUniform1f"); 803 glad_glUniform2f = (PFNGLUNIFORM2FPROC)load("glUniform2f"); 804 glad_glUniform3f = (PFNGLUNIFORM3FPROC)load("glUniform3f"); 805 glad_glUniform4f = (PFNGLUNIFORM4FPROC)load("glUniform4f"); 806 glad_glUniform1i = (PFNGLUNIFORM1IPROC)load("glUniform1i"); 807 glad_glUniform2i = (PFNGLUNIFORM2IPROC)load("glUniform2i"); 808 glad_glUniform3i = (PFNGLUNIFORM3IPROC)load("glUniform3i"); 809 glad_glUniform4i = (PFNGLUNIFORM4IPROC)load("glUniform4i"); 810 glad_glUniform1fv = (PFNGLUNIFORM1FVPROC)load("glUniform1fv"); 811 glad_glUniform2fv = (PFNGLUNIFORM2FVPROC)load("glUniform2fv"); 812 glad_glUniform3fv = (PFNGLUNIFORM3FVPROC)load("glUniform3fv"); 813 glad_glUniform4fv = (PFNGLUNIFORM4FVPROC)load("glUniform4fv"); 814 glad_glUniform1iv = (PFNGLUNIFORM1IVPROC)load("glUniform1iv"); 815 glad_glUniform2iv = (PFNGLUNIFORM2IVPROC)load("glUniform2iv"); 816 glad_glUniform3iv = (PFNGLUNIFORM3IVPROC)load("glUniform3iv"); 817 glad_glUniform4iv = (PFNGLUNIFORM4IVPROC)load("glUniform4iv"); 818 glad_glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)load("glUniformMatrix2fv"); 819 glad_glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)load("glUniformMatrix3fv"); 820 glad_glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)load("glUniformMatrix4fv"); 821 glad_glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)load("glValidateProgram"); 822 glad_glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)load("glVertexAttrib1d"); 823 glad_glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)load("glVertexAttrib1dv"); 824 glad_glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)load("glVertexAttrib1f"); 825 glad_glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)load("glVertexAttrib1fv"); 826 glad_glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)load("glVertexAttrib1s"); 827 glad_glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)load("glVertexAttrib1sv"); 828 glad_glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)load("glVertexAttrib2d"); 829 glad_glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)load("glVertexAttrib2dv"); 830 glad_glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)load("glVertexAttrib2f"); 831 glad_glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)load("glVertexAttrib2fv"); 832 glad_glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)load("glVertexAttrib2s"); 833 glad_glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)load("glVertexAttrib2sv"); 834 glad_glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)load("glVertexAttrib3d"); 835 glad_glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)load("glVertexAttrib3dv"); 836 glad_glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)load("glVertexAttrib3f"); 837 glad_glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)load("glVertexAttrib3fv"); 838 glad_glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)load("glVertexAttrib3s"); 839 glad_glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)load("glVertexAttrib3sv"); 840 glad_glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)load("glVertexAttrib4Nbv"); 841 glad_glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)load("glVertexAttrib4Niv"); 842 glad_glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)load("glVertexAttrib4Nsv"); 843 glad_glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)load("glVertexAttrib4Nub"); 844 glad_glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)load("glVertexAttrib4Nubv"); 845 glad_glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)load("glVertexAttrib4Nuiv"); 846 glad_glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)load("glVertexAttrib4Nusv"); 847 glad_glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)load("glVertexAttrib4bv"); 848 glad_glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)load("glVertexAttrib4d"); 849 glad_glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)load("glVertexAttrib4dv"); 850 glad_glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)load("glVertexAttrib4f"); 851 glad_glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)load("glVertexAttrib4fv"); 852 glad_glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)load("glVertexAttrib4iv"); 853 glad_glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)load("glVertexAttrib4s"); 854 glad_glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)load("glVertexAttrib4sv"); 855 glad_glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)load("glVertexAttrib4ubv"); 856 glad_glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)load("glVertexAttrib4uiv"); 857 glad_glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)load("glVertexAttrib4usv"); 858 glad_glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)load("glVertexAttribPointer"); 859 } 860 static void load_GL_VERSION_2_1(GLADloadproc load) { 861 if(!GLAD_GL_VERSION_2_1) return; 862 glad_glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)load("glUniformMatrix2x3fv"); 863 glad_glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)load("glUniformMatrix3x2fv"); 864 glad_glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)load("glUniformMatrix2x4fv"); 865 glad_glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)load("glUniformMatrix4x2fv"); 866 glad_glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)load("glUniformMatrix3x4fv"); 867 glad_glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)load("glUniformMatrix4x3fv"); 868 } 869 static void load_GL_VERSION_3_0(GLADloadproc load) { 870 if(!GLAD_GL_VERSION_3_0) return; 871 glad_glColorMaski = (PFNGLCOLORMASKIPROC)load("glColorMaski"); 872 glad_glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)load("glGetBooleani_v"); 873 glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); 874 glad_glEnablei = (PFNGLENABLEIPROC)load("glEnablei"); 875 glad_glDisablei = (PFNGLDISABLEIPROC)load("glDisablei"); 876 glad_glIsEnabledi = (PFNGLISENABLEDIPROC)load("glIsEnabledi"); 877 glad_glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)load("glBeginTransformFeedback"); 878 glad_glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)load("glEndTransformFeedback"); 879 glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); 880 glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); 881 glad_glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)load("glTransformFeedbackVaryings"); 882 glad_glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)load("glGetTransformFeedbackVarying"); 883 glad_glClampColor = (PFNGLCLAMPCOLORPROC)load("glClampColor"); 884 glad_glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)load("glBeginConditionalRender"); 885 glad_glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)load("glEndConditionalRender"); 886 glad_glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)load("glVertexAttribIPointer"); 887 glad_glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)load("glGetVertexAttribIiv"); 888 glad_glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)load("glGetVertexAttribIuiv"); 889 glad_glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)load("glVertexAttribI1i"); 890 glad_glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)load("glVertexAttribI2i"); 891 glad_glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)load("glVertexAttribI3i"); 892 glad_glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)load("glVertexAttribI4i"); 893 glad_glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)load("glVertexAttribI1ui"); 894 glad_glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)load("glVertexAttribI2ui"); 895 glad_glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)load("glVertexAttribI3ui"); 896 glad_glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)load("glVertexAttribI4ui"); 897 glad_glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)load("glVertexAttribI1iv"); 898 glad_glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)load("glVertexAttribI2iv"); 899 glad_glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)load("glVertexAttribI3iv"); 900 glad_glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)load("glVertexAttribI4iv"); 901 glad_glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)load("glVertexAttribI1uiv"); 902 glad_glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)load("glVertexAttribI2uiv"); 903 glad_glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)load("glVertexAttribI3uiv"); 904 glad_glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)load("glVertexAttribI4uiv"); 905 glad_glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)load("glVertexAttribI4bv"); 906 glad_glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)load("glVertexAttribI4sv"); 907 glad_glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)load("glVertexAttribI4ubv"); 908 glad_glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)load("glVertexAttribI4usv"); 909 glad_glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)load("glGetUniformuiv"); 910 glad_glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)load("glBindFragDataLocation"); 911 glad_glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)load("glGetFragDataLocation"); 912 glad_glUniform1ui = (PFNGLUNIFORM1UIPROC)load("glUniform1ui"); 913 glad_glUniform2ui = (PFNGLUNIFORM2UIPROC)load("glUniform2ui"); 914 glad_glUniform3ui = (PFNGLUNIFORM3UIPROC)load("glUniform3ui"); 915 glad_glUniform4ui = (PFNGLUNIFORM4UIPROC)load("glUniform4ui"); 916 glad_glUniform1uiv = (PFNGLUNIFORM1UIVPROC)load("glUniform1uiv"); 917 glad_glUniform2uiv = (PFNGLUNIFORM2UIVPROC)load("glUniform2uiv"); 918 glad_glUniform3uiv = (PFNGLUNIFORM3UIVPROC)load("glUniform3uiv"); 919 glad_glUniform4uiv = (PFNGLUNIFORM4UIVPROC)load("glUniform4uiv"); 920 glad_glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)load("glTexParameterIiv"); 921 glad_glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)load("glTexParameterIuiv"); 922 glad_glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)load("glGetTexParameterIiv"); 923 glad_glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)load("glGetTexParameterIuiv"); 924 glad_glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)load("glClearBufferiv"); 925 glad_glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)load("glClearBufferuiv"); 926 glad_glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)load("glClearBufferfv"); 927 glad_glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)load("glClearBufferfi"); 928 glad_glGetStringi = (PFNGLGETSTRINGIPROC)load("glGetStringi"); 929 glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)load("glIsRenderbuffer"); 930 glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)load("glBindRenderbuffer"); 931 glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)load("glDeleteRenderbuffers"); 932 glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)load("glGenRenderbuffers"); 933 glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)load("glRenderbufferStorage"); 934 glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)load("glGetRenderbufferParameteriv"); 935 glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)load("glIsFramebuffer"); 936 glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)load("glBindFramebuffer"); 937 glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)load("glDeleteFramebuffers"); 938 glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)load("glGenFramebuffers"); 939 glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)load("glCheckFramebufferStatus"); 940 glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)load("glFramebufferTexture1D"); 941 glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)load("glFramebufferTexture2D"); 942 glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)load("glFramebufferTexture3D"); 943 glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer"); 944 glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetFramebufferAttachmentParameteriv"); 945 glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)load("glGenerateMipmap"); 946 glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)load("glBlitFramebuffer"); 947 glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glRenderbufferStorageMultisample"); 948 glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)load("glFramebufferTextureLayer"); 949 glad_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)load("glMapBufferRange"); 950 glad_glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)load("glFlushMappedBufferRange"); 951 glad_glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)load("glBindVertexArray"); 952 glad_glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)load("glDeleteVertexArrays"); 953 glad_glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)load("glGenVertexArrays"); 954 glad_glIsVertexArray = (PFNGLISVERTEXARRAYPROC)load("glIsVertexArray"); 955 } 956 static void load_GL_VERSION_3_1(GLADloadproc load) { 957 if(!GLAD_GL_VERSION_3_1) return; 958 glad_glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)load("glDrawArraysInstanced"); 959 glad_glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)load("glDrawElementsInstanced"); 960 glad_glTexBuffer = (PFNGLTEXBUFFERPROC)load("glTexBuffer"); 961 glad_glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)load("glPrimitiveRestartIndex"); 962 glad_glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)load("glCopyBufferSubData"); 963 glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)load("glGetUniformIndices"); 964 glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)load("glGetActiveUniformsiv"); 965 glad_glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)load("glGetActiveUniformName"); 966 glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)load("glGetUniformBlockIndex"); 967 glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)load("glGetActiveUniformBlockiv"); 968 glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)load("glGetActiveUniformBlockName"); 969 glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)load("glUniformBlockBinding"); 970 glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); 971 glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); 972 glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); 973 } 974 static void load_GL_VERSION_3_2(GLADloadproc load) { 975 if(!GLAD_GL_VERSION_3_2) return; 976 glad_glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)load("glDrawElementsBaseVertex"); 977 glad_glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)load("glDrawRangeElementsBaseVertex"); 978 glad_glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)load("glDrawElementsInstancedBaseVertex"); 979 glad_glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)load("glMultiDrawElementsBaseVertex"); 980 glad_glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)load("glProvokingVertex"); 981 glad_glFenceSync = (PFNGLFENCESYNCPROC)load("glFenceSync"); 982 glad_glIsSync = (PFNGLISSYNCPROC)load("glIsSync"); 983 glad_glDeleteSync = (PFNGLDELETESYNCPROC)load("glDeleteSync"); 984 glad_glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)load("glClientWaitSync"); 985 glad_glWaitSync = (PFNGLWAITSYNCPROC)load("glWaitSync"); 986 glad_glGetInteger64v = (PFNGLGETINTEGER64VPROC)load("glGetInteger64v"); 987 glad_glGetSynciv = (PFNGLGETSYNCIVPROC)load("glGetSynciv"); 988 glad_glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)load("glGetInteger64i_v"); 989 glad_glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)load("glGetBufferParameteri64v"); 990 glad_glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)load("glFramebufferTexture"); 991 glad_glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)load("glTexImage2DMultisample"); 992 glad_glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)load("glTexImage3DMultisample"); 993 glad_glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)load("glGetMultisamplefv"); 994 glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC)load("glSampleMaski"); 995 } 996 static void load_GL_VERSION_3_3(GLADloadproc load) { 997 if(!GLAD_GL_VERSION_3_3) return; 998 glad_glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)load("glBindFragDataLocationIndexed"); 999 glad_glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)load("glGetFragDataIndex"); 1000 glad_glGenSamplers = (PFNGLGENSAMPLERSPROC)load("glGenSamplers"); 1001 glad_glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)load("glDeleteSamplers"); 1002 glad_glIsSampler = (PFNGLISSAMPLERPROC)load("glIsSampler"); 1003 glad_glBindSampler = (PFNGLBINDSAMPLERPROC)load("glBindSampler"); 1004 glad_glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)load("glSamplerParameteri"); 1005 glad_glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)load("glSamplerParameteriv"); 1006 glad_glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)load("glSamplerParameterf"); 1007 glad_glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)load("glSamplerParameterfv"); 1008 glad_glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)load("glSamplerParameterIiv"); 1009 glad_glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)load("glSamplerParameterIuiv"); 1010 glad_glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)load("glGetSamplerParameteriv"); 1011 glad_glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)load("glGetSamplerParameterIiv"); 1012 glad_glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)load("glGetSamplerParameterfv"); 1013 glad_glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)load("glGetSamplerParameterIuiv"); 1014 glad_glQueryCounter = (PFNGLQUERYCOUNTERPROC)load("glQueryCounter"); 1015 glad_glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)load("glGetQueryObjecti64v"); 1016 glad_glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)load("glGetQueryObjectui64v"); 1017 glad_glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)load("glVertexAttribDivisor"); 1018 glad_glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)load("glVertexAttribP1ui"); 1019 glad_glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)load("glVertexAttribP1uiv"); 1020 glad_glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)load("glVertexAttribP2ui"); 1021 glad_glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)load("glVertexAttribP2uiv"); 1022 glad_glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)load("glVertexAttribP3ui"); 1023 glad_glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)load("glVertexAttribP3uiv"); 1024 glad_glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)load("glVertexAttribP4ui"); 1025 glad_glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)load("glVertexAttribP4uiv"); 1026 glad_glVertexP2ui = (PFNGLVERTEXP2UIPROC)load("glVertexP2ui"); 1027 glad_glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)load("glVertexP2uiv"); 1028 glad_glVertexP3ui = (PFNGLVERTEXP3UIPROC)load("glVertexP3ui"); 1029 glad_glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)load("glVertexP3uiv"); 1030 glad_glVertexP4ui = (PFNGLVERTEXP4UIPROC)load("glVertexP4ui"); 1031 glad_glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)load("glVertexP4uiv"); 1032 glad_glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)load("glTexCoordP1ui"); 1033 glad_glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)load("glTexCoordP1uiv"); 1034 glad_glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)load("glTexCoordP2ui"); 1035 glad_glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)load("glTexCoordP2uiv"); 1036 glad_glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)load("glTexCoordP3ui"); 1037 glad_glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)load("glTexCoordP3uiv"); 1038 glad_glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)load("glTexCoordP4ui"); 1039 glad_glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)load("glTexCoordP4uiv"); 1040 glad_glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)load("glMultiTexCoordP1ui"); 1041 glad_glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)load("glMultiTexCoordP1uiv"); 1042 glad_glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)load("glMultiTexCoordP2ui"); 1043 glad_glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)load("glMultiTexCoordP2uiv"); 1044 glad_glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)load("glMultiTexCoordP3ui"); 1045 glad_glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)load("glMultiTexCoordP3uiv"); 1046 glad_glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)load("glMultiTexCoordP4ui"); 1047 glad_glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)load("glMultiTexCoordP4uiv"); 1048 glad_glNormalP3ui = (PFNGLNORMALP3UIPROC)load("glNormalP3ui"); 1049 glad_glNormalP3uiv = (PFNGLNORMALP3UIVPROC)load("glNormalP3uiv"); 1050 glad_glColorP3ui = (PFNGLCOLORP3UIPROC)load("glColorP3ui"); 1051 glad_glColorP3uiv = (PFNGLCOLORP3UIVPROC)load("glColorP3uiv"); 1052 glad_glColorP4ui = (PFNGLCOLORP4UIPROC)load("glColorP4ui"); 1053 glad_glColorP4uiv = (PFNGLCOLORP4UIVPROC)load("glColorP4uiv"); 1054 glad_glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)load("glSecondaryColorP3ui"); 1055 glad_glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)load("glSecondaryColorP3uiv"); 1056 } 1057 static void load_GL_AMD_debug_output(GLADloadproc load) { 1058 if(!GLAD_GL_AMD_debug_output) return; 1059 glad_glDebugMessageEnableAMD = (PFNGLDEBUGMESSAGEENABLEAMDPROC)load("glDebugMessageEnableAMD"); 1060 glad_glDebugMessageInsertAMD = (PFNGLDEBUGMESSAGEINSERTAMDPROC)load("glDebugMessageInsertAMD"); 1061 glad_glDebugMessageCallbackAMD = (PFNGLDEBUGMESSAGECALLBACKAMDPROC)load("glDebugMessageCallbackAMD"); 1062 glad_glGetDebugMessageLogAMD = (PFNGLGETDEBUGMESSAGELOGAMDPROC)load("glGetDebugMessageLogAMD"); 1063 } 1064 static void load_GL_KHR_debug(GLADloadproc load) { 1065 if(!GLAD_GL_KHR_debug) return; 1066 glad_glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)load("glDebugMessageControl"); 1067 glad_glDebugMessageInsert = (PFNGLDEBUGMESSAGEINSERTPROC)load("glDebugMessageInsert"); 1068 glad_glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)load("glDebugMessageCallback"); 1069 glad_glGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGPROC)load("glGetDebugMessageLog"); 1070 glad_glPushDebugGroup = (PFNGLPUSHDEBUGGROUPPROC)load("glPushDebugGroup"); 1071 glad_glPopDebugGroup = (PFNGLPOPDEBUGGROUPPROC)load("glPopDebugGroup"); 1072 glad_glObjectLabel = (PFNGLOBJECTLABELPROC)load("glObjectLabel"); 1073 glad_glGetObjectLabel = (PFNGLGETOBJECTLABELPROC)load("glGetObjectLabel"); 1074 glad_glObjectPtrLabel = (PFNGLOBJECTPTRLABELPROC)load("glObjectPtrLabel"); 1075 glad_glGetObjectPtrLabel = (PFNGLGETOBJECTPTRLABELPROC)load("glGetObjectPtrLabel"); 1076 glad_glGetPointerv = (PFNGLGETPOINTERVPROC)load("glGetPointerv"); 1077 glad_glDebugMessageControlKHR = (PFNGLDEBUGMESSAGECONTROLKHRPROC)load("glDebugMessageControlKHR"); 1078 glad_glDebugMessageInsertKHR = (PFNGLDEBUGMESSAGEINSERTKHRPROC)load("glDebugMessageInsertKHR"); 1079 glad_glDebugMessageCallbackKHR = (PFNGLDEBUGMESSAGECALLBACKKHRPROC)load("glDebugMessageCallbackKHR"); 1080 glad_glGetDebugMessageLogKHR = (PFNGLGETDEBUGMESSAGELOGKHRPROC)load("glGetDebugMessageLogKHR"); 1081 glad_glPushDebugGroupKHR = (PFNGLPUSHDEBUGGROUPKHRPROC)load("glPushDebugGroupKHR"); 1082 glad_glPopDebugGroupKHR = (PFNGLPOPDEBUGGROUPKHRPROC)load("glPopDebugGroupKHR"); 1083 glad_glObjectLabelKHR = (PFNGLOBJECTLABELKHRPROC)load("glObjectLabelKHR"); 1084 glad_glGetObjectLabelKHR = (PFNGLGETOBJECTLABELKHRPROC)load("glGetObjectLabelKHR"); 1085 glad_glObjectPtrLabelKHR = (PFNGLOBJECTPTRLABELKHRPROC)load("glObjectPtrLabelKHR"); 1086 glad_glGetObjectPtrLabelKHR = (PFNGLGETOBJECTPTRLABELKHRPROC)load("glGetObjectPtrLabelKHR"); 1087 glad_glGetPointervKHR = (PFNGLGETPOINTERVKHRPROC)load("glGetPointervKHR"); 1088 } 1089 static int find_extensionsGL(void) { 1090 if (!get_exts()) return 0; 1091 GLAD_GL_AMD_debug_output = has_ext("GL_AMD_debug_output"); 1092 GLAD_GL_EXT_texture_compression_s3tc = has_ext("GL_EXT_texture_compression_s3tc"); 1093 GLAD_GL_EXT_texture_sRGB = has_ext("GL_EXT_texture_sRGB"); 1094 GLAD_GL_EXT_texture_sRGB_decode = has_ext("GL_EXT_texture_sRGB_decode"); 1095 GLAD_GL_KHR_debug = has_ext("GL_KHR_debug"); 1096 free_exts(); 1097 return 1; 1098 } 1099 1100 static void find_coreGL(void) { 1101 1102 /* Thank you @elmindreda 1103 * https://github.com/elmindreda/greg/blob/master/templates/greg.c.in#L176 1104 * https://github.com/glfw/glfw/blob/master/src/context.c#L36 1105 */ 1106 int i, major, minor; 1107 1108 const char* version; 1109 const char* prefixes[] = { 1110 "OpenGL ES-CM ", 1111 "OpenGL ES-CL ", 1112 "OpenGL ES ", 1113 NULL 1114 }; 1115 1116 version = (const char*) glGetString(GL_VERSION); 1117 if (!version) return; 1118 1119 for (i = 0; prefixes[i]; i++) { 1120 const size_t length = strlen(prefixes[i]); 1121 if (strncmp(version, prefixes[i], length) == 0) { 1122 version += length; 1123 break; 1124 } 1125 } 1126 1127 /* PR #18 */ 1128 #ifdef _MSC_VER 1129 sscanf_s(version, "%d.%d", &major, &minor); 1130 #else 1131 sscanf(version, "%d.%d", &major, &minor); 1132 #endif 1133 1134 GLVersion.major = major; GLVersion.minor = minor; 1135 max_loaded_major = major; max_loaded_minor = minor; 1136 GLAD_GL_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1; 1137 GLAD_GL_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1; 1138 GLAD_GL_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1; 1139 GLAD_GL_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1; 1140 GLAD_GL_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1; 1141 GLAD_GL_VERSION_1_5 = (major == 1 && minor >= 5) || major > 1; 1142 GLAD_GL_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2; 1143 GLAD_GL_VERSION_2_1 = (major == 2 && minor >= 1) || major > 2; 1144 GLAD_GL_VERSION_3_0 = (major == 3 && minor >= 0) || major > 3; 1145 GLAD_GL_VERSION_3_1 = (major == 3 && minor >= 1) || major > 3; 1146 GLAD_GL_VERSION_3_2 = (major == 3 && minor >= 2) || major > 3; 1147 GLAD_GL_VERSION_3_3 = (major == 3 && minor >= 3) || major > 3; 1148 if (GLVersion.major > 3 || (GLVersion.major >= 3 && GLVersion.minor >= 3)) { 1149 max_loaded_major = 3; 1150 max_loaded_minor = 3; 1151 } 1152 } 1153 1154 int gladLoadGLLoader(GLADloadproc load) { 1155 GLVersion.major = 0; GLVersion.minor = 0; 1156 glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); 1157 if(glGetString == NULL) return 0; 1158 if(glGetString(GL_VERSION) == NULL) return 0; 1159 find_coreGL(); 1160 load_GL_VERSION_1_0(load); 1161 load_GL_VERSION_1_1(load); 1162 load_GL_VERSION_1_2(load); 1163 load_GL_VERSION_1_3(load); 1164 load_GL_VERSION_1_4(load); 1165 load_GL_VERSION_1_5(load); 1166 load_GL_VERSION_2_0(load); 1167 load_GL_VERSION_2_1(load); 1168 load_GL_VERSION_3_0(load); 1169 load_GL_VERSION_3_1(load); 1170 load_GL_VERSION_3_2(load); 1171 load_GL_VERSION_3_3(load); 1172 1173 if (!find_extensionsGL()) return 0; 1174 load_GL_AMD_debug_output(load); 1175 load_GL_KHR_debug(load); 1176 return GLVersion.major != 0 || GLVersion.minor != 0; 1177 } 1178