gl3w.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848
  1. /*
  2. * This file was generated with gl3w_gen.py, part of gl3w
  3. * (hosted at https://github.com/skaslev/gl3w)
  4. *
  5. * This is free and unencumbered software released into the public domain.
  6. *
  7. * Anyone is free to copy, modify, publish, use, compile, sell, or
  8. * distribute this software, either in source code form or as a compiled
  9. * binary, for any purpose, commercial or non-commercial, and by any
  10. * means.
  11. *
  12. * In jurisdictions that recognize copyright laws, the author or authors
  13. * of this software dedicate any and all copyright interest in the
  14. * software to the public domain. We make this dedication for the benefit
  15. * of the public at large and to the detriment of our heirs and
  16. * successors. We intend this dedication to be an overt act of
  17. * relinquishment in perpetuity of all present and future rights to this
  18. * software under copyright law.
  19. *
  20. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  21. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  22. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  23. * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
  24. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  25. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  26. * OTHER DEALINGS IN THE SOFTWARE.
  27. */
  28. #include <GL/gl3w.h>
  29. #include <stdlib.h>
  30. #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
  31. #if defined(_WIN32)
  32. #ifndef WIN32_LEAN_AND_MEAN
  33. #define WIN32_LEAN_AND_MEAN 1
  34. #endif
  35. #include <windows.h>
  36. static HMODULE libgl;
  37. typedef PROC(__stdcall* GL3WglGetProcAddr)(LPCSTR);
  38. static GL3WglGetProcAddr wgl_get_proc_address;
  39. static int open_libgl(void)
  40. {
  41. libgl = LoadLibraryA("opengl32.dll");
  42. if (!libgl)
  43. return GL3W_ERROR_LIBRARY_OPEN;
  44. wgl_get_proc_address = (GL3WglGetProcAddr)GetProcAddress(libgl, "wglGetProcAddress");
  45. return GL3W_OK;
  46. }
  47. static void close_libgl(void)
  48. {
  49. FreeLibrary(libgl);
  50. }
  51. static GL3WglProc get_proc(const char *proc)
  52. {
  53. GL3WglProc res;
  54. res = (GL3WglProc)wgl_get_proc_address(proc);
  55. if (!res)
  56. res = (GL3WglProc)GetProcAddress(libgl, proc);
  57. return res;
  58. }
  59. #elif defined(__APPLE__)
  60. #include <dlfcn.h>
  61. static void *libgl;
  62. static int open_libgl(void)
  63. {
  64. libgl = dlopen("/System/Library/Frameworks/OpenGL.framework/OpenGL", RTLD_LAZY | RTLD_LOCAL);
  65. if (!libgl)
  66. return GL3W_ERROR_LIBRARY_OPEN;
  67. return GL3W_OK;
  68. }
  69. static void close_libgl(void)
  70. {
  71. dlclose(libgl);
  72. }
  73. static GL3WglProc get_proc(const char *proc)
  74. {
  75. GL3WglProc res;
  76. *(void **)(&res) = dlsym(libgl, proc);
  77. return res;
  78. }
  79. #else
  80. #include <dlfcn.h>
  81. static void *libgl;
  82. static GL3WglProc (*glx_get_proc_address)(const GLubyte *);
  83. static int open_libgl(void)
  84. {
  85. libgl = dlopen("libGL.so.1", RTLD_LAZY | RTLD_LOCAL);
  86. if (!libgl)
  87. return GL3W_ERROR_LIBRARY_OPEN;
  88. *(void **)(&glx_get_proc_address) = dlsym(libgl, "glXGetProcAddressARB");
  89. return GL3W_OK;
  90. }
  91. static void close_libgl(void)
  92. {
  93. dlclose(libgl);
  94. }
  95. static GL3WglProc get_proc(const char *proc)
  96. {
  97. GL3WglProc res;
  98. res = glx_get_proc_address((const GLubyte *)proc);
  99. if (!res)
  100. *(void **)(&res) = dlsym(libgl, proc);
  101. return res;
  102. }
  103. #endif
  104. static struct {
  105. int major, minor;
  106. } version;
  107. static int parse_version(void)
  108. {
  109. if (!glGetIntegerv)
  110. return GL3W_ERROR_INIT;
  111. glGetIntegerv(GL_MAJOR_VERSION, &version.major);
  112. glGetIntegerv(GL_MINOR_VERSION, &version.minor);
  113. if (version.major < 3)
  114. return GL3W_ERROR_OPENGL_VERSION;
  115. return GL3W_OK;
  116. }
  117. static void load_procs(GL3WGetProcAddressProc proc);
  118. int gl3wInit(void)
  119. {
  120. int res;
  121. res = open_libgl();
  122. if (res)
  123. return res;
  124. atexit(close_libgl);
  125. return gl3wInit2(get_proc);
  126. }
  127. int gl3wInit2(GL3WGetProcAddressProc proc)
  128. {
  129. load_procs(proc);
  130. return parse_version();
  131. }
  132. int gl3wIsSupported(int major, int minor)
  133. {
  134. if (major < 3)
  135. return 0;
  136. if (version.major == major)
  137. return version.minor >= minor;
  138. return version.major >= major;
  139. }
  140. GL3WglProc gl3wGetProcAddress(const char *proc)
  141. {
  142. return get_proc(proc);
  143. }
  144. static const char *proc_names[] = {
  145. "glActiveShaderProgram",
  146. "glActiveTexture",
  147. "glAttachShader",
  148. "glBeginConditionalRender",
  149. "glBeginQuery",
  150. "glBeginQueryIndexed",
  151. "glBeginTransformFeedback",
  152. "glBindAttribLocation",
  153. "glBindBuffer",
  154. "glBindBufferBase",
  155. "glBindBufferRange",
  156. "glBindBuffersBase",
  157. "glBindBuffersRange",
  158. "glBindFragDataLocation",
  159. "glBindFragDataLocationIndexed",
  160. "glBindFramebuffer",
  161. "glBindImageTexture",
  162. "glBindImageTextures",
  163. "glBindProgramPipeline",
  164. "glBindRenderbuffer",
  165. "glBindSampler",
  166. "glBindSamplers",
  167. "glBindTexture",
  168. "glBindTextureUnit",
  169. "glBindTextures",
  170. "glBindTransformFeedback",
  171. "glBindVertexArray",
  172. "glBindVertexBuffer",
  173. "glBindVertexBuffers",
  174. "glBlendColor",
  175. "glBlendEquation",
  176. "glBlendEquationSeparate",
  177. "glBlendEquationSeparatei",
  178. "glBlendEquationi",
  179. "glBlendFunc",
  180. "glBlendFuncSeparate",
  181. "glBlendFuncSeparatei",
  182. "glBlendFunci",
  183. "glBlitFramebuffer",
  184. "glBlitNamedFramebuffer",
  185. "glBufferData",
  186. "glBufferStorage",
  187. "glBufferSubData",
  188. "glCheckFramebufferStatus",
  189. "glCheckNamedFramebufferStatus",
  190. "glClampColor",
  191. "glClear",
  192. "glClearBufferData",
  193. "glClearBufferSubData",
  194. "glClearBufferfi",
  195. "glClearBufferfv",
  196. "glClearBufferiv",
  197. "glClearBufferuiv",
  198. "glClearColor",
  199. "glClearDepth",
  200. "glClearDepthf",
  201. "glClearNamedBufferData",
  202. "glClearNamedBufferSubData",
  203. "glClearNamedFramebufferfi",
  204. "glClearNamedFramebufferfv",
  205. "glClearNamedFramebufferiv",
  206. "glClearNamedFramebufferuiv",
  207. "glClearStencil",
  208. "glClearTexImage",
  209. "glClearTexSubImage",
  210. "glClientWaitSync",
  211. "glClipControl",
  212. "glColorMask",
  213. "glColorMaski",
  214. "glCompileShader",
  215. "glCompressedTexImage1D",
  216. "glCompressedTexImage2D",
  217. "glCompressedTexImage3D",
  218. "glCompressedTexSubImage1D",
  219. "glCompressedTexSubImage2D",
  220. "glCompressedTexSubImage3D",
  221. "glCompressedTextureSubImage1D",
  222. "glCompressedTextureSubImage2D",
  223. "glCompressedTextureSubImage3D",
  224. "glCopyBufferSubData",
  225. "glCopyImageSubData",
  226. "glCopyNamedBufferSubData",
  227. "glCopyTexImage1D",
  228. "glCopyTexImage2D",
  229. "glCopyTexSubImage1D",
  230. "glCopyTexSubImage2D",
  231. "glCopyTexSubImage3D",
  232. "glCopyTextureSubImage1D",
  233. "glCopyTextureSubImage2D",
  234. "glCopyTextureSubImage3D",
  235. "glCreateBuffers",
  236. "glCreateFramebuffers",
  237. "glCreateProgram",
  238. "glCreateProgramPipelines",
  239. "glCreateQueries",
  240. "glCreateRenderbuffers",
  241. "glCreateSamplers",
  242. "glCreateShader",
  243. "glCreateShaderProgramv",
  244. "glCreateTextures",
  245. "glCreateTransformFeedbacks",
  246. "glCreateVertexArrays",
  247. "glCullFace",
  248. "glDebugMessageCallback",
  249. "glDebugMessageControl",
  250. "glDebugMessageInsert",
  251. "glDeleteBuffers",
  252. "glDeleteFramebuffers",
  253. "glDeleteProgram",
  254. "glDeleteProgramPipelines",
  255. "glDeleteQueries",
  256. "glDeleteRenderbuffers",
  257. "glDeleteSamplers",
  258. "glDeleteShader",
  259. "glDeleteSync",
  260. "glDeleteTextures",
  261. "glDeleteTransformFeedbacks",
  262. "glDeleteVertexArrays",
  263. "glDepthFunc",
  264. "glDepthMask",
  265. "glDepthRange",
  266. "glDepthRangeArrayv",
  267. "glDepthRangeIndexed",
  268. "glDepthRangef",
  269. "glDetachShader",
  270. "glDisable",
  271. "glDisableVertexArrayAttrib",
  272. "glDisableVertexAttribArray",
  273. "glDisablei",
  274. "glDispatchCompute",
  275. "glDispatchComputeIndirect",
  276. "glDrawArrays",
  277. "glDrawArraysIndirect",
  278. "glDrawArraysInstanced",
  279. "glDrawArraysInstancedBaseInstance",
  280. "glDrawBuffer",
  281. "glDrawBuffers",
  282. "glDrawElements",
  283. "glDrawElementsBaseVertex",
  284. "glDrawElementsIndirect",
  285. "glDrawElementsInstanced",
  286. "glDrawElementsInstancedBaseInstance",
  287. "glDrawElementsInstancedBaseVertex",
  288. "glDrawElementsInstancedBaseVertexBaseInstance",
  289. "glDrawRangeElements",
  290. "glDrawRangeElementsBaseVertex",
  291. "glDrawTransformFeedback",
  292. "glDrawTransformFeedbackInstanced",
  293. "glDrawTransformFeedbackStream",
  294. "glDrawTransformFeedbackStreamInstanced",
  295. "glEnable",
  296. "glEnableVertexArrayAttrib",
  297. "glEnableVertexAttribArray",
  298. "glEnablei",
  299. "glEndConditionalRender",
  300. "glEndQuery",
  301. "glEndQueryIndexed",
  302. "glEndTransformFeedback",
  303. "glFenceSync",
  304. "glFinish",
  305. "glFlush",
  306. "glFlushMappedBufferRange",
  307. "glFlushMappedNamedBufferRange",
  308. "glFramebufferParameteri",
  309. "glFramebufferParameteriMESA",
  310. "glFramebufferRenderbuffer",
  311. "glFramebufferTexture",
  312. "glFramebufferTexture1D",
  313. "glFramebufferTexture2D",
  314. "glFramebufferTexture3D",
  315. "glFramebufferTextureLayer",
  316. "glFrontFace",
  317. "glGenBuffers",
  318. "glGenFramebuffers",
  319. "glGenProgramPipelines",
  320. "glGenQueries",
  321. "glGenRenderbuffers",
  322. "glGenSamplers",
  323. "glGenTextures",
  324. "glGenTransformFeedbacks",
  325. "glGenVertexArrays",
  326. "glGenerateMipmap",
  327. "glGenerateTextureMipmap",
  328. "glGetActiveAtomicCounterBufferiv",
  329. "glGetActiveAttrib",
  330. "glGetActiveSubroutineName",
  331. "glGetActiveSubroutineUniformName",
  332. "glGetActiveSubroutineUniformiv",
  333. "glGetActiveUniform",
  334. "glGetActiveUniformBlockName",
  335. "glGetActiveUniformBlockiv",
  336. "glGetActiveUniformName",
  337. "glGetActiveUniformsiv",
  338. "glGetAttachedShaders",
  339. "glGetAttribLocation",
  340. "glGetBooleani_v",
  341. "glGetBooleanv",
  342. "glGetBufferParameteri64v",
  343. "glGetBufferParameteriv",
  344. "glGetBufferPointerv",
  345. "glGetBufferSubData",
  346. "glGetCompressedTexImage",
  347. "glGetCompressedTextureImage",
  348. "glGetCompressedTextureSubImage",
  349. "glGetDebugMessageLog",
  350. "glGetDoublei_v",
  351. "glGetDoublev",
  352. "glGetError",
  353. "glGetFloati_v",
  354. "glGetFloatv",
  355. "glGetFragDataIndex",
  356. "glGetFragDataLocation",
  357. "glGetFramebufferAttachmentParameteriv",
  358. "glGetFramebufferParameteriv",
  359. "glGetFramebufferParameterivMESA",
  360. "glGetGraphicsResetStatus",
  361. "glGetInteger64i_v",
  362. "glGetInteger64v",
  363. "glGetIntegeri_v",
  364. "glGetIntegerv",
  365. "glGetInternalformati64v",
  366. "glGetInternalformativ",
  367. "glGetMultisamplefv",
  368. "glGetNamedBufferParameteri64v",
  369. "glGetNamedBufferParameteriv",
  370. "glGetNamedBufferPointerv",
  371. "glGetNamedBufferSubData",
  372. "glGetNamedFramebufferAttachmentParameteriv",
  373. "glGetNamedFramebufferParameteriv",
  374. "glGetNamedRenderbufferParameteriv",
  375. "glGetObjectLabel",
  376. "glGetObjectPtrLabel",
  377. "glGetPointerv",
  378. "glGetProgramBinary",
  379. "glGetProgramInfoLog",
  380. "glGetProgramInterfaceiv",
  381. "glGetProgramPipelineInfoLog",
  382. "glGetProgramPipelineiv",
  383. "glGetProgramResourceIndex",
  384. "glGetProgramResourceLocation",
  385. "glGetProgramResourceLocationIndex",
  386. "glGetProgramResourceName",
  387. "glGetProgramResourceiv",
  388. "glGetProgramStageiv",
  389. "glGetProgramiv",
  390. "glGetQueryBufferObjecti64v",
  391. "glGetQueryBufferObjectiv",
  392. "glGetQueryBufferObjectui64v",
  393. "glGetQueryBufferObjectuiv",
  394. "glGetQueryIndexediv",
  395. "glGetQueryObjecti64v",
  396. "glGetQueryObjectiv",
  397. "glGetQueryObjectui64v",
  398. "glGetQueryObjectuiv",
  399. "glGetQueryiv",
  400. "glGetRenderbufferParameteriv",
  401. "glGetSamplerParameterIiv",
  402. "glGetSamplerParameterIuiv",
  403. "glGetSamplerParameterfv",
  404. "glGetSamplerParameteriv",
  405. "glGetShaderInfoLog",
  406. "glGetShaderPrecisionFormat",
  407. "glGetShaderSource",
  408. "glGetShaderiv",
  409. "glGetString",
  410. "glGetStringi",
  411. "glGetSubroutineIndex",
  412. "glGetSubroutineUniformLocation",
  413. "glGetSynciv",
  414. "glGetTexImage",
  415. "glGetTexLevelParameterfv",
  416. "glGetTexLevelParameteriv",
  417. "glGetTexParameterIiv",
  418. "glGetTexParameterIuiv",
  419. "glGetTexParameterfv",
  420. "glGetTexParameteriv",
  421. "glGetTextureImage",
  422. "glGetTextureLevelParameterfv",
  423. "glGetTextureLevelParameteriv",
  424. "glGetTextureParameterIiv",
  425. "glGetTextureParameterIuiv",
  426. "glGetTextureParameterfv",
  427. "glGetTextureParameteriv",
  428. "glGetTextureSubImage",
  429. "glGetTransformFeedbackVarying",
  430. "glGetTransformFeedbacki64_v",
  431. "glGetTransformFeedbacki_v",
  432. "glGetTransformFeedbackiv",
  433. "glGetUniformBlockIndex",
  434. "glGetUniformIndices",
  435. "glGetUniformLocation",
  436. "glGetUniformSubroutineuiv",
  437. "glGetUniformdv",
  438. "glGetUniformfv",
  439. "glGetUniformiv",
  440. "glGetUniformuiv",
  441. "glGetVertexArrayIndexed64iv",
  442. "glGetVertexArrayIndexediv",
  443. "glGetVertexArrayiv",
  444. "glGetVertexAttribIiv",
  445. "glGetVertexAttribIuiv",
  446. "glGetVertexAttribLdv",
  447. "glGetVertexAttribPointerv",
  448. "glGetVertexAttribdv",
  449. "glGetVertexAttribfv",
  450. "glGetVertexAttribiv",
  451. "glGetnCompressedTexImage",
  452. "glGetnTexImage",
  453. "glGetnUniformdv",
  454. "glGetnUniformfv",
  455. "glGetnUniformiv",
  456. "glGetnUniformuiv",
  457. "glHint",
  458. "glInvalidateBufferData",
  459. "glInvalidateBufferSubData",
  460. "glInvalidateFramebuffer",
  461. "glInvalidateNamedFramebufferData",
  462. "glInvalidateNamedFramebufferSubData",
  463. "glInvalidateSubFramebuffer",
  464. "glInvalidateTexImage",
  465. "glInvalidateTexSubImage",
  466. "glIsBuffer",
  467. "glIsEnabled",
  468. "glIsEnabledi",
  469. "glIsFramebuffer",
  470. "glIsProgram",
  471. "glIsProgramPipeline",
  472. "glIsQuery",
  473. "glIsRenderbuffer",
  474. "glIsSampler",
  475. "glIsShader",
  476. "glIsSync",
  477. "glIsTexture",
  478. "glIsTransformFeedback",
  479. "glIsVertexArray",
  480. "glLineWidth",
  481. "glLinkProgram",
  482. "glLogicOp",
  483. "glMapBuffer",
  484. "glMapBufferRange",
  485. "glMapNamedBuffer",
  486. "glMapNamedBufferRange",
  487. "glMemoryBarrier",
  488. "glMemoryBarrierByRegion",
  489. "glMinSampleShading",
  490. "glMultiDrawArrays",
  491. "glMultiDrawArraysIndirect",
  492. "glMultiDrawArraysIndirectCount",
  493. "glMultiDrawElements",
  494. "glMultiDrawElementsBaseVertex",
  495. "glMultiDrawElementsIndirect",
  496. "glMultiDrawElementsIndirectCount",
  497. "glNamedBufferData",
  498. "glNamedBufferStorage",
  499. "glNamedBufferSubData",
  500. "glNamedFramebufferDrawBuffer",
  501. "glNamedFramebufferDrawBuffers",
  502. "glNamedFramebufferParameteri",
  503. "glNamedFramebufferReadBuffer",
  504. "glNamedFramebufferRenderbuffer",
  505. "glNamedFramebufferTexture",
  506. "glNamedFramebufferTextureLayer",
  507. "glNamedRenderbufferStorage",
  508. "glNamedRenderbufferStorageMultisample",
  509. "glObjectLabel",
  510. "glObjectPtrLabel",
  511. "glPatchParameterfv",
  512. "glPatchParameteri",
  513. "glPauseTransformFeedback",
  514. "glPixelStoref",
  515. "glPixelStorei",
  516. "glPointParameterf",
  517. "glPointParameterfv",
  518. "glPointParameteri",
  519. "glPointParameteriv",
  520. "glPointSize",
  521. "glPolygonMode",
  522. "glPolygonOffset",
  523. "glPolygonOffsetClamp",
  524. "glPopDebugGroup",
  525. "glPrimitiveRestartIndex",
  526. "glProgramBinary",
  527. "glProgramParameteri",
  528. "glProgramUniform1d",
  529. "glProgramUniform1dv",
  530. "glProgramUniform1f",
  531. "glProgramUniform1fv",
  532. "glProgramUniform1i",
  533. "glProgramUniform1iv",
  534. "glProgramUniform1ui",
  535. "glProgramUniform1uiv",
  536. "glProgramUniform2d",
  537. "glProgramUniform2dv",
  538. "glProgramUniform2f",
  539. "glProgramUniform2fv",
  540. "glProgramUniform2i",
  541. "glProgramUniform2iv",
  542. "glProgramUniform2ui",
  543. "glProgramUniform2uiv",
  544. "glProgramUniform3d",
  545. "glProgramUniform3dv",
  546. "glProgramUniform3f",
  547. "glProgramUniform3fv",
  548. "glProgramUniform3i",
  549. "glProgramUniform3iv",
  550. "glProgramUniform3ui",
  551. "glProgramUniform3uiv",
  552. "glProgramUniform4d",
  553. "glProgramUniform4dv",
  554. "glProgramUniform4f",
  555. "glProgramUniform4fv",
  556. "glProgramUniform4i",
  557. "glProgramUniform4iv",
  558. "glProgramUniform4ui",
  559. "glProgramUniform4uiv",
  560. "glProgramUniformMatrix2dv",
  561. "glProgramUniformMatrix2fv",
  562. "glProgramUniformMatrix2x3dv",
  563. "glProgramUniformMatrix2x3fv",
  564. "glProgramUniformMatrix2x4dv",
  565. "glProgramUniformMatrix2x4fv",
  566. "glProgramUniformMatrix3dv",
  567. "glProgramUniformMatrix3fv",
  568. "glProgramUniformMatrix3x2dv",
  569. "glProgramUniformMatrix3x2fv",
  570. "glProgramUniformMatrix3x4dv",
  571. "glProgramUniformMatrix3x4fv",
  572. "glProgramUniformMatrix4dv",
  573. "glProgramUniformMatrix4fv",
  574. "glProgramUniformMatrix4x2dv",
  575. "glProgramUniformMatrix4x2fv",
  576. "glProgramUniformMatrix4x3dv",
  577. "glProgramUniformMatrix4x3fv",
  578. "glProvokingVertex",
  579. "glPushDebugGroup",
  580. "glQueryCounter",
  581. "glReadBuffer",
  582. "glReadPixels",
  583. "glReadnPixels",
  584. "glReleaseShaderCompiler",
  585. "glRenderbufferStorage",
  586. "glRenderbufferStorageMultisample",
  587. "glResumeTransformFeedback",
  588. "glSampleCoverage",
  589. "glSampleMaski",
  590. "glSamplerParameterIiv",
  591. "glSamplerParameterIuiv",
  592. "glSamplerParameterf",
  593. "glSamplerParameterfv",
  594. "glSamplerParameteri",
  595. "glSamplerParameteriv",
  596. "glScissor",
  597. "glScissorArrayv",
  598. "glScissorIndexed",
  599. "glScissorIndexedv",
  600. "glShaderBinary",
  601. "glShaderSource",
  602. "glShaderStorageBlockBinding",
  603. "glSpecializeShader",
  604. "glStencilFunc",
  605. "glStencilFuncSeparate",
  606. "glStencilMask",
  607. "glStencilMaskSeparate",
  608. "glStencilOp",
  609. "glStencilOpSeparate",
  610. "glTexBuffer",
  611. "glTexBufferRange",
  612. "glTexImage1D",
  613. "glTexImage2D",
  614. "glTexImage2DMultisample",
  615. "glTexImage3D",
  616. "glTexImage3DMultisample",
  617. "glTexParameterIiv",
  618. "glTexParameterIuiv",
  619. "glTexParameterf",
  620. "glTexParameterfv",
  621. "glTexParameteri",
  622. "glTexParameteriv",
  623. "glTexStorage1D",
  624. "glTexStorage2D",
  625. "glTexStorage2DMultisample",
  626. "glTexStorage3D",
  627. "glTexStorage3DMultisample",
  628. "glTexSubImage1D",
  629. "glTexSubImage2D",
  630. "glTexSubImage3D",
  631. "glTextureBarrier",
  632. "glTextureBuffer",
  633. "glTextureBufferRange",
  634. "glTextureParameterIiv",
  635. "glTextureParameterIuiv",
  636. "glTextureParameterf",
  637. "glTextureParameterfv",
  638. "glTextureParameteri",
  639. "glTextureParameteriv",
  640. "glTextureStorage1D",
  641. "glTextureStorage2D",
  642. "glTextureStorage2DMultisample",
  643. "glTextureStorage3D",
  644. "glTextureStorage3DMultisample",
  645. "glTextureSubImage1D",
  646. "glTextureSubImage2D",
  647. "glTextureSubImage3D",
  648. "glTextureView",
  649. "glTransformFeedbackBufferBase",
  650. "glTransformFeedbackBufferRange",
  651. "glTransformFeedbackVaryings",
  652. "glUniform1d",
  653. "glUniform1dv",
  654. "glUniform1f",
  655. "glUniform1fv",
  656. "glUniform1i",
  657. "glUniform1iv",
  658. "glUniform1ui",
  659. "glUniform1uiv",
  660. "glUniform2d",
  661. "glUniform2dv",
  662. "glUniform2f",
  663. "glUniform2fv",
  664. "glUniform2i",
  665. "glUniform2iv",
  666. "glUniform2ui",
  667. "glUniform2uiv",
  668. "glUniform3d",
  669. "glUniform3dv",
  670. "glUniform3f",
  671. "glUniform3fv",
  672. "glUniform3i",
  673. "glUniform3iv",
  674. "glUniform3ui",
  675. "glUniform3uiv",
  676. "glUniform4d",
  677. "glUniform4dv",
  678. "glUniform4f",
  679. "glUniform4fv",
  680. "glUniform4i",
  681. "glUniform4iv",
  682. "glUniform4ui",
  683. "glUniform4uiv",
  684. "glUniformBlockBinding",
  685. "glUniformMatrix2dv",
  686. "glUniformMatrix2fv",
  687. "glUniformMatrix2x3dv",
  688. "glUniformMatrix2x3fv",
  689. "glUniformMatrix2x4dv",
  690. "glUniformMatrix2x4fv",
  691. "glUniformMatrix3dv",
  692. "glUniformMatrix3fv",
  693. "glUniformMatrix3x2dv",
  694. "glUniformMatrix3x2fv",
  695. "glUniformMatrix3x4dv",
  696. "glUniformMatrix3x4fv",
  697. "glUniformMatrix4dv",
  698. "glUniformMatrix4fv",
  699. "glUniformMatrix4x2dv",
  700. "glUniformMatrix4x2fv",
  701. "glUniformMatrix4x3dv",
  702. "glUniformMatrix4x3fv",
  703. "glUniformSubroutinesuiv",
  704. "glUnmapBuffer",
  705. "glUnmapNamedBuffer",
  706. "glUseProgram",
  707. "glUseProgramStages",
  708. "glValidateProgram",
  709. "glValidateProgramPipeline",
  710. "glVertexArrayAttribBinding",
  711. "glVertexArrayAttribFormat",
  712. "glVertexArrayAttribIFormat",
  713. "glVertexArrayAttribLFormat",
  714. "glVertexArrayBindingDivisor",
  715. "glVertexArrayElementBuffer",
  716. "glVertexArrayVertexBuffer",
  717. "glVertexArrayVertexBuffers",
  718. "glVertexAttrib1d",
  719. "glVertexAttrib1dv",
  720. "glVertexAttrib1f",
  721. "glVertexAttrib1fv",
  722. "glVertexAttrib1s",
  723. "glVertexAttrib1sv",
  724. "glVertexAttrib2d",
  725. "glVertexAttrib2dv",
  726. "glVertexAttrib2f",
  727. "glVertexAttrib2fv",
  728. "glVertexAttrib2s",
  729. "glVertexAttrib2sv",
  730. "glVertexAttrib3d",
  731. "glVertexAttrib3dv",
  732. "glVertexAttrib3f",
  733. "glVertexAttrib3fv",
  734. "glVertexAttrib3s",
  735. "glVertexAttrib3sv",
  736. "glVertexAttrib4Nbv",
  737. "glVertexAttrib4Niv",
  738. "glVertexAttrib4Nsv",
  739. "glVertexAttrib4Nub",
  740. "glVertexAttrib4Nubv",
  741. "glVertexAttrib4Nuiv",
  742. "glVertexAttrib4Nusv",
  743. "glVertexAttrib4bv",
  744. "glVertexAttrib4d",
  745. "glVertexAttrib4dv",
  746. "glVertexAttrib4f",
  747. "glVertexAttrib4fv",
  748. "glVertexAttrib4iv",
  749. "glVertexAttrib4s",
  750. "glVertexAttrib4sv",
  751. "glVertexAttrib4ubv",
  752. "glVertexAttrib4uiv",
  753. "glVertexAttrib4usv",
  754. "glVertexAttribBinding",
  755. "glVertexAttribDivisor",
  756. "glVertexAttribFormat",
  757. "glVertexAttribI1i",
  758. "glVertexAttribI1iv",
  759. "glVertexAttribI1ui",
  760. "glVertexAttribI1uiv",
  761. "glVertexAttribI2i",
  762. "glVertexAttribI2iv",
  763. "glVertexAttribI2ui",
  764. "glVertexAttribI2uiv",
  765. "glVertexAttribI3i",
  766. "glVertexAttribI3iv",
  767. "glVertexAttribI3ui",
  768. "glVertexAttribI3uiv",
  769. "glVertexAttribI4bv",
  770. "glVertexAttribI4i",
  771. "glVertexAttribI4iv",
  772. "glVertexAttribI4sv",
  773. "glVertexAttribI4ubv",
  774. "glVertexAttribI4ui",
  775. "glVertexAttribI4uiv",
  776. "glVertexAttribI4usv",
  777. "glVertexAttribIFormat",
  778. "glVertexAttribIPointer",
  779. "glVertexAttribL1d",
  780. "glVertexAttribL1dv",
  781. "glVertexAttribL2d",
  782. "glVertexAttribL2dv",
  783. "glVertexAttribL3d",
  784. "glVertexAttribL3dv",
  785. "glVertexAttribL4d",
  786. "glVertexAttribL4dv",
  787. "glVertexAttribLFormat",
  788. "glVertexAttribLPointer",
  789. "glVertexAttribP1ui",
  790. "glVertexAttribP1uiv",
  791. "glVertexAttribP2ui",
  792. "glVertexAttribP2uiv",
  793. "glVertexAttribP3ui",
  794. "glVertexAttribP3uiv",
  795. "glVertexAttribP4ui",
  796. "glVertexAttribP4uiv",
  797. "glVertexAttribPointer",
  798. "glVertexBindingDivisor",
  799. "glViewport",
  800. "glViewportArrayv",
  801. "glViewportIndexedf",
  802. "glViewportIndexedfv",
  803. "glWaitSync",
  804. };
  805. GL3W_API union GL3WProcs gl3wProcs;
  806. static void load_procs(GL3WGetProcAddressProc proc)
  807. {
  808. size_t i;
  809. for (i = 0; i < ARRAY_SIZE(proc_names); i++)
  810. gl3wProcs.ptr[i] = proc(proc_names[i]);
  811. }