🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1141 lines
59 KiB

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