当前位置:   article > 正文

OpenGL案例理解MVP矩阵(Model View Projection)_opengl mvp

opengl mvp

MVP变换是图形学的基础,也是理解的难点。理论解释看了很多遍,每次都似懂非懂结果下次用到又忘了……这次在学习OpenGL的过程中看到了官方案例,能很直观地帮助我们理解MVP矩阵。LearnOpenGL真的是学习OpenGL的保姆级教材,强推!!!

本文用到的案例来源于《LearnOpenGL》坐标系统一章中所给出的最后一个案例

案例来源:坐标系统 - LearnOpenGL

a77c40226ae84467918bb0c73620cbad.png

 案例源代码及配置方式详见本文末尾。

MVP变换

 在图形渲染管线中,MVP变换发生在顶点着色器(vertex shader)中。在OpenGL中,对应于顶点着色器代码文件中的这样一段内容:

  1. #version 330 core
  2. layout (location = 0) in vec3 aPos;
  3. ...
  4. uniform mat4 model;
  5. uniform mat4 view;
  6. uniform mat4 projection;
  7. void main()
  8. {
  9. // Model-View-Projection变换
  10. gl_Position = projection * view * model * vec4(aPos, 1.0);
  11. ...
  12. }

其中,aPos是一个从外部输入的三维坐标,它被齐次化为(x,y,z,1)的形式。model、view、projection是三个4x4的矩阵,其值也来自于外部输入。顶点着色器最终将经过MVP变换的顶点坐标赋值给OpenGL中预定义的gl_Position,即完成了MVP变换。

我们想要了解的是aPos、model、view、projection分别代表什么,接下来将结合案例代码讲解。

aPos数组:物体的顶点坐标

在案例的main.cpp中可以找到一个名叫vertices的float数组,这就是顶点着色器中aPos所对应的值。

  1. //每行只看前三个数即可,后两个数对应纹理坐标,与MVP变换无关
  2. float vertices[] = {
  3. -0.5f, -0.5f, -0.5f, 0.0f, 0.0f,
  4. 0.5f, -0.5f, -0.5f, 1.0f, 0.0f,
  5. 0.5f, 0.5f, -0.5f, 1.0f, 1.0f,
  6. 0.5f, 0.5f, -0.5f, 1.0f, 1.0f,
  7. -0.5f, 0.5f, -0.5f, 0.0f, 1.0f,
  8. -0.5f, -0.5f, -0.5f, 0.0f, 0.0f,
  9. -0.5f, -0.5f, 0.5f, 0.0f, 0.0f,
  10. 0.5f, -0.5f, 0.5f, 1.0f, 0.0f,
  11. 0.5f, 0.5f, 0.5f, 1.0f, 1.0f,
  12. 0.5f, 0.5f, 0.5f, 1.0f, 1.0f,
  13. -0.5f, 0.5f, 0.5f, 0.0f, 1.0f,
  14. -0.5f, -0.5f, 0.5f, 0.0f, 0.0f,
  15. -0.5f, 0.5f, 0.5f, 1.0f, 0.0f,
  16. -0.5f, 0.5f, -0.5f, 1.0f, 1.0f,
  17. -0.5f, -0.5f, -0.5f, 0.0f, 1.0f,
  18. -0.5f, -0.5f, -0.5f, 0.0f, 1.0f,
  19. -0.5f, -0.5f, 0.5f, 0.0f, 0.0f,
  20. -0.5f, 0.5f, 0.5f, 1.0f, 0.0f,
  21. 0.5f, 0.5f, 0.5f, 1.0f, 0.0f,
  22. 0.5f, 0.5f, -0.5f, 1.0f, 1.0f,
  23. 0.5f, -0.5f, -0.5f, 0.0f, 1.0f,
  24. 0.5f, -0.5f, -0.5f, 0.0f, 1.0f,
  25. 0.5f, -0.5f, 0.5f, 0.0f, 0.0f,
  26. 0.5f, 0.5f, 0.5f, 1.0f, 0.0f,
  27. -0.5f, -0.5f, -0.5f, 0.0f, 1.0f,
  28. 0.5f, -0.5f, -0.5f, 1.0f, 1.0f,
  29. 0.5f, -0.5f, 0.5f, 1.0f, 0.0f,
  30. 0.5f, -0.5f, 0.5f, 1.0f, 0.0f,
  31. -0.5f, -0.5f, 0.5f, 0.0f, 0.0f,
  32. -0.5f, -0.5f, -0.5f, 0.0f, 1.0f,
  33. -0.5f, 0.5f, -0.5f, 0.0f, 1.0f,
  34. 0.5f, 0.5f, -0.5f, 1.0f, 1.0f,
  35. 0.5f, 0.5f, 0.5f, 1.0f, 0.0f,
  36. 0.5f, 0.5f, 0.5f, 1.0f, 0.0f,
  37. -0.5f, 0.5f, 0.5f, 0.0f, 0.0f,
  38. -0.5f, 0.5f, -0.5f, 0.0f, 1.0f
  39. };

其中每一行的前三个数对应了一个顶点的(x,y,z)坐标。你可能会问,一个正方体不是只有8个顶点吗,为什么这里有36行?这是因为,OpenGL以三角形的方式绘制物体。1个正方体由6个正方形面构成,1个正方形由2个三角形构成,1个三角形又有3个顶点,所以共需要定义6x2x3=36个顶点。

不用在意这些细节,总之我们可以发现,这个数组定义了从(-0.5,-0.5,-0.5) ~ (0.5,0.5,0.5)的正方体的顶点,如下图所示。

d4308545125f4168bc134d6b4df7fae4.png

model矩阵:确定物体间的相对位置

在案例的main.cpp中,有这样一段代码:

  1. glm::vec3 cubePositions[] = {
  2. glm::vec3( 0.0f, 0.0f, 0.0f),
  3. glm::vec3( 2.0f, 5.0f, -15.0f),
  4. glm::vec3(-1.5f, -2.2f, -2.5f),
  5. glm::vec3(-3.8f, -2.0f, -12.3f),
  6. glm::vec3( 2.4f, -0.4f, -3.5f),
  7. glm::vec3(-1.7f, 3.0f, -7.5f),
  8. glm::vec3( 1.3f, -2.0f, -2.5f),
  9. glm::vec3( 1.5f, 2.0f, -2.5f),
  10. glm::vec3( 1.5f, 0.2f, -1.5f),
  11. glm::vec3(-1.3f, 1.0f, -1.5f)
  12. };
  13. // ....
  14. for (unsigned int i = 0; i < 10; i++)
  15. {
  16. // 为每个正方体计算model矩阵
  17. // 初始化model矩阵为4x4的单位阵
  18. glm::mat4 model = glm::mat4(1.0f);
  19. // 平移cobePositions[i]
  20. model = glm::translate(model, cubePositions[i]);
  21. float angle = 20.0f * i;
  22. // 绕轴(1,0.3,0.5)逆时针旋转20*i度
  23. model = glm::rotate(model, glm::radians(angle), glm::vec3(1.0f, 0.3f, 0.5f));
  24. //把计算好的model矩阵赋值给vertex shader中定义的model变量
  25. ourShader.setMat4("model", model);
  26. //绘制图形
  27. glDrawArrays(GL_TRIANGLES, 0, 36);
  28. }

可以将model矩阵理解为对平移、旋转、放缩操作的集合。比如,对cube[1],先平移(2,5,-15)再绕轴旋转20度;对cube[2],先平移(-1.5,-2.2,-2.5)再绕轴旋转40度……在这个for循环中(循环10次是因为案例中要产生10个正方体)通过对每个正方体计算model矩阵,我们确定了这10个正方体间的相对位置。

可以对cubePositions数组或者rotate函数中的角度与旋转轴进行修改,帮助理解model矩阵的作用。比如,我将rotate函数中的旋转轴改为(0,0,1),得到了这样的效果:

1863263590794eab9c0766d521948b85.png

 view矩阵:确定物体与“相机”的相对位置

 之所以给相机打引号,是因为OpenGL中其实不存在专门的相机。gl_Position = projection * view * model * aPos这个式子也说明,mvp矩阵的作用对象其实都是物体的顶点,所谓相机只是一个为了便于理解而产生的概念,而view矩阵的目的就是确定物体与相机的相对位置。注意,此处的物体指的是全部的物体形成的集合,也就是案例中的十个正方体形成的组,而不是某个单一物体。

在main.cpp中,有这样一段代码:

  1. // 初始化view矩阵为4x4的单位阵
  2. glm::mat4 view = glm::mat4(1.0f);
  3. view = glm::translate(view, glm::vec3(0.0f, 0.0f, -3.0f));
  4. // 把计算好的view矩阵赋值给vertex shader中的view变量
  5. ourShader.setMat4("view", view);

此处设置的view矩阵非常简单,它仅仅告诉我们物体位于相对相机(0,0,-3)的位置上。如果将其view改为glm::translate(view, glm::vec3(0.0f, 0.0f, -5.0f));,可以看到物体看起来变得更远了,因为此时物体位于相对相机(0,0,-5)的位置上了。

我设置了更复杂的view矩阵,让物体位于相对相机(1,1,-5)的位置上,并绕z轴逆时针旋转了45度。

  1. view = glm::translate(view, glm::vec3(1.0f, 1.0f, -5.0f));
  2. view = glm::rotate(view, glm::radians(45.0f), glm::vec3(0.0f, 0.0f, 1.0f));

7210c9b540174f5cb5d60d205400c626.png

OpenGL的坐标系遵循右手定则,设置的时候不要写反哦。

52631442a8764c618b4ea3d03efbc1a6.png

 projection矩阵:将物体投影到相机

个人认为projection变换是最好理解的,虽然计算其变换矩阵比较复杂。简而言之,就是将位于视锥体内的物体”压扁“到近平面上。投影分为正交投影和透视投影。

正交投影

0fd7de1258244f85817ea6074f6ad3b3.png

要创建一个正射投影矩阵,我们可以使用GLM的内置函数glm::ortho

glm::ortho(0.0f, 800.0f, 0.0f, 600.0f, 0.1f, 100.0f);

前两个参数指定了平截头体的左右坐标,第三和第四参数指定了平截头体的底部和顶部。通过这四个参数我们定义了近平面和远平面的大小,然后第五和第六个参数则定义了近平面和远平面的距离。这个投影矩阵会将处于这些x,y,z值范围内的坐标变换为标准化设备坐标。

透视投影

19ec68afc1634cf4b4c15da4bbfc839f.png

在GLM中可以这样创建一个透视投影矩阵:

glm::mat4 proj = glm::perspective(glm::radians(45.0f), (float)width/(float)height, 0.1f, 100.0f);

它的第一个参数定义了fov的值,它表示的是视野(Field of View),并且设置了观察空间的大小。如果想要一个真实的观察效果,它的值通常设置为45.0f,但想要一个末日风格的结果你可以将其设置一个更大的值。第二个参数设置了宽高比,由视口的宽除以高所得。第三和第四个参数设置了平截头体的平面。我们通常设置近距离为0.1f,而远距离设为100.0f。所有在近平面和远平面内且处于平截头体内的顶点都会被渲染。

在案例中采用的是透视投影,可以调整参数尝试下其他效果~

  1. glm::mat4 projection = glm::mat4(1.0f);
  2. projection = glm::perspective(glm::radians(45.0f), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f);
  3. ourShader.setMat4("projection", projection);

案例源代码及配置方法

上述案例可在坐标系统-LearnOpenGL最下方查看源代码。为了便于配置和观察,我将案例中的贴图改为了不同颜色。效果如下:

 下面给出源代码:

  1. // 目录结构
  2. -- glad.c // GLAD
  3. -- main.cpp // 主函数
  4. -- shader.h // 着色器类
  5. -- shader.vs // 顶点着色器
  6. -- shader.fs // 片元着色器

main.cpp

  1. #include <glad/glad.h>
  2. #include <GLFW/glfw3.h>
  3. #include <glm/glm.hpp>
  4. #include <glm/gtc/matrix_transform.hpp>
  5. #include <glm/gtc/type_ptr.hpp>
  6. #include "shader.h"
  7. #include <iostream>
  8. void framebuffer_size_callback(GLFWwindow* window, int width, int height);
  9. void processInput(GLFWwindow *window);
  10. // settings
  11. const unsigned int SCR_WIDTH = 800;
  12. const unsigned int SCR_HEIGHT = 600;
  13. int main()
  14. {
  15. // glfw: initialize and configure
  16. // ------------------------------
  17. glfwInit();
  18. glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
  19. glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
  20. glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
  21. #ifdef __APPLE__
  22. glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
  23. #endif
  24. // glfw window creation
  25. // --------------------
  26. GLFWwindow* window = glfwCreateWindow(SCR_WIDTH, SCR_HEIGHT, "LearnOpenGL", NULL, NULL);
  27. if (window == NULL)
  28. {
  29. std::cout << "Failed to create GLFW window" << std::endl;
  30. glfwTerminate();
  31. return -1;
  32. }
  33. glfwMakeContextCurrent(window);
  34. glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);
  35. // glad: load all OpenGL function pointers
  36. // ---------------------------------------
  37. if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress))
  38. {
  39. std::cout << "Failed to initialize GLAD" << std::endl;
  40. return -1;
  41. }
  42. // configure global opengl state
  43. // -----------------------------
  44. glEnable(GL_DEPTH_TEST);
  45. // build and compile our shader zprogram
  46. // ------------------------------------
  47. Shader ourShader("shader.vs", "shader.fs");
  48. // set up vertex data (and buffer(s)) and configure vertex attributes
  49. // ------------------------------------------------------------------
  50. float vertices[] = {
  51. // x、y、z 坐标 // color
  52. -0.5f, -0.5f, -0.5f, 1.0f, 0.5f, 1.0f, // red 红色面
  53. 0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f,
  54. 0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f,
  55. 0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f,
  56. -0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f,
  57. -0.5f, -0.5f, -0.5f, 1.0f, 0.5f, 1.0f,
  58. -0.5f, -0.5f, 0.5f, 0.0f, 1.0f, 0.0f, // green 绿色面
  59. 0.5f, -0.5f, 0.5f, 0.0f, 1.0f, 0.0f,
  60. 0.5f, 0.5f, 0.5f, 1.0f, 1.0f, 0.5f,
  61. 0.5f, 0.5f, 0.5f, 1.0f, 1.0f, 0.5f,
  62. -0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f,
  63. -0.5f, -0.5f, 0.5f, 0.0f, 1.0f, 0.0f,
  64. -0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, // blue 蓝色面
  65. -0.5f, 0.5f, -0.5f, 0.0f, 0.0f, 1.0f,
  66. -0.5f, -0.5f, -0.5f, 0.5f, 1.0f, 1.0f,
  67. -0.5f, -0.5f, -0.5f, 0.5f, 1.0f, 1.0f,
  68. -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f,
  69. -0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f,
  70. 0.5f, 0.5f, 0.5f, 1.0f, 1.0f, 0.0f, // yellow 黄色面
  71. 0.5f, 0.5f, -0.5f, 1.0f, 1.0f, 0.0f,
  72. 0.5f, -0.5f, -0.5f, 1.0f, 1.0f, 0.0f,
  73. 0.5f, -0.5f, -0.5f, 1.0f, 1.0f, 0.0f,
  74. 0.5f, -0.5f, 0.5f, 1.0f, 0.5f, 0.0f,
  75. 0.5f, 0.5f, 0.5f, 1.0f, 1.0f, 0.0f,
  76. -0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 1.0f, // purple 紫色面
  77. 0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 1.0f,
  78. 0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 1.0f,
  79. 0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 1.0f,
  80. -0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.5f,
  81. -0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 1.0f,
  82. -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 1.0f, // cyan 青色面
  83. 0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 1.0f,
  84. 0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 1.0f,
  85. 0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 1.0f,
  86. -0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f,
  87. -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 1.0f,
  88. };
  89. // world space positions of our cubes
  90. glm::vec3 cubePositions[] = {
  91. glm::vec3( 0.0f, 0.0f, 0.0f),
  92. glm::vec3( 2.0f, 5.0f, -15.0f),
  93. glm::vec3(-1.5f, -2.2f, -2.5f),
  94. glm::vec3(-3.8f, -2.0f, -12.3f),
  95. glm::vec3( 2.4f, -0.4f, -3.5f),
  96. glm::vec3(-1.7f, 3.0f, -7.5f),
  97. glm::vec3( 1.3f, -2.0f, -2.5f),
  98. glm::vec3( 1.5f, 2.0f, -2.5f),
  99. glm::vec3( 1.5f, 0.2f, -1.5f),
  100. glm::vec3(-1.3f, 1.0f, -1.5f)
  101. };
  102. unsigned int VBO, VAO;
  103. glGenVertexArrays(1, &VAO);
  104. glGenBuffers(1, &VBO);
  105. glBindVertexArray(VAO);
  106. glBindBuffer(GL_ARRAY_BUFFER, VBO);
  107. glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
  108. // position attribute
  109. glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(float), (void*)0);
  110. glEnableVertexAttribArray(0);
  111. // texture coord attribute
  112. glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(float), (void*)(3 * sizeof(float)));
  113. glEnableVertexAttribArray(1);
  114. // tell opengl for each sampler to which texture unit it belongs to (only has to be done once)
  115. // -------------------------------------------------------------------------------------------
  116. ourShader.use();
  117. // render loop
  118. // -----------
  119. while (!glfwWindowShouldClose(window))
  120. {
  121. // input
  122. // -----
  123. processInput(window);
  124. // render
  125. // ------
  126. glClearColor(0.2f, 0.3f, 0.3f, 1.0f);
  127. glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // also clear the depth buffer now!
  128. // activate shader
  129. ourShader.use();
  130. // create transformations
  131. glm::mat4 view = glm::mat4(1.0f); // make sure to initialize matrix to identity matrix first
  132. glm::mat4 projection = glm::mat4(1.0f);
  133. projection = glm::perspective(glm::radians(45.0f), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f);
  134. view = glm::translate(view, glm::vec3(0.0f, 0.0f, -3.0f));
  135. // pass transformation matrices to the shader
  136. ourShader.setMat4("projection", projection); // note: currently we set the projection matrix each frame, but since the projection matrix rarely changes it's often best practice to set it outside the main loop only once.
  137. ourShader.setMat4("view", view);
  138. // render boxes
  139. glBindVertexArray(VAO);
  140. for (unsigned int i = 0; i < 10; i++)
  141. {
  142. // calculate the model matrix for each object and pass it to shader before drawing
  143. glm::mat4 model = glm::mat4(1.0f);
  144. model = glm::translate(model, cubePositions[i]);
  145. float angle = 20.0f * i;
  146. model = glm::rotate(model, glm::radians(angle), glm::vec3(1.0f, 0.3f, 0.5f));
  147. ourShader.setMat4("model", model);
  148. glDrawArrays(GL_TRIANGLES, 0, 36);
  149. }
  150. // glfw: swap buffers and poll IO events (keys pressed/released, mouse moved etc.)
  151. // -------------------------------------------------------------------------------
  152. glfwSwapBuffers(window);
  153. glfwPollEvents();
  154. }
  155. // optional: de-allocate all resources once they've outlived their purpose:
  156. // ------------------------------------------------------------------------
  157. glDeleteVertexArrays(1, &VAO);
  158. glDeleteBuffers(1, &VBO);
  159. // glfw: terminate, clearing all previously allocated GLFW resources.
  160. // ------------------------------------------------------------------
  161. glfwTerminate();
  162. return 0;
  163. }
  164. // process all input: query GLFW whether relevant keys are pressed/released this frame and react accordingly
  165. // ---------------------------------------------------------------------------------------------------------
  166. void processInput(GLFWwindow *window)
  167. {
  168. if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
  169. glfwSetWindowShouldClose(window, true);
  170. }
  171. // glfw: whenever the window size changed (by OS or user resize) this callback function executes
  172. // ---------------------------------------------------------------------------------------------
  173. void framebuffer_size_callback(GLFWwindow* window, int width, int height)
  174. {
  175. // make sure the viewport matches the new window dimensions; note that width and
  176. // height will be significantly larger than specified on retina displays.
  177. glViewport(0, 0, width, height);
  178. }

shader.h

  1. #ifndef SHADER_H
  2. #define SHADER_H
  3. #include <glad/glad.h>
  4. #include <glm/glm.hpp>
  5. #include <string>
  6. #include <fstream>
  7. #include <sstream>
  8. #include <iostream>
  9. class Shader
  10. {
  11. public:
  12. unsigned int ID;
  13. // constructor generates the shader on the fly
  14. // ------------------------------------------------------------------------
  15. Shader(const char* vertexPath, const char* fragmentPath)
  16. {
  17. // 1. retrieve the vertex/fragment source code from filePath
  18. std::string vertexCode;
  19. std::string fragmentCode;
  20. std::ifstream vShaderFile;
  21. std::ifstream fShaderFile;
  22. // ensure ifstream objects can throw exceptions:
  23. vShaderFile.exceptions (std::ifstream::failbit | std::ifstream::badbit);
  24. fShaderFile.exceptions (std::ifstream::failbit | std::ifstream::badbit);
  25. try
  26. {
  27. // open files
  28. vShaderFile.open(vertexPath);
  29. fShaderFile.open(fragmentPath);
  30. std::stringstream vShaderStream, fShaderStream;
  31. // read file's buffer contents into streams
  32. vShaderStream << vShaderFile.rdbuf();
  33. fShaderStream << fShaderFile.rdbuf();
  34. // close file handlers
  35. vShaderFile.close();
  36. fShaderFile.close();
  37. // convert stream into string
  38. vertexCode = vShaderStream.str();
  39. fragmentCode = fShaderStream.str();
  40. }
  41. catch (std::ifstream::failure& e)
  42. {
  43. std::cout << "ERROR::SHADER::FILE_NOT_SUCCESSFULLY_READ: " << e.what() << std::endl;
  44. }
  45. const char* vShaderCode = vertexCode.c_str();
  46. const char * fShaderCode = fragmentCode.c_str();
  47. // 2. compile shaders
  48. unsigned int vertex, fragment;
  49. // vertex shader
  50. vertex = glCreateShader(GL_VERTEX_SHADER);
  51. glShaderSource(vertex, 1, &vShaderCode, NULL);
  52. glCompileShader(vertex);
  53. checkCompileErrors(vertex, "VERTEX");
  54. // fragment Shader
  55. fragment = glCreateShader(GL_FRAGMENT_SHADER);
  56. glShaderSource(fragment, 1, &fShaderCode, NULL);
  57. glCompileShader(fragment);
  58. checkCompileErrors(fragment, "FRAGMENT");
  59. // shader Program
  60. ID = glCreateProgram();
  61. glAttachShader(ID, vertex);
  62. glAttachShader(ID, fragment);
  63. glLinkProgram(ID);
  64. checkCompileErrors(ID, "PROGRAM");
  65. // delete the shaders as they're linked into our program now and no longer necessary
  66. glDeleteShader(vertex);
  67. glDeleteShader(fragment);
  68. }
  69. // activate the shader
  70. // ------------------------------------------------------------------------
  71. void use() const
  72. {
  73. glUseProgram(ID);
  74. }
  75. // utility uniform functions
  76. // ------------------------------------------------------------------------
  77. void setBool(const std::string &name, bool value) const
  78. {
  79. glUniform1i(glGetUniformLocation(ID, name.c_str()), (int)value);
  80. }
  81. // ------------------------------------------------------------------------
  82. void setInt(const std::string &name, int value) const
  83. {
  84. glUniform1i(glGetUniformLocation(ID, name.c_str()), value);
  85. }
  86. // ------------------------------------------------------------------------
  87. void setFloat(const std::string &name, float value) const
  88. {
  89. glUniform1f(glGetUniformLocation(ID, name.c_str()), value);
  90. }
  91. // ------------------------------------------------------------------------
  92. void setVec2(const std::string &name, const glm::vec2 &value) const
  93. {
  94. glUniform2fv(glGetUniformLocation(ID, name.c_str()), 1, &value[0]);
  95. }
  96. void setVec2(const std::string &name, float x, float y) const
  97. {
  98. glUniform2f(glGetUniformLocation(ID, name.c_str()), x, y);
  99. }
  100. // ------------------------------------------------------------------------
  101. void setVec3(const std::string &name, const glm::vec3 &value) const
  102. {
  103. glUniform3fv(glGetUniformLocation(ID, name.c_str()), 1, &value[0]);
  104. }
  105. void setVec3(const std::string &name, float x, float y, float z) const
  106. {
  107. glUniform3f(glGetUniformLocation(ID, name.c_str()), x, y, z);
  108. }
  109. // ------------------------------------------------------------------------
  110. void setVec4(const std::string &name, const glm::vec4 &value) const
  111. {
  112. glUniform4fv(glGetUniformLocation(ID, name.c_str()), 1, &value[0]);
  113. }
  114. void setVec4(const std::string &name, float x, float y, float z, float w) const
  115. {
  116. glUniform4f(glGetUniformLocation(ID, name.c_str()), x, y, z, w);
  117. }
  118. // ------------------------------------------------------------------------
  119. void setMat2(const std::string &name, const glm::mat2 &mat) const
  120. {
  121. glUniformMatrix2fv(glGetUniformLocation(ID, name.c_str()), 1, GL_FALSE, &mat[0][0]);
  122. }
  123. // ------------------------------------------------------------------------
  124. void setMat3(const std::string &name, const glm::mat3 &mat) const
  125. {
  126. glUniformMatrix3fv(glGetUniformLocation(ID, name.c_str()), 1, GL_FALSE, &mat[0][0]);
  127. }
  128. // ------------------------------------------------------------------------
  129. void setMat4(const std::string &name, const glm::mat4 &mat) const
  130. {
  131. glUniformMatrix4fv(glGetUniformLocation(ID, name.c_str()), 1, GL_FALSE, &mat[0][0]);
  132. }
  133. private:
  134. // utility function for checking shader compilation/linking errors.
  135. // ------------------------------------------------------------------------
  136. void checkCompileErrors(GLuint shader, std::string type)
  137. {
  138. GLint success;
  139. GLchar infoLog[1024];
  140. if (type != "PROGRAM")
  141. {
  142. glGetShaderiv(shader, GL_COMPILE_STATUS, &success);
  143. if (!success)
  144. {
  145. glGetShaderInfoLog(shader, 1024, NULL, infoLog);
  146. std::cout << "ERROR::SHADER_COMPILATION_ERROR of type: " << type << "\n" << infoLog << "\n -- --------------------------------------------------- -- " << std::endl;
  147. }
  148. }
  149. else
  150. {
  151. glGetProgramiv(shader, GL_LINK_STATUS, &success);
  152. if (!success)
  153. {
  154. glGetProgramInfoLog(shader, 1024, NULL, infoLog);
  155. std::cout << "ERROR::PROGRAM_LINKING_ERROR of type: " << type << "\n" << infoLog << "\n -- --------------------------------------------------- -- " << std::endl;
  156. }
  157. }
  158. }
  159. };
  160. #endif

shader.vs

  1. #version 330 core
  2. layout (location = 0) in vec3 aPos;
  3. layout (location = 1) in vec3 aColor;
  4. out vec3 ourColor;
  5. uniform mat4 model;
  6. uniform mat4 view;
  7. uniform mat4 projection;
  8. void main()
  9. {
  10. gl_Position = projection * view * model * vec4(aPos, 1.0f);
  11. ourColor = aColor;
  12. }

shader.fs

  1. #version 330 core
  2. in vec3 ourColor;
  3. out vec4 FragColor;
  4. void main()
  5. {
  6. FragColor = vec4(ourColor,1.0f);
  7. }

glad.c

  1. /*
  2. OpenGL loader generated by glad 0.1.36 on Fri Apr 21 22:56:43 2023.
  3. Language/Generator: C/C++
  4. Specification: gl
  5. APIs: gl=4.3
  6. Profile: core
  7. Extensions:
  8. Loader: True
  9. Local files: False
  10. Omit khrplatform: False
  11. Reproducible: False
  12. Commandline:
  13. --profile="core" --api="gl=4.3" --generator="c" --spec="gl" --extensions=""
  14. Online:
  15. https://glad.dav1d.de/#profile=core&language=c&specification=gl&loader=on&api=gl%3D4.3
  16. */
  17. #include <stdio.h>
  18. #include <stdlib.h>
  19. #include <string.h>
  20. #include <glad/glad.h>
  21. static void* get_proc(const char *namez);
  22. #if defined(_WIN32) || defined(__CYGWIN__)
  23. #ifndef _WINDOWS_
  24. #undef APIENTRY
  25. #endif
  26. #include <windows.h>
  27. static HMODULE libGL;
  28. typedef void* (APIENTRYP PFNWGLGETPROCADDRESSPROC_PRIVATE)(const char*);
  29. static PFNWGLGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
  30. #ifdef _MSC_VER
  31. #ifdef __has_include
  32. #if __has_include(<winapifamily.h>)
  33. #define HAVE_WINAPIFAMILY 1
  34. #endif
  35. #elif _MSC_VER >= 1700 && !_USING_V110_SDK71_
  36. #define HAVE_WINAPIFAMILY 1
  37. #endif
  38. #endif
  39. #ifdef HAVE_WINAPIFAMILY
  40. #include <winapifamily.h>
  41. #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
  42. #define IS_UWP 1
  43. #endif
  44. #endif
  45. static
  46. int open_gl(void) {
  47. #ifndef IS_UWP
  48. libGL = LoadLibraryW(L"opengl32.dll");
  49. if(libGL != NULL) {
  50. void (* tmp)(void);
  51. tmp = (void(*)(void)) GetProcAddress(libGL, "wglGetProcAddress");
  52. gladGetProcAddressPtr = (PFNWGLGETPROCADDRESSPROC_PRIVATE) tmp;
  53. return gladGetProcAddressPtr != NULL;
  54. }
  55. #endif
  56. return 0;
  57. }
  58. static
  59. void close_gl(void) {
  60. if(libGL != NULL) {
  61. FreeLibrary((HMODULE) libGL);
  62. libGL = NULL;
  63. }
  64. }
  65. #else
  66. #include <dlfcn.h>
  67. static void* libGL;
  68. #if !defined(__APPLE__) && !defined(__HAIKU__)
  69. typedef void* (APIENTRYP PFNGLXGETPROCADDRESSPROC_PRIVATE)(const char*);
  70. static PFNGLXGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
  71. #endif
  72. static
  73. int open_gl(void) {
  74. #ifdef __APPLE__
  75. static const char *NAMES[] = {
  76. "../Frameworks/OpenGL.framework/OpenGL",
  77. "/Library/Frameworks/OpenGL.framework/OpenGL",
  78. "/System/Library/Frameworks/OpenGL.framework/OpenGL",
  79. "/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL"
  80. };
  81. #else
  82. static const char *NAMES[] = {"libGL.so.1", "libGL.so"};
  83. #endif
  84. unsigned int index = 0;
  85. for(index = 0; index < (sizeof(NAMES) / sizeof(NAMES[0])); index++) {
  86. libGL = dlopen(NAMES[index], RTLD_NOW | RTLD_GLOBAL);
  87. if(libGL != NULL) {
  88. #if defined(__APPLE__) || defined(__HAIKU__)
  89. return 1;
  90. #else
  91. gladGetProcAddressPtr = (PFNGLXGETPROCADDRESSPROC_PRIVATE)dlsym(libGL,
  92. "glXGetProcAddressARB");
  93. return gladGetProcAddressPtr != NULL;
  94. #endif
  95. }
  96. }
  97. return 0;
  98. }
  99. static
  100. void close_gl(void) {
  101. if(libGL != NULL) {
  102. dlclose(libGL);
  103. libGL = NULL;
  104. }
  105. }
  106. #endif
  107. static
  108. void* get_proc(const char *namez) {
  109. void* result = NULL;
  110. if(libGL == NULL) return NULL;
  111. #if !defined(__APPLE__) && !defined(__HAIKU__)
  112. if(gladGetProcAddressPtr != NULL) {
  113. result = gladGetProcAddressPtr(namez);
  114. }
  115. #endif
  116. if(result == NULL) {
  117. #if defined(_WIN32) || defined(__CYGWIN__)
  118. result = (void*)GetProcAddress((HMODULE) libGL, namez);
  119. #else
  120. result = dlsym(libGL, namez);
  121. #endif
  122. }
  123. return result;
  124. }
  125. int gladLoadGL(void) {
  126. int status = 0;
  127. if(open_gl()) {
  128. status = gladLoadGLLoader(&get_proc);
  129. close_gl();
  130. }
  131. return status;
  132. }
  133. struct gladGLversionStruct GLVersion = { 0, 0 };
  134. #if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0)
  135. #define _GLAD_IS_SOME_NEW_VERSION 1
  136. #endif
  137. static int max_loaded_major;
  138. static int max_loaded_minor;
  139. static const char *exts = NULL;
  140. static int num_exts_i = 0;
  141. static char **exts_i = NULL;
  142. static int get_exts(void) {
  143. #ifdef _GLAD_IS_SOME_NEW_VERSION
  144. if(max_loaded_major < 3) {
  145. #endif
  146. exts = (const char *)glGetString(GL_EXTENSIONS);
  147. #ifdef _GLAD_IS_SOME_NEW_VERSION
  148. } else {
  149. unsigned int index;
  150. num_exts_i = 0;
  151. glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i);
  152. if (num_exts_i > 0) {
  153. exts_i = (char **)malloc((size_t)num_exts_i * (sizeof *exts_i));
  154. }
  155. if (exts_i == NULL) {
  156. return 0;
  157. }
  158. for(index = 0; index < (unsigned)num_exts_i; index++) {
  159. const char *gl_str_tmp = (const char*)glGetStringi(GL_EXTENSIONS, index);
  160. size_t len = strlen(gl_str_tmp);
  161. char *local_str = (char*)malloc((len+1) * sizeof(char));
  162. if(local_str != NULL) {
  163. memcpy(local_str, gl_str_tmp, (len+1) * sizeof(char));
  164. }
  165. exts_i[index] = local_str;
  166. }
  167. }
  168. #endif
  169. return 1;
  170. }
  171. static void free_exts(void) {
  172. if (exts_i != NULL) {
  173. int index;
  174. for(index = 0; index < num_exts_i; index++) {
  175. free((char *)exts_i[index]);
  176. }
  177. free((void *)exts_i);
  178. exts_i = NULL;
  179. }
  180. }
  181. static int has_ext(const char *ext) {
  182. #ifdef _GLAD_IS_SOME_NEW_VERSION
  183. if(max_loaded_major < 3) {
  184. #endif
  185. const char *extensions;
  186. const char *loc;
  187. const char *terminator;
  188. extensions = exts;
  189. if(extensions == NULL || ext == NULL) {
  190. return 0;
  191. }
  192. while(1) {
  193. loc = strstr(extensions, ext);
  194. if(loc == NULL) {
  195. return 0;
  196. }
  197. terminator = loc + strlen(ext);
  198. if((loc == extensions || *(loc - 1) == ' ') &&
  199. (*terminator == ' ' || *terminator == '\0')) {
  200. return 1;
  201. }
  202. extensions = terminator;
  203. }
  204. #ifdef _GLAD_IS_SOME_NEW_VERSION
  205. } else {
  206. int index;
  207. if(exts_i == NULL) return 0;
  208. for(index = 0; index < num_exts_i; index++) {
  209. const char *e = exts_i[index];
  210. if(exts_i[index] != NULL && strcmp(e, ext) == 0) {
  211. return 1;
  212. }
  213. }
  214. }
  215. #endif
  216. return 0;
  217. }
  218. int GLAD_GL_VERSION_1_0 = 0;
  219. int GLAD_GL_VERSION_1_1 = 0;
  220. int GLAD_GL_VERSION_1_2 = 0;
  221. int GLAD_GL_VERSION_1_3 = 0;
  222. int GLAD_GL_VERSION_1_4 = 0;
  223. int GLAD_GL_VERSION_1_5 = 0;
  224. int GLAD_GL_VERSION_2_0 = 0;
  225. int GLAD_GL_VERSION_2_1 = 0;
  226. int GLAD_GL_VERSION_3_0 = 0;
  227. int GLAD_GL_VERSION_3_1 = 0;
  228. int GLAD_GL_VERSION_3_2 = 0;
  229. int GLAD_GL_VERSION_3_3 = 0;
  230. int GLAD_GL_VERSION_4_0 = 0;
  231. int GLAD_GL_VERSION_4_1 = 0;
  232. int GLAD_GL_VERSION_4_2 = 0;
  233. int GLAD_GL_VERSION_4_3 = 0;
  234. PFNGLACTIVESHADERPROGRAMPROC glad_glActiveShaderProgram = NULL;
  235. PFNGLACTIVETEXTUREPROC glad_glActiveTexture = NULL;
  236. PFNGLATTACHSHADERPROC glad_glAttachShader = NULL;
  237. PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender = NULL;
  238. PFNGLBEGINQUERYPROC glad_glBeginQuery = NULL;
  239. PFNGLBEGINQUERYINDEXEDPROC glad_glBeginQueryIndexed = NULL;
  240. PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback = NULL;
  241. PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation = NULL;
  242. PFNGLBINDBUFFERPROC glad_glBindBuffer = NULL;
  243. PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase = NULL;
  244. PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange = NULL;
  245. PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation = NULL;
  246. PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed = NULL;
  247. PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer = NULL;
  248. PFNGLBINDIMAGETEXTUREPROC glad_glBindImageTexture = NULL;
  249. PFNGLBINDPROGRAMPIPELINEPROC glad_glBindProgramPipeline = NULL;
  250. PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer = NULL;
  251. PFNGLBINDSAMPLERPROC glad_glBindSampler = NULL;
  252. PFNGLBINDTEXTUREPROC glad_glBindTexture = NULL;
  253. PFNGLBINDTRANSFORMFEEDBACKPROC glad_glBindTransformFeedback = NULL;
  254. PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray = NULL;
  255. PFNGLBINDVERTEXBUFFERPROC glad_glBindVertexBuffer = NULL;
  256. PFNGLBLENDCOLORPROC glad_glBlendColor = NULL;
  257. PFNGLBLENDEQUATIONPROC glad_glBlendEquation = NULL;
  258. PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate = NULL;
  259. PFNGLBLENDEQUATIONSEPARATEIPROC glad_glBlendEquationSeparatei = NULL;
  260. PFNGLBLENDEQUATIONIPROC glad_glBlendEquationi = NULL;
  261. PFNGLBLENDFUNCPROC glad_glBlendFunc = NULL;
  262. PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate = NULL;
  263. PFNGLBLENDFUNCSEPARATEIPROC glad_glBlendFuncSeparatei = NULL;
  264. PFNGLBLENDFUNCIPROC glad_glBlendFunci = NULL;
  265. PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer = NULL;
  266. PFNGLBUFFERDATAPROC glad_glBufferData = NULL;
  267. PFNGLBUFFERSUBDATAPROC glad_glBufferSubData = NULL;
  268. PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus = NULL;
  269. PFNGLCLAMPCOLORPROC glad_glClampColor = NULL;
  270. PFNGLCLEARPROC glad_glClear = NULL;
  271. PFNGLCLEARBUFFERDATAPROC glad_glClearBufferData = NULL;
  272. PFNGLCLEARBUFFERSUBDATAPROC glad_glClearBufferSubData = NULL;
  273. PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi = NULL;
  274. PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv = NULL;
  275. PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv = NULL;
  276. PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv = NULL;
  277. PFNGLCLEARCOLORPROC glad_glClearColor = NULL;
  278. PFNGLCLEARDEPTHPROC glad_glClearDepth = NULL;
  279. PFNGLCLEARDEPTHFPROC glad_glClearDepthf = NULL;
  280. PFNGLCLEARSTENCILPROC glad_glClearStencil = NULL;
  281. PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync = NULL;
  282. PFNGLCOLORMASKPROC glad_glColorMask = NULL;
  283. PFNGLCOLORMASKIPROC glad_glColorMaski = NULL;
  284. PFNGLCOLORP3UIPROC glad_glColorP3ui = NULL;
  285. PFNGLCOLORP3UIVPROC glad_glColorP3uiv = NULL;
  286. PFNGLCOLORP4UIPROC glad_glColorP4ui = NULL;
  287. PFNGLCOLORP4UIVPROC glad_glColorP4uiv = NULL;
  288. PFNGLCOMPILESHADERPROC glad_glCompileShader = NULL;
  289. PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D = NULL;
  290. PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D = NULL;
  291. PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D = NULL;
  292. PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D = NULL;
  293. PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D = NULL;
  294. PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D = NULL;
  295. PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData = NULL;
  296. PFNGLCOPYIMAGESUBDATAPROC glad_glCopyImageSubData = NULL;
  297. PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D = NULL;
  298. PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D = NULL;
  299. PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D = NULL;
  300. PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D = NULL;
  301. PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D = NULL;
  302. PFNGLCREATEPROGRAMPROC glad_glCreateProgram = NULL;
  303. PFNGLCREATESHADERPROC glad_glCreateShader = NULL;
  304. PFNGLCREATESHADERPROGRAMVPROC glad_glCreateShaderProgramv = NULL;
  305. PFNGLCULLFACEPROC glad_glCullFace = NULL;
  306. PFNGLDEBUGMESSAGECALLBACKPROC glad_glDebugMessageCallback = NULL;
  307. PFNGLDEBUGMESSAGECONTROLPROC glad_glDebugMessageControl = NULL;
  308. PFNGLDEBUGMESSAGEINSERTPROC glad_glDebugMessageInsert = NULL;
  309. PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers = NULL;
  310. PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers = NULL;
  311. PFNGLDELETEPROGRAMPROC glad_glDeleteProgram = NULL;
  312. PFNGLDELETEPROGRAMPIPELINESPROC glad_glDeleteProgramPipelines = NULL;
  313. PFNGLDELETEQUERIESPROC glad_glDeleteQueries = NULL;
  314. PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers = NULL;
  315. PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers = NULL;
  316. PFNGLDELETESHADERPROC glad_glDeleteShader = NULL;
  317. PFNGLDELETESYNCPROC glad_glDeleteSync = NULL;
  318. PFNGLDELETETEXTURESPROC glad_glDeleteTextures = NULL;
  319. PFNGLDELETETRANSFORMFEEDBACKSPROC glad_glDeleteTransformFeedbacks = NULL;
  320. PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays = NULL;
  321. PFNGLDEPTHFUNCPROC glad_glDepthFunc = NULL;
  322. PFNGLDEPTHMASKPROC glad_glDepthMask = NULL;
  323. PFNGLDEPTHRANGEPROC glad_glDepthRange = NULL;
  324. PFNGLDEPTHRANGEARRAYVPROC glad_glDepthRangeArrayv = NULL;
  325. PFNGLDEPTHRANGEINDEXEDPROC glad_glDepthRangeIndexed = NULL;
  326. PFNGLDEPTHRANGEFPROC glad_glDepthRangef = NULL;
  327. PFNGLDETACHSHADERPROC glad_glDetachShader = NULL;
  328. PFNGLDISABLEPROC glad_glDisable = NULL;
  329. PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray = NULL;
  330. PFNGLDISABLEIPROC glad_glDisablei = NULL;
  331. PFNGLDISPATCHCOMPUTEPROC glad_glDispatchCompute = NULL;
  332. PFNGLDISPATCHCOMPUTEINDIRECTPROC glad_glDispatchComputeIndirect = NULL;
  333. PFNGLDRAWARRAYSPROC glad_glDrawArrays = NULL;
  334. PFNGLDRAWARRAYSINDIRECTPROC glad_glDrawArraysIndirect = NULL;
  335. PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced = NULL;
  336. PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC glad_glDrawArraysInstancedBaseInstance = NULL;
  337. PFNGLDRAWBUFFERPROC glad_glDrawBuffer = NULL;
  338. PFNGLDRAWBUFFERSPROC glad_glDrawBuffers = NULL;
  339. PFNGLDRAWELEMENTSPROC glad_glDrawElements = NULL;
  340. PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex = NULL;
  341. PFNGLDRAWELEMENTSINDIRECTPROC glad_glDrawElementsIndirect = NULL;
  342. PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced = NULL;
  343. PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC glad_glDrawElementsInstancedBaseInstance = NULL;
  344. PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex = NULL;
  345. PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC glad_glDrawElementsInstancedBaseVertexBaseInstance = NULL;
  346. PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements = NULL;
  347. PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex = NULL;
  348. PFNGLDRAWTRANSFORMFEEDBACKPROC glad_glDrawTransformFeedback = NULL;
  349. PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC glad_glDrawTransformFeedbackInstanced = NULL;
  350. PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC glad_glDrawTransformFeedbackStream = NULL;
  351. PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC glad_glDrawTransformFeedbackStreamInstanced = NULL;
  352. PFNGLENABLEPROC glad_glEnable = NULL;
  353. PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray = NULL;
  354. PFNGLENABLEIPROC glad_glEnablei = NULL;
  355. PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender = NULL;
  356. PFNGLENDQUERYPROC glad_glEndQuery = NULL;
  357. PFNGLENDQUERYINDEXEDPROC glad_glEndQueryIndexed = NULL;
  358. PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback = NULL;
  359. PFNGLFENCESYNCPROC glad_glFenceSync = NULL;
  360. PFNGLFINISHPROC glad_glFinish = NULL;
  361. PFNGLFLUSHPROC glad_glFlush = NULL;
  362. PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange = NULL;
  363. PFNGLFRAMEBUFFERPARAMETERIPROC glad_glFramebufferParameteri = NULL;
  364. PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer = NULL;
  365. PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture = NULL;
  366. PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D = NULL;
  367. PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D = NULL;
  368. PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D = NULL;
  369. PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer = NULL;
  370. PFNGLFRONTFACEPROC glad_glFrontFace = NULL;
  371. PFNGLGENBUFFERSPROC glad_glGenBuffers = NULL;
  372. PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers = NULL;
  373. PFNGLGENPROGRAMPIPELINESPROC glad_glGenProgramPipelines = NULL;
  374. PFNGLGENQUERIESPROC glad_glGenQueries = NULL;
  375. PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers = NULL;
  376. PFNGLGENSAMPLERSPROC glad_glGenSamplers = NULL;
  377. PFNGLGENTEXTURESPROC glad_glGenTextures = NULL;
  378. PFNGLGENTRANSFORMFEEDBACKSPROC glad_glGenTransformFeedbacks = NULL;
  379. PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays = NULL;
  380. PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap = NULL;
  381. PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC glad_glGetActiveAtomicCounterBufferiv = NULL;
  382. PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib = NULL;
  383. PFNGLGETACTIVESUBROUTINENAMEPROC glad_glGetActiveSubroutineName = NULL;
  384. PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC glad_glGetActiveSubroutineUniformName = NULL;
  385. PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC glad_glGetActiveSubroutineUniformiv = NULL;
  386. PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform = NULL;
  387. PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName = NULL;
  388. PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv = NULL;
  389. PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName = NULL;
  390. PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv = NULL;
  391. PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders = NULL;
  392. PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation = NULL;
  393. PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v = NULL;
  394. PFNGLGETBOOLEANVPROC glad_glGetBooleanv = NULL;
  395. PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v = NULL;
  396. PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv = NULL;
  397. PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv = NULL;
  398. PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData = NULL;
  399. PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage = NULL;
  400. PFNGLGETDEBUGMESSAGELOGPROC glad_glGetDebugMessageLog = NULL;
  401. PFNGLGETDOUBLEI_VPROC glad_glGetDoublei_v = NULL;
  402. PFNGLGETDOUBLEVPROC glad_glGetDoublev = NULL;
  403. PFNGLGETERRORPROC glad_glGetError = NULL;
  404. PFNGLGETFLOATI_VPROC glad_glGetFloati_v = NULL;
  405. PFNGLGETFLOATVPROC glad_glGetFloatv = NULL;
  406. PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex = NULL;
  407. PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation = NULL;
  408. PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv = NULL;
  409. PFNGLGETFRAMEBUFFERPARAMETERIVPROC glad_glGetFramebufferParameteriv = NULL;
  410. PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v = NULL;
  411. PFNGLGETINTEGER64VPROC glad_glGetInteger64v = NULL;
  412. PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v = NULL;
  413. PFNGLGETINTEGERVPROC glad_glGetIntegerv = NULL;
  414. PFNGLGETINTERNALFORMATI64VPROC glad_glGetInternalformati64v = NULL;
  415. PFNGLGETINTERNALFORMATIVPROC glad_glGetInternalformativ = NULL;
  416. PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv = NULL;
  417. PFNGLGETOBJECTLABELPROC glad_glGetObjectLabel = NULL;
  418. PFNGLGETOBJECTPTRLABELPROC glad_glGetObjectPtrLabel = NULL;
  419. PFNGLGETPOINTERVPROC glad_glGetPointerv = NULL;
  420. PFNGLGETPROGRAMBINARYPROC glad_glGetProgramBinary = NULL;
  421. PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog = NULL;
  422. PFNGLGETPROGRAMINTERFACEIVPROC glad_glGetProgramInterfaceiv = NULL;
  423. PFNGLGETPROGRAMPIPELINEINFOLOGPROC glad_glGetProgramPipelineInfoLog = NULL;
  424. PFNGLGETPROGRAMPIPELINEIVPROC glad_glGetProgramPipelineiv = NULL;
  425. PFNGLGETPROGRAMRESOURCEINDEXPROC glad_glGetProgramResourceIndex = NULL;
  426. PFNGLGETPROGRAMRESOURCELOCATIONPROC glad_glGetProgramResourceLocation = NULL;
  427. PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC glad_glGetProgramResourceLocationIndex = NULL;
  428. PFNGLGETPROGRAMRESOURCENAMEPROC glad_glGetProgramResourceName = NULL;
  429. PFNGLGETPROGRAMRESOURCEIVPROC glad_glGetProgramResourceiv = NULL;
  430. PFNGLGETPROGRAMSTAGEIVPROC glad_glGetProgramStageiv = NULL;
  431. PFNGLGETPROGRAMIVPROC glad_glGetProgramiv = NULL;
  432. PFNGLGETQUERYINDEXEDIVPROC glad_glGetQueryIndexediv = NULL;
  433. PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v = NULL;
  434. PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv = NULL;
  435. PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v = NULL;
  436. PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv = NULL;
  437. PFNGLGETQUERYIVPROC glad_glGetQueryiv = NULL;
  438. PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv = NULL;
  439. PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv = NULL;
  440. PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv = NULL;
  441. PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv = NULL;
  442. PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv = NULL;
  443. PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog = NULL;
  444. PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat = NULL;
  445. PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource = NULL;
  446. PFNGLGETSHADERIVPROC glad_glGetShaderiv = NULL;
  447. PFNGLGETSTRINGPROC glad_glGetString = NULL;
  448. PFNGLGETSTRINGIPROC glad_glGetStringi = NULL;
  449. PFNGLGETSUBROUTINEINDEXPROC glad_glGetSubroutineIndex = NULL;
  450. PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC glad_glGetSubroutineUniformLocation = NULL;
  451. PFNGLGETSYNCIVPROC glad_glGetSynciv = NULL;
  452. PFNGLGETTEXIMAGEPROC glad_glGetTexImage = NULL;
  453. PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv = NULL;
  454. PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv = NULL;
  455. PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv = NULL;
  456. PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv = NULL;
  457. PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv = NULL;
  458. PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv = NULL;
  459. PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying = NULL;
  460. PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex = NULL;
  461. PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices = NULL;
  462. PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation = NULL;
  463. PFNGLGETUNIFORMSUBROUTINEUIVPROC glad_glGetUniformSubroutineuiv = NULL;
  464. PFNGLGETUNIFORMDVPROC glad_glGetUniformdv = NULL;
  465. PFNGLGETUNIFORMFVPROC glad_glGetUniformfv = NULL;
  466. PFNGLGETUNIFORMIVPROC glad_glGetUniformiv = NULL;
  467. PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv = NULL;
  468. PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv = NULL;
  469. PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv = NULL;
  470. PFNGLGETVERTEXATTRIBLDVPROC glad_glGetVertexAttribLdv = NULL;
  471. PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv = NULL;
  472. PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv = NULL;
  473. PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv = NULL;
  474. PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv = NULL;
  475. PFNGLHINTPROC glad_glHint = NULL;
  476. PFNGLINVALIDATEBUFFERDATAPROC glad_glInvalidateBufferData = NULL;
  477. PFNGLINVALIDATEBUFFERSUBDATAPROC glad_glInvalidateBufferSubData = NULL;
  478. PFNGLINVALIDATEFRAMEBUFFERPROC glad_glInvalidateFramebuffer = NULL;
  479. PFNGLINVALIDATESUBFRAMEBUFFERPROC glad_glInvalidateSubFramebuffer = NULL;
  480. PFNGLINVALIDATETEXIMAGEPROC glad_glInvalidateTexImage = NULL;
  481. PFNGLINVALIDATETEXSUBIMAGEPROC glad_glInvalidateTexSubImage = NULL;
  482. PFNGLISBUFFERPROC glad_glIsBuffer = NULL;
  483. PFNGLISENABLEDPROC glad_glIsEnabled = NULL;
  484. PFNGLISENABLEDIPROC glad_glIsEnabledi = NULL;
  485. PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer = NULL;
  486. PFNGLISPROGRAMPROC glad_glIsProgram = NULL;
  487. PFNGLISPROGRAMPIPELINEPROC glad_glIsProgramPipeline = NULL;
  488. PFNGLISQUERYPROC glad_glIsQuery = NULL;
  489. PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer = NULL;
  490. PFNGLISSAMPLERPROC glad_glIsSampler = NULL;
  491. PFNGLISSHADERPROC glad_glIsShader = NULL;
  492. PFNGLISSYNCPROC glad_glIsSync = NULL;
  493. PFNGLISTEXTUREPROC glad_glIsTexture = NULL;
  494. PFNGLISTRANSFORMFEEDBACKPROC glad_glIsTransformFeedback = NULL;
  495. PFNGLISVERTEXARRAYPROC glad_glIsVertexArray = NULL;
  496. PFNGLLINEWIDTHPROC glad_glLineWidth = NULL;
  497. PFNGLLINKPROGRAMPROC glad_glLinkProgram = NULL;
  498. PFNGLLOGICOPPROC glad_glLogicOp = NULL;
  499. PFNGLMAPBUFFERPROC glad_glMapBuffer = NULL;
  500. PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange = NULL;
  501. PFNGLMEMORYBARRIERPROC glad_glMemoryBarrier = NULL;
  502. PFNGLMINSAMPLESHADINGPROC glad_glMinSampleShading = NULL;
  503. PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays = NULL;
  504. PFNGLMULTIDRAWARRAYSINDIRECTPROC glad_glMultiDrawArraysIndirect = NULL;
  505. PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements = NULL;
  506. PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex = NULL;
  507. PFNGLMULTIDRAWELEMENTSINDIRECTPROC glad_glMultiDrawElementsIndirect = NULL;
  508. PFNGLMULTITEXCOORDP1UIPROC glad_glMultiTexCoordP1ui = NULL;
  509. PFNGLMULTITEXCOORDP1UIVPROC glad_glMultiTexCoordP1uiv = NULL;
  510. PFNGLMULTITEXCOORDP2UIPROC glad_glMultiTexCoordP2ui = NULL;
  511. PFNGLMULTITEXCOORDP2UIVPROC glad_glMultiTexCoordP2uiv = NULL;
  512. PFNGLMULTITEXCOORDP3UIPROC glad_glMultiTexCoordP3ui = NULL;
  513. PFNGLMULTITEXCOORDP3UIVPROC glad_glMultiTexCoordP3uiv = NULL;
  514. PFNGLMULTITEXCOORDP4UIPROC glad_glMultiTexCoordP4ui = NULL;
  515. PFNGLMULTITEXCOORDP4UIVPROC glad_glMultiTexCoordP4uiv = NULL;
  516. PFNGLNORMALP3UIPROC glad_glNormalP3ui = NULL;
  517. PFNGLNORMALP3UIVPROC glad_glNormalP3uiv = NULL;
  518. PFNGLOBJECTLABELPROC glad_glObjectLabel = NULL;
  519. PFNGLOBJECTPTRLABELPROC glad_glObjectPtrLabel = NULL;
  520. PFNGLPATCHPARAMETERFVPROC glad_glPatchParameterfv = NULL;
  521. PFNGLPATCHPARAMETERIPROC glad_glPatchParameteri = NULL;
  522. PFNGLPAUSETRANSFORMFEEDBACKPROC glad_glPauseTransformFeedback = NULL;
  523. PFNGLPIXELSTOREFPROC glad_glPixelStoref = NULL;
  524. PFNGLPIXELSTOREIPROC glad_glPixelStorei = NULL;
  525. PFNGLPOINTPARAMETERFPROC glad_glPointParameterf = NULL;
  526. PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv = NULL;
  527. PFNGLPOINTPARAMETERIPROC glad_glPointParameteri = NULL;
  528. PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv = NULL;
  529. PFNGLPOINTSIZEPROC glad_glPointSize = NULL;
  530. PFNGLPOLYGONMODEPROC glad_glPolygonMode = NULL;
  531. PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset = NULL;
  532. PFNGLPOPDEBUGGROUPPROC glad_glPopDebugGroup = NULL;
  533. PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex = NULL;
  534. PFNGLPROGRAMBINARYPROC glad_glProgramBinary = NULL;
  535. PFNGLPROGRAMPARAMETERIPROC glad_glProgramParameteri = NULL;
  536. PFNGLPROGRAMUNIFORM1DPROC glad_glProgramUniform1d = NULL;
  537. PFNGLPROGRAMUNIFORM1DVPROC glad_glProgramUniform1dv = NULL;
  538. PFNGLPROGRAMUNIFORM1FPROC glad_glProgramUniform1f = NULL;
  539. PFNGLPROGRAMUNIFORM1FVPROC glad_glProgramUniform1fv = NULL;
  540. PFNGLPROGRAMUNIFORM1IPROC glad_glProgramUniform1i = NULL;
  541. PFNGLPROGRAMUNIFORM1IVPROC glad_glProgramUniform1iv = NULL;
  542. PFNGLPROGRAMUNIFORM1UIPROC glad_glProgramUniform1ui = NULL;
  543. PFNGLPROGRAMUNIFORM1UIVPROC glad_glProgramUniform1uiv = NULL;
  544. PFNGLPROGRAMUNIFORM2DPROC glad_glProgramUniform2d = NULL;
  545. PFNGLPROGRAMUNIFORM2DVPROC glad_glProgramUniform2dv = NULL;
  546. PFNGLPROGRAMUNIFORM2FPROC glad_glProgramUniform2f = NULL;
  547. PFNGLPROGRAMUNIFORM2FVPROC glad_glProgramUniform2fv = NULL;
  548. PFNGLPROGRAMUNIFORM2IPROC glad_glProgramUniform2i = NULL;
  549. PFNGLPROGRAMUNIFORM2IVPROC glad_glProgramUniform2iv = NULL;
  550. PFNGLPROGRAMUNIFORM2UIPROC glad_glProgramUniform2ui = NULL;
  551. PFNGLPROGRAMUNIFORM2UIVPROC glad_glProgramUniform2uiv = NULL;
  552. PFNGLPROGRAMUNIFORM3DPROC glad_glProgramUniform3d = NULL;
  553. PFNGLPROGRAMUNIFORM3DVPROC glad_glProgramUniform3dv = NULL;
  554. PFNGLPROGRAMUNIFORM3FPROC glad_glProgramUniform3f = NULL;
  555. PFNGLPROGRAMUNIFORM3FVPROC glad_glProgramUniform3fv = NULL;
  556. PFNGLPROGRAMUNIFORM3IPROC glad_glProgramUniform3i = NULL;
  557. PFNGLPROGRAMUNIFORM3IVPROC glad_glProgramUniform3iv = NULL;
  558. PFNGLPROGRAMUNIFORM3UIPROC glad_glProgramUniform3ui = NULL;
  559. PFNGLPROGRAMUNIFORM3UIVPROC glad_glProgramUniform3uiv = NULL;
  560. PFNGLPROGRAMUNIFORM4DPROC glad_glProgramUniform4d = NULL;
  561. PFNGLPROGRAMUNIFORM4DVPROC glad_glProgramUniform4dv = NULL;
  562. PFNGLPROGRAMUNIFORM4FPROC glad_glProgramUniform4f = NULL;
  563. PFNGLPROGRAMUNIFORM4FVPROC glad_glProgramUniform4fv = NULL;
  564. PFNGLPROGRAMUNIFORM4IPROC glad_glProgramUniform4i = NULL;
  565. PFNGLPROGRAMUNIFORM4IVPROC glad_glProgramUniform4iv = NULL;
  566. PFNGLPROGRAMUNIFORM4UIPROC glad_glProgramUniform4ui = NULL;
  567. PFNGLPROGRAMUNIFORM4UIVPROC glad_glProgramUniform4uiv = NULL;
  568. PFNGLPROGRAMUNIFORMMATRIX2DVPROC glad_glProgramUniformMatrix2dv = NULL;
  569. PFNGLPROGRAMUNIFORMMATRIX2FVPROC glad_glProgramUniformMatrix2fv = NULL;
  570. PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC glad_glProgramUniformMatrix2x3dv = NULL;
  571. PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC glad_glProgramUniformMatrix2x3fv = NULL;
  572. PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC glad_glProgramUniformMatrix2x4dv = NULL;
  573. PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC glad_glProgramUniformMatrix2x4fv = NULL;
  574. PFNGLPROGRAMUNIFORMMATRIX3DVPROC glad_glProgramUniformMatrix3dv = NULL;
  575. PFNGLPROGRAMUNIFORMMATRIX3FVPROC glad_glProgramUniformMatrix3fv = NULL;
  576. PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC glad_glProgramUniformMatrix3x2dv = NULL;
  577. PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC glad_glProgramUniformMatrix3x2fv = NULL;
  578. PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC glad_glProgramUniformMatrix3x4dv = NULL;
  579. PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC glad_glProgramUniformMatrix3x4fv = NULL;
  580. PFNGLPROGRAMUNIFORMMATRIX4DVPROC glad_glProgramUniformMatrix4dv = NULL;
  581. PFNGLPROGRAMUNIFORMMATRIX4FVPROC glad_glProgramUniformMatrix4fv = NULL;
  582. PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC glad_glProgramUniformMatrix4x2dv = NULL;
  583. PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC glad_glProgramUniformMatrix4x2fv = NULL;
  584. PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC glad_glProgramUniformMatrix4x3dv = NULL;
  585. PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC glad_glProgramUniformMatrix4x3fv = NULL;
  586. PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex = NULL;
  587. PFNGLPUSHDEBUGGROUPPROC glad_glPushDebugGroup = NULL;
  588. PFNGLQUERYCOUNTERPROC glad_glQueryCounter = NULL;
  589. PFNGLREADBUFFERPROC glad_glReadBuffer = NULL;
  590. PFNGLREADPIXELSPROC glad_glReadPixels = NULL;
  591. PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler = NULL;
  592. PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage = NULL;
  593. PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample = NULL;
  594. PFNGLRESUMETRANSFORMFEEDBACKPROC glad_glResumeTransformFeedback = NULL;
  595. PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage = NULL;
  596. PFNGLSAMPLEMASKIPROC glad_glSampleMaski = NULL;
  597. PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv = NULL;
  598. PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv = NULL;
  599. PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf = NULL;
  600. PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv = NULL;
  601. PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri = NULL;
  602. PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv = NULL;
  603. PFNGLSCISSORPROC glad_glScissor = NULL;
  604. PFNGLSCISSORARRAYVPROC glad_glScissorArrayv = NULL;
  605. PFNGLSCISSORINDEXEDPROC glad_glScissorIndexed = NULL;
  606. PFNGLSCISSORINDEXEDVPROC glad_glScissorIndexedv = NULL;
  607. PFNGLSECONDARYCOLORP3UIPROC glad_glSecondaryColorP3ui = NULL;
  608. PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv = NULL;
  609. PFNGLSHADERBINARYPROC glad_glShaderBinary = NULL;
  610. PFNGLSHADERSOURCEPROC glad_glShaderSource = NULL;
  611. PFNGLSHADERSTORAGEBLOCKBINDINGPROC glad_glShaderStorageBlockBinding = NULL;
  612. PFNGLSTENCILFUNCPROC glad_glStencilFunc = NULL;
  613. PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate = NULL;
  614. PFNGLSTENCILMASKPROC glad_glStencilMask = NULL;
  615. PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate = NULL;
  616. PFNGLSTENCILOPPROC glad_glStencilOp = NULL;
  617. PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate = NULL;
  618. PFNGLTEXBUFFERPROC glad_glTexBuffer = NULL;
  619. PFNGLTEXBUFFERRANGEPROC glad_glTexBufferRange = NULL;
  620. PFNGLTEXCOORDP1UIPROC glad_glTexCoordP1ui = NULL;
  621. PFNGLTEXCOORDP1UIVPROC glad_glTexCoordP1uiv = NULL;
  622. PFNGLTEXCOORDP2UIPROC glad_glTexCoordP2ui = NULL;
  623. PFNGLTEXCOORDP2UIVPROC glad_glTexCoordP2uiv = NULL;
  624. PFNGLTEXCOORDP3UIPROC glad_glTexCoordP3ui = NULL;
  625. PFNGLTEXCOORDP3UIVPROC glad_glTexCoordP3uiv = NULL;
  626. PFNGLTEXCOORDP4UIPROC glad_glTexCoordP4ui = NULL;
  627. PFNGLTEXCOORDP4UIVPROC glad_glTexCoordP4uiv = NULL;
  628. PFNGLTEXIMAGE1DPROC glad_glTexImage1D = NULL;
  629. PFNGLTEXIMAGE2DPROC glad_glTexImage2D = NULL;
  630. PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample = NULL;
  631. PFNGLTEXIMAGE3DPROC glad_glTexImage3D = NULL;
  632. PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample = NULL;
  633. PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv = NULL;
  634. PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv = NULL;
  635. PFNGLTEXPARAMETERFPROC glad_glTexParameterf = NULL;
  636. PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv = NULL;
  637. PFNGLTEXPARAMETERIPROC glad_glTexParameteri = NULL;
  638. PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv = NULL;
  639. PFNGLTEXSTORAGE1DPROC glad_glTexStorage1D = NULL;
  640. PFNGLTEXSTORAGE2DPROC glad_glTexStorage2D = NULL;
  641. PFNGLTEXSTORAGE2DMULTISAMPLEPROC glad_glTexStorage2DMultisample = NULL;
  642. PFNGLTEXSTORAGE3DPROC glad_glTexStorage3D = NULL;
  643. PFNGLTEXSTORAGE3DMULTISAMPLEPROC glad_glTexStorage3DMultisample = NULL;
  644. PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D = NULL;
  645. PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D = NULL;
  646. PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D = NULL;
  647. PFNGLTEXTUREVIEWPROC glad_glTextureView = NULL;
  648. PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings = NULL;
  649. PFNGLUNIFORM1DPROC glad_glUniform1d = NULL;
  650. PFNGLUNIFORM1DVPROC glad_glUniform1dv = NULL;
  651. PFNGLUNIFORM1FPROC glad_glUniform1f = NULL;
  652. PFNGLUNIFORM1FVPROC glad_glUniform1fv = NULL;
  653. PFNGLUNIFORM1IPROC glad_glUniform1i = NULL;
  654. PFNGLUNIFORM1IVPROC glad_glUniform1iv = NULL;
  655. PFNGLUNIFORM1UIPROC glad_glUniform1ui = NULL;
  656. PFNGLUNIFORM1UIVPROC glad_glUniform1uiv = NULL;
  657. PFNGLUNIFORM2DPROC glad_glUniform2d = NULL;
  658. PFNGLUNIFORM2DVPROC glad_glUniform2dv = NULL;
  659. PFNGLUNIFORM2FPROC glad_glUniform2f = NULL;
  660. PFNGLUNIFORM2FVPROC glad_glUniform2fv = NULL;
  661. PFNGLUNIFORM2IPROC glad_glUniform2i = NULL;
  662. PFNGLUNIFORM2IVPROC glad_glUniform2iv = NULL;
  663. PFNGLUNIFORM2UIPROC glad_glUniform2ui = NULL;
  664. PFNGLUNIFORM2UIVPROC glad_glUniform2uiv = NULL;
  665. PFNGLUNIFORM3DPROC glad_glUniform3d = NULL;
  666. PFNGLUNIFORM3DVPROC glad_glUniform3dv = NULL;
  667. PFNGLUNIFORM3FPROC glad_glUniform3f = NULL;
  668. PFNGLUNIFORM3FVPROC glad_glUniform3fv = NULL;
  669. PFNGLUNIFORM3IPROC glad_glUniform3i = NULL;
  670. PFNGLUNIFORM3IVPROC glad_glUniform3iv = NULL;
  671. PFNGLUNIFORM3UIPROC glad_glUniform3ui = NULL;
  672. PFNGLUNIFORM3UIVPROC glad_glUniform3uiv = NULL;
  673. PFNGLUNIFORM4DPROC glad_glUniform4d = NULL;
  674. PFNGLUNIFORM4DVPROC glad_glUniform4dv = NULL;
  675. PFNGLUNIFORM4FPROC glad_glUniform4f = NULL;
  676. PFNGLUNIFORM4FVPROC glad_glUniform4fv = NULL;
  677. PFNGLUNIFORM4IPROC glad_glUniform4i = NULL;
  678. PFNGLUNIFORM4IVPROC glad_glUniform4iv = NULL;
  679. PFNGLUNIFORM4UIPROC glad_glUniform4ui = NULL;
  680. PFNGLUNIFORM4UIVPROC glad_glUniform4uiv = NULL;
  681. PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding = NULL;
  682. PFNGLUNIFORMMATRIX2DVPROC glad_glUniformMatrix2dv = NULL;
  683. PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv = NULL;
  684. PFNGLUNIFORMMATRIX2X3DVPROC glad_glUniformMatrix2x3dv = NULL;
  685. PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv = NULL;
  686. PFNGLUNIFORMMATRIX2X4DVPROC glad_glUniformMatrix2x4dv = NULL;
  687. PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv = NULL;
  688. PFNGLUNIFORMMATRIX3DVPROC glad_glUniformMatrix3dv = NULL;
  689. PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv = NULL;
  690. PFNGLUNIFORMMATRIX3X2DVPROC glad_glUniformMatrix3x2dv = NULL;
  691. PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv = NULL;
  692. PFNGLUNIFORMMATRIX3X4DVPROC glad_glUniformMatrix3x4dv = NULL;
  693. PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv = NULL;
  694. PFNGLUNIFORMMATRIX4DVPROC glad_glUniformMatrix4dv = NULL;
  695. PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv = NULL;
  696. PFNGLUNIFORMMATRIX4X2DVPROC glad_glUniformMatrix4x2dv = NULL;
  697. PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv = NULL;
  698. PFNGLUNIFORMMATRIX4X3DVPROC glad_glUniformMatrix4x3dv = NULL;
  699. PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv = NULL;
  700. PFNGLUNIFORMSUBROUTINESUIVPROC glad_glUniformSubroutinesuiv = NULL;
  701. PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer = NULL;
  702. PFNGLUSEPROGRAMPROC glad_glUseProgram = NULL;
  703. PFNGLUSEPROGRAMSTAGESPROC glad_glUseProgramStages = NULL;
  704. PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram = NULL;
  705. PFNGLVALIDATEPROGRAMPIPELINEPROC glad_glValidateProgramPipeline = NULL;
  706. PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d = NULL;
  707. PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv = NULL;
  708. PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f = NULL;
  709. PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv = NULL;
  710. PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s = NULL;
  711. PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv = NULL;
  712. PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d = NULL;
  713. PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv = NULL;
  714. PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f = NULL;
  715. PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv = NULL;
  716. PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s = NULL;
  717. PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv = NULL;
  718. PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d = NULL;
  719. PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv = NULL;
  720. PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f = NULL;
  721. PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv = NULL;
  722. PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s = NULL;
  723. PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv = NULL;
  724. PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv = NULL;
  725. PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv = NULL;
  726. PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv = NULL;
  727. PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub = NULL;
  728. PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv = NULL;
  729. PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv = NULL;
  730. PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv = NULL;
  731. PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv = NULL;
  732. PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d = NULL;
  733. PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv = NULL;
  734. PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f = NULL;
  735. PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv = NULL;
  736. PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv = NULL;
  737. PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s = NULL;
  738. PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv = NULL;
  739. PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv = NULL;
  740. PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv = NULL;
  741. PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv = NULL;
  742. PFNGLVERTEXATTRIBBINDINGPROC glad_glVertexAttribBinding = NULL;
  743. PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor = NULL;
  744. PFNGLVERTEXATTRIBFORMATPROC glad_glVertexAttribFormat = NULL;
  745. PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i = NULL;
  746. PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv = NULL;
  747. PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui = NULL;
  748. PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv = NULL;
  749. PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i = NULL;
  750. PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv = NULL;
  751. PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui = NULL;
  752. PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv = NULL;
  753. PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i = NULL;
  754. PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv = NULL;
  755. PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui = NULL;
  756. PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv = NULL;
  757. PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv = NULL;
  758. PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i = NULL;
  759. PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv = NULL;
  760. PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv = NULL;
  761. PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv = NULL;
  762. PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui = NULL;
  763. PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv = NULL;
  764. PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv = NULL;
  765. PFNGLVERTEXATTRIBIFORMATPROC glad_glVertexAttribIFormat = NULL;
  766. PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer = NULL;
  767. PFNGLVERTEXATTRIBL1DPROC glad_glVertexAttribL1d = NULL;
  768. PFNGLVERTEXATTRIBL1DVPROC glad_glVertexAttribL1dv = NULL;
  769. PFNGLVERTEXATTRIBL2DPROC glad_glVertexAttribL2d = NULL;
  770. PFNGLVERTEXATTRIBL2DVPROC glad_glVertexAttribL2dv = NULL;
  771. PFNGLVERTEXATTRIBL3DPROC glad_glVertexAttribL3d = NULL;
  772. PFNGLVERTEXATTRIBL3DVPROC glad_glVertexAttribL3dv = NULL;
  773. PFNGLVERTEXATTRIBL4DPROC glad_glVertexAttribL4d = NULL;
  774. PFNGLVERTEXATTRIBL4DVPROC glad_glVertexAttribL4dv = NULL;
  775. PFNGLVERTEXATTRIBLFORMATPROC glad_glVertexAttribLFormat = NULL;
  776. PFNGLVERTEXATTRIBLPOINTERPROC glad_glVertexAttribLPointer = NULL;
  777. PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui = NULL;
  778. PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv = NULL;
  779. PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui = NULL;
  780. PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv = NULL;
  781. PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui = NULL;
  782. PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv = NULL;
  783. PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui = NULL;
  784. PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv = NULL;
  785. PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer = NULL;
  786. PFNGLVERTEXBINDINGDIVISORPROC glad_glVertexBindingDivisor = NULL;
  787. PFNGLVERTEXP2UIPROC glad_glVertexP2ui = NULL;
  788. PFNGLVERTEXP2UIVPROC glad_glVertexP2uiv = NULL;
  789. PFNGLVERTEXP3UIPROC glad_glVertexP3ui = NULL;
  790. PFNGLVERTEXP3UIVPROC glad_glVertexP3uiv = NULL;
  791. PFNGLVERTEXP4UIPROC glad_glVertexP4ui = NULL;
  792. PFNGLVERTEXP4UIVPROC glad_glVertexP4uiv = NULL;
  793. PFNGLVIEWPORTPROC glad_glViewport = NULL;
  794. PFNGLVIEWPORTARRAYVPROC glad_glViewportArrayv = NULL;
  795. PFNGLVIEWPORTINDEXEDFPROC glad_glViewportIndexedf = NULL;
  796. PFNGLVIEWPORTINDEXEDFVPROC glad_glViewportIndexedfv = NULL;
  797. PFNGLWAITSYNCPROC glad_glWaitSync = NULL;
  798. static void load_GL_VERSION_1_0(GLADloadproc load) {
  799. if(!GLAD_GL_VERSION_1_0) return;
  800. glad_glCullFace = (PFNGLCULLFACEPROC)load("glCullFace");
  801. glad_glFrontFace = (PFNGLFRONTFACEPROC)load("glFrontFace");
  802. glad_glHint = (PFNGLHINTPROC)load("glHint");
  803. glad_glLineWidth = (PFNGLLINEWIDTHPROC)load("glLineWidth");
  804. glad_glPointSize = (PFNGLPOINTSIZEPROC)load("glPointSize");
  805. glad_glPolygonMode = (PFNGLPOLYGONMODEPROC)load("glPolygonMode");
  806. glad_glScissor = (PFNGLSCISSORPROC)load("glScissor");
  807. glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC)load("glTexParameterf");
  808. glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC)load("glTexParameterfv");
  809. glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC)load("glTexParameteri");
  810. glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC)load("glTexParameteriv");
  811. glad_glTexImage1D = (PFNGLTEXIMAGE1DPROC)load("glTexImage1D");
  812. glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC)load("glTexImage2D");
  813. glad_glDrawBuffer = (PFNGLDRAWBUFFERPROC)load("glDrawBuffer");
  814. glad_glClear = (PFNGLCLEARPROC)load("glClear");
  815. glad_glClearColor = (PFNGLCLEARCOLORPROC)load("glClearColor");
  816. glad_glClearStencil = (PFNGLCLEARSTENCILPROC)load("glClearStencil");
  817. glad_glClearDepth = (PFNGLCLEARDEPTHPROC)load("glClearDepth");
  818. glad_glStencilMask = (PFNGLSTENCILMASKPROC)load("glStencilMask");
  819. glad_glColorMask = (PFNGLCOLORMASKPROC)load("glColorMask");
  820. glad_glDepthMask = (PFNGLDEPTHMASKPROC)load("glDepthMask");
  821. glad_glDisable = (PFNGLDISABLEPROC)load("glDisable");
  822. glad_glEnable = (PFNGLENABLEPROC)load("glEnable");
  823. glad_glFinish = (PFNGLFINISHPROC)load("glFinish");
  824. glad_glFlush = (PFNGLFLUSHPROC)load("glFlush");
  825. glad_glBlendFunc = (PFNGLBLENDFUNCPROC)load("glBlendFunc");
  826. glad_glLogicOp = (PFNGLLOGICOPPROC)load("glLogicOp");
  827. glad_glStencilFunc = (PFNGLSTENCILFUNCPROC)load("glStencilFunc");
  828. glad_glStencilOp = (PFNGLSTENCILOPPROC)load("glStencilOp");
  829. glad_glDepthFunc = (PFNGLDEPTHFUNCPROC)load("glDepthFunc");
  830. glad_glPixelStoref = (PFNGLPIXELSTOREFPROC)load("glPixelStoref");
  831. glad_glPixelStorei = (PFNGLPIXELSTOREIPROC)load("glPixelStorei");
  832. glad_glReadBuffer = (PFNGLREADBUFFERPROC)load("glReadBuffer");
  833. glad_glReadPixels = (PFNGLREADPIXELSPROC)load("glReadPixels");
  834. glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC)load("glGetBooleanv");
  835. glad_glGetDoublev = (PFNGLGETDOUBLEVPROC)load("glGetDoublev");
  836. glad_glGetError = (PFNGLGETERRORPROC)load("glGetError");
  837. glad_glGetFloatv = (PFNGLGETFLOATVPROC)load("glGetFloatv");
  838. glad_glGetIntegerv = (PFNGLGETINTEGERVPROC)load("glGetIntegerv");
  839. glad_glGetString = (PFNGLGETSTRINGPROC)load("glGetString");
  840. glad_glGetTexImage = (PFNGLGETTEXIMAGEPROC)load("glGetTexImage");
  841. glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC)load("glGetTexParameterfv");
  842. glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC)load("glGetTexParameteriv");
  843. glad_glGetTexLevelParameterfv = (PFNGLGETTEXLEVELPARAMETERFVPROC)load("glGetTexLevelParameterfv");
  844. glad_glGetTexLevelParameteriv = (PFNGLGETTEXLEVELPARAMETERIVPROC)load("glGetTexLevelParameteriv");
  845. glad_glIsEnabled = (PFNGLISENABLEDPROC)load("glIsEnabled");
  846. glad_glDepthRange = (PFNGLDEPTHRANGEPROC)load("glDepthRange");
  847. glad_glViewport = (PFNGLVIEWPORTPROC)load("glViewport");
  848. }
  849. static void load_GL_VERSION_1_1(GLADloadproc load) {
  850. if(!GLAD_GL_VERSION_1_1) return;
  851. glad_glDrawArrays = (PFNGLDRAWARRAYSPROC)load("glDrawArrays");
  852. glad_glDrawElements = (PFNGLDRAWELEMENTSPROC)load("glDrawElements");
  853. glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC)load("glPolygonOffset");
  854. glad_glCopyTexImage1D = (PFNGLCOPYTEXIMAGE1DPROC)load("glCopyTexImage1D");
  855. glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC)load("glCopyTexImage2D");
  856. glad_glCopyTexSubImage1D = (PFNGLCOPYTEXSUBIMAGE1DPROC)load("glCopyTexSubImage1D");
  857. glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC)load("glCopyTexSubImage2D");
  858. glad_glTexSubImage1D = (PFNGLTEXSUBIMAGE1DPROC)load("glTexSubImage1D");
  859. glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC)load("glTexSubImage2D");
  860. glad_glBindTexture = (PFNGLBINDTEXTUREPROC)load("glBindTexture");
  861. glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC)load("glDeleteTextures");
  862. glad_glGenTextures = (PFNGLGENTEXTURESPROC)load("glGenTextures");
  863. glad_glIsTexture = (PFNGLISTEXTUREPROC)load("glIsTexture");
  864. }
  865. static void load_GL_VERSION_1_2(GLADloadproc load) {
  866. if(!GLAD_GL_VERSION_1_2) return;
  867. glad_glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)load("glDrawRangeElements");
  868. glad_glTexImage3D = (PFNGLTEXIMAGE3DPROC)load("glTexImage3D");
  869. glad_glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)load("glTexSubImage3D");
  870. glad_glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)load("glCopyTexSubImage3D");
  871. }
  872. static void load_GL_VERSION_1_3(GLADloadproc load) {
  873. if(!GLAD_GL_VERSION_1_3) return;
  874. glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC)load("glActiveTexture");
  875. glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)load("glSampleCoverage");
  876. glad_glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)load("glCompressedTexImage3D");
  877. glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)load("glCompressedTexImage2D");
  878. glad_glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)load("glCompressedTexImage1D");
  879. glad_glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)load("glCompressedTexSubImage3D");
  880. glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)load("glCompressedTexSubImage2D");
  881. glad_glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)load("glCompressedTexSubImage1D");
  882. glad_glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)load("glGetCompressedTexImage");
  883. }
  884. static void load_GL_VERSION_1_4(GLADloadproc load) {
  885. if(!GLAD_GL_VERSION_1_4) return;
  886. glad_glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)load("glBlendFuncSeparate");
  887. glad_glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)load("glMultiDrawArrays");
  888. glad_glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)load("glMultiDrawElements");
  889. glad_glPointParameterf = (PFNGLPOINTPARAMETERFPROC)load("glPointParameterf");
  890. glad_glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)load("glPointParameterfv");
  891. glad_glPointParameteri = (PFNGLPOINTPARAMETERIPROC)load("glPointParameteri");
  892. glad_glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)load("glPointParameteriv");
  893. glad_glBlendColor = (PFNGLBLENDCOLORPROC)load("glBlendColor");
  894. glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC)load("glBlendEquation");
  895. }
  896. static void load_GL_VERSION_1_5(GLADloadproc load) {
  897. if(!GLAD_GL_VERSION_1_5) return;
  898. glad_glGenQueries = (PFNGLGENQUERIESPROC)load("glGenQueries");
  899. glad_glDeleteQueries = (PFNGLDELETEQUERIESPROC)load("glDeleteQueries");
  900. glad_glIsQuery = (PFNGLISQUERYPROC)load("glIsQuery");
  901. glad_glBeginQuery = (PFNGLBEGINQUERYPROC)load("glBeginQuery");
  902. glad_glEndQuery = (PFNGLENDQUERYPROC)load("glEndQuery");
  903. glad_glGetQueryiv = (PFNGLGETQUERYIVPROC)load("glGetQueryiv");
  904. glad_glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)load("glGetQueryObjectiv");
  905. glad_glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)load("glGetQueryObjectuiv");
  906. glad_glBindBuffer = (PFNGLBINDBUFFERPROC)load("glBindBuffer");
  907. glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)load("glDeleteBuffers");
  908. glad_glGenBuffers = (PFNGLGENBUFFERSPROC)load("glGenBuffers");
  909. glad_glIsBuffer = (PFNGLISBUFFERPROC)load("glIsBuffer");
  910. glad_glBufferData = (PFNGLBUFFERDATAPROC)load("glBufferData");
  911. glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC)load("glBufferSubData");
  912. glad_glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)load("glGetBufferSubData");
  913. glad_glMapBuffer = (PFNGLMAPBUFFERPROC)load("glMapBuffer");
  914. glad_glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)load("glUnmapBuffer");
  915. glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)load("glGetBufferParameteriv");
  916. glad_glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)load("glGetBufferPointerv");
  917. }
  918. static void load_GL_VERSION_2_0(GLADloadproc load) {
  919. if(!GLAD_GL_VERSION_2_0) return;
  920. glad_glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)load("glBlendEquationSeparate");
  921. glad_glDrawBuffers = (PFNGLDRAWBUFFERSPROC)load("glDrawBuffers");
  922. glad_glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)load("glStencilOpSeparate");
  923. glad_glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)load("glStencilFuncSeparate");
  924. glad_glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)load("glStencilMaskSeparate");
  925. glad_glAttachShader = (PFNGLATTACHSHADERPROC)load("glAttachShader");
  926. glad_glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)load("glBindAttribLocation");
  927. glad_glCompileShader = (PFNGLCOMPILESHADERPROC)load("glCompileShader");
  928. glad_glCreateProgram = (PFNGLCREATEPROGRAMPROC)load("glCreateProgram");
  929. glad_glCreateShader = (PFNGLCREATESHADERPROC)load("glCreateShader");
  930. glad_glDeleteProgram = (PFNGLDELETEPROGRAMPROC)load("glDeleteProgram");
  931. glad_glDeleteShader = (PFNGLDELETESHADERPROC)load("glDeleteShader");
  932. glad_glDetachShader = (PFNGLDETACHSHADERPROC)load("glDetachShader");
  933. glad_glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)load("glDisableVertexAttribArray");
  934. glad_glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)load("glEnableVertexAttribArray");
  935. glad_glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)load("glGetActiveAttrib");
  936. glad_glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)load("glGetActiveUniform");
  937. glad_glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)load("glGetAttachedShaders");
  938. glad_glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)load("glGetAttribLocation");
  939. glad_glGetProgramiv = (PFNGLGETPROGRAMIVPROC)load("glGetProgramiv");
  940. glad_glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)load("glGetProgramInfoLog");
  941. glad_glGetShaderiv = (PFNGLGETSHADERIVPROC)load("glGetShaderiv");
  942. glad_glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)load("glGetShaderInfoLog");
  943. glad_glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)load("glGetShaderSource");
  944. glad_glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)load("glGetUniformLocation");
  945. glad_glGetUniformfv = (PFNGLGETUNIFORMFVPROC)load("glGetUniformfv");
  946. glad_glGetUniformiv = (PFNGLGETUNIFORMIVPROC)load("glGetUniformiv");
  947. glad_glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)load("glGetVertexAttribdv");
  948. glad_glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)load("glGetVertexAttribfv");
  949. glad_glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)load("glGetVertexAttribiv");
  950. glad_glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)load("glGetVertexAttribPointerv");
  951. glad_glIsProgram = (PFNGLISPROGRAMPROC)load("glIsProgram");
  952. glad_glIsShader = (PFNGLISSHADERPROC)load("glIsShader");
  953. glad_glLinkProgram = (PFNGLLINKPROGRAMPROC)load("glLinkProgram");
  954. glad_glShaderSource = (PFNGLSHADERSOURCEPROC)load("glShaderSource");
  955. glad_glUseProgram = (PFNGLUSEPROGRAMPROC)load("glUseProgram");
  956. glad_glUniform1f = (PFNGLUNIFORM1FPROC)load("glUniform1f");
  957. glad_glUniform2f = (PFNGLUNIFORM2FPROC)load("glUniform2f");
  958. glad_glUniform3f = (PFNGLUNIFORM3FPROC)load("glUniform3f");
  959. glad_glUniform4f = (PFNGLUNIFORM4FPROC)load("glUniform4f");
  960. glad_glUniform1i = (PFNGLUNIFORM1IPROC)load("glUniform1i");
  961. glad_glUniform2i = (PFNGLUNIFORM2IPROC)load("glUniform2i");
  962. glad_glUniform3i = (PFNGLUNIFORM3IPROC)load("glUniform3i");
  963. glad_glUniform4i = (PFNGLUNIFORM4IPROC)load("glUniform4i");
  964. glad_glUniform1fv = (PFNGLUNIFORM1FVPROC)load("glUniform1fv");
  965. glad_glUniform2fv = (PFNGLUNIFORM2FVPROC)load("glUniform2fv");
  966. glad_glUniform3fv = (PFNGLUNIFORM3FVPROC)load("glUniform3fv");
  967. glad_glUniform4fv = (PFNGLUNIFORM4FVPROC)load("glUniform4fv");
  968. glad_glUniform1iv = (PFNGLUNIFORM1IVPROC)load("glUniform1iv");
  969. glad_glUniform2iv = (PFNGLUNIFORM2IVPROC)load("glUniform2iv");
  970. glad_glUniform3iv = (PFNGLUNIFORM3IVPROC)load("glUniform3iv");
  971. glad_glUniform4iv = (PFNGLUNIFORM4IVPROC)load("glUniform4iv");
  972. glad_glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)load("glUniformMatrix2fv");
  973. glad_glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)load("glUniformMatrix3fv");
  974. glad_glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)load("glUniformMatrix4fv");
  975. glad_glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)load("glValidateProgram");
  976. glad_glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)load("glVertexAttrib1d");
  977. glad_glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)load("glVertexAttrib1dv");
  978. glad_glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)load("glVertexAttrib1f");
  979. glad_glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)load("glVertexAttrib1fv");
  980. glad_glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)load("glVertexAttrib1s");
  981. glad_glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)load("glVertexAttrib1sv");
  982. glad_glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)load("glVertexAttrib2d");
  983. glad_glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)load("glVertexAttrib2dv");
  984. glad_glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)load("glVertexAttrib2f");
  985. glad_glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)load("glVertexAttrib2fv");
  986. glad_glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)load("glVertexAttrib2s");
  987. glad_glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)load("glVertexAttrib2sv");
  988. glad_glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)load("glVertexAttrib3d");
  989. glad_glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)load("glVertexAttrib3dv");
  990. glad_glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)load("glVertexAttrib3f");
  991. glad_glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)load("glVertexAttrib3fv");
  992. glad_glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)load("glVertexAttrib3s");
  993. glad_glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)load("glVertexAttrib3sv");
  994. glad_glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)load("glVertexAttrib4Nbv");
  995. glad_glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)load("glVertexAttrib4Niv");
  996. glad_glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)load("glVertexAttrib4Nsv");
  997. glad_glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)load("glVertexAttrib4Nub");
  998. glad_glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)load("glVertexAttrib4Nubv");
  999. glad_glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)load("glVertexAttrib4Nuiv");
  1000. glad_glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)load("glVertexAttrib4Nusv");
  1001. glad_glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)load("glVertexAttrib4bv");
  1002. glad_glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)load("glVertexAttrib4d");
  1003. glad_glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)load("glVertexAttrib4dv");
  1004. glad_glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)load("glVertexAttrib4f");
  1005. glad_glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)load("glVertexAttrib4fv");
  1006. glad_glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)load("glVertexAttrib4iv");
  1007. glad_glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)load("glVertexAttrib4s");
  1008. glad_glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)load("glVertexAttrib4sv");
  1009. glad_glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)load("glVertexAttrib4ubv");
  1010. glad_glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)load("glVertexAttrib4uiv");
  1011. glad_glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)load("glVertexAttrib4usv");
  1012. glad_glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)load("glVertexAttribPointer");
  1013. }
  1014. static void load_GL_VERSION_2_1(GLADloadproc load) {
  1015. if(!GLAD_GL_VERSION_2_1) return;
  1016. glad_glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)load("glUniformMatrix2x3fv");
  1017. glad_glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)load("glUniformMatrix3x2fv");
  1018. glad_glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)load("glUniformMatrix2x4fv");
  1019. glad_glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)load("glUniformMatrix4x2fv");
  1020. glad_glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)load("glUniformMatrix3x4fv");
  1021. glad_glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)load("glUniformMatrix4x3fv");
  1022. }
  1023. static void load_GL_VERSION_3_0(GLADloadproc load) {
  1024. if(!GLAD_GL_VERSION_3_0) return;
  1025. glad_glColorMaski = (PFNGLCOLORMASKIPROC)load("glColorMaski");
  1026. glad_glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)load("glGetBooleani_v");
  1027. glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v");
  1028. glad_glEnablei = (PFNGLENABLEIPROC)load("glEnablei");
  1029. glad_glDisablei = (PFNGLDISABLEIPROC)load("glDisablei");
  1030. glad_glIsEnabledi = (PFNGLISENABLEDIPROC)load("glIsEnabledi");
  1031. glad_glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)load("glBeginTransformFeedback");
  1032. glad_glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)load("glEndTransformFeedback");
  1033. glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange");
  1034. glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase");
  1035. glad_glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)load("glTransformFeedbackVaryings");
  1036. glad_glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)load("glGetTransformFeedbackVarying");
  1037. glad_glClampColor = (PFNGLCLAMPCOLORPROC)load("glClampColor");
  1038. glad_glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)load("glBeginConditionalRender");
  1039. glad_glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)load("glEndConditionalRender");
  1040. glad_glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)load("glVertexAttribIPointer");
  1041. glad_glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)load("glGetVertexAttribIiv");
  1042. glad_glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)load("glGetVertexAttribIuiv");
  1043. glad_glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)load("glVertexAttribI1i");
  1044. glad_glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)load("glVertexAttribI2i");
  1045. glad_glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)load("glVertexAttribI3i");
  1046. glad_glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)load("glVertexAttribI4i");
  1047. glad_glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)load("glVertexAttribI1ui");
  1048. glad_glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)load("glVertexAttribI2ui");
  1049. glad_glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)load("glVertexAttribI3ui");
  1050. glad_glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)load("glVertexAttribI4ui");
  1051. glad_glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)load("glVertexAttribI1iv");
  1052. glad_glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)load("glVertexAttribI2iv");
  1053. glad_glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)load("glVertexAttribI3iv");
  1054. glad_glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)load("glVertexAttribI4iv");
  1055. glad_glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)load("glVertexAttribI1uiv");
  1056. glad_glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)load("glVertexAttribI2uiv");
  1057. glad_glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)load("glVertexAttribI3uiv");
  1058. glad_glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)load("glVertexAttribI4uiv");
  1059. glad_glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)load("glVertexAttribI4bv");
  1060. glad_glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)load("glVertexAttribI4sv");
  1061. glad_glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)load("glVertexAttribI4ubv");
  1062. glad_glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)load("glVertexAttribI4usv");
  1063. glad_glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)load("glGetUniformuiv");
  1064. glad_glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)load("glBindFragDataLocation");
  1065. glad_glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)load("glGetFragDataLocation");
  1066. glad_glUniform1ui = (PFNGLUNIFORM1UIPROC)load("glUniform1ui");
  1067. glad_glUniform2ui = (PFNGLUNIFORM2UIPROC)load("glUniform2ui");
  1068. glad_glUniform3ui = (PFNGLUNIFORM3UIPROC)load("glUniform3ui");
  1069. glad_glUniform4ui = (PFNGLUNIFORM4UIPROC)load("glUniform4ui");
  1070. glad_glUniform1uiv = (PFNGLUNIFORM1UIVPROC)load("glUniform1uiv");
  1071. glad_glUniform2uiv = (PFNGLUNIFORM2UIVPROC)load("glUniform2uiv");
  1072. glad_glUniform3uiv = (PFNGLUNIFORM3UIVPROC)load("glUniform3uiv");
  1073. glad_glUniform4uiv = (PFNGLUNIFORM4UIVPROC)load("glUniform4uiv");
  1074. glad_glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)load("glTexParameterIiv");
  1075. glad_glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)load("glTexParameterIuiv");
  1076. glad_glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)load("glGetTexParameterIiv");
  1077. glad_glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)load("glGetTexParameterIuiv");
  1078. glad_glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)load("glClearBufferiv");
  1079. glad_glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)load("glClearBufferuiv");
  1080. glad_glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)load("glClearBufferfv");
  1081. glad_glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)load("glClearBufferfi");
  1082. glad_glGetStringi = (PFNGLGETSTRINGIPROC)load("glGetStringi");
  1083. glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)load("glIsRenderbuffer");
  1084. glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)load("glBindRenderbuffer");
  1085. glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)load("glDeleteRenderbuffers");
  1086. glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)load("glGenRenderbuffers");
  1087. glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)load("glRenderbufferStorage");
  1088. glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)load("glGetRenderbufferParameteriv");
  1089. glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)load("glIsFramebuffer");
  1090. glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)load("glBindFramebuffer");
  1091. glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)load("glDeleteFramebuffers");
  1092. glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)load("glGenFramebuffers");
  1093. glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)load("glCheckFramebufferStatus");
  1094. glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)load("glFramebufferTexture1D");
  1095. glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)load("glFramebufferTexture2D");
  1096. glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)load("glFramebufferTexture3D");
  1097. glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer");
  1098. glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetFramebufferAttachmentParameteriv");
  1099. glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)load("glGenerateMipmap");
  1100. glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)load("glBlitFramebuffer");
  1101. glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glRenderbufferStorageMultisample");
  1102. glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)load("glFramebufferTextureLayer");
  1103. glad_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)load("glMapBufferRange");
  1104. glad_glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)load("glFlushMappedBufferRange");
  1105. glad_glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)load("glBindVertexArray");
  1106. glad_glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)load("glDeleteVertexArrays");
  1107. glad_glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)load("glGenVertexArrays");
  1108. glad_glIsVertexArray = (PFNGLISVERTEXARRAYPROC)load("glIsVertexArray");
  1109. }
  1110. static void load_GL_VERSION_3_1(GLADloadproc load) {
  1111. if(!GLAD_GL_VERSION_3_1) return;
  1112. glad_glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)load("glDrawArraysInstanced");
  1113. glad_glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)load("glDrawElementsInstanced");
  1114. glad_glTexBuffer = (PFNGLTEXBUFFERPROC)load("glTexBuffer");
  1115. glad_glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)load("glPrimitiveRestartIndex");
  1116. glad_glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)load("glCopyBufferSubData");
  1117. glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)load("glGetUniformIndices");
  1118. glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)load("glGetActiveUniformsiv");
  1119. glad_glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)load("glGetActiveUniformName");
  1120. glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)load("glGetUniformBlockIndex");
  1121. glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)load("glGetActiveUniformBlockiv");
  1122. glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)load("glGetActiveUniformBlockName");
  1123. glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)load("glUniformBlockBinding");
  1124. glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange");
  1125. glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase");
  1126. glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v");
  1127. }
  1128. static void load_GL_VERSION_3_2(GLADloadproc load) {
  1129. if(!GLAD_GL_VERSION_3_2) return;
  1130. glad_glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)load("glDrawElementsBaseVertex");
  1131. glad_glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)load("glDrawRangeElementsBaseVertex");
  1132. glad_glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)load("glDrawElementsInstancedBaseVertex");
  1133. glad_glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)load("glMultiDrawElementsBaseVertex");
  1134. glad_glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)load("glProvokingVertex");
  1135. glad_glFenceSync = (PFNGLFENCESYNCPROC)load("glFenceSync");
  1136. glad_glIsSync = (PFNGLISSYNCPROC)load("glIsSync");
  1137. glad_glDeleteSync = (PFNGLDELETESYNCPROC)load("glDeleteSync");
  1138. glad_glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)load("glClientWaitSync");
  1139. glad_glWaitSync = (PFNGLWAITSYNCPROC)load("glWaitSync");
  1140. glad_glGetInteger64v = (PFNGLGETINTEGER64VPROC)load("glGetInteger64v");
  1141. glad_glGetSynciv = (PFNGLGETSYNCIVPROC)load("glGetSynciv");
  1142. glad_glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)load("glGetInteger64i_v");
  1143. glad_glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)load("glGetBufferParameteri64v");
  1144. glad_glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)load("glFramebufferTexture");
  1145. glad_glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)load("glTexImage2DMultisample");
  1146. glad_glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)load("glTexImage3DMultisample");
  1147. glad_glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)load("glGetMultisamplefv");
  1148. glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC)load("glSampleMaski");
  1149. }
  1150. static void load_GL_VERSION_3_3(GLADloadproc load) {
  1151. if(!GLAD_GL_VERSION_3_3) return;
  1152. glad_glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)load("glBindFragDataLocationIndexed");
  1153. glad_glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)load("glGetFragDataIndex");
  1154. glad_glGenSamplers = (PFNGLGENSAMPLERSPROC)load("glGenSamplers");
  1155. glad_glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)load("glDeleteSamplers");
  1156. glad_glIsSampler = (PFNGLISSAMPLERPROC)load("glIsSampler");
  1157. glad_glBindSampler = (PFNGLBINDSAMPLERPROC)load("glBindSampler");
  1158. glad_glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)load("glSamplerParameteri");
  1159. glad_glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)load("glSamplerParameteriv");
  1160. glad_glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)load("glSamplerParameterf");
  1161. glad_glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)load("glSamplerParameterfv");
  1162. glad_glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)load("glSamplerParameterIiv");
  1163. glad_glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)load("glSamplerParameterIuiv");
  1164. glad_glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)load("glGetSamplerParameteriv");
  1165. glad_glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)load("glGetSamplerParameterIiv");
  1166. glad_glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)load("glGetSamplerParameterfv");
  1167. glad_glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)load("glGetSamplerParameterIuiv");
  1168. glad_glQueryCounter = (PFNGLQUERYCOUNTERPROC)load("glQueryCounter");
  1169. glad_glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)load("glGetQueryObjecti64v");
  1170. glad_glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)load("glGetQueryObjectui64v");
  1171. glad_glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)load("glVertexAttribDivisor");
  1172. glad_glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)load("glVertexAttribP1ui");
  1173. glad_glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)load("glVertexAttribP1uiv");
  1174. glad_glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)load("glVertexAttribP2ui");
  1175. glad_glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)load("glVertexAttribP2uiv");
  1176. glad_glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)load("glVertexAttribP3ui");
  1177. glad_glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)load("glVertexAttribP3uiv");
  1178. glad_glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)load("glVertexAttribP4ui");
  1179. glad_glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)load("glVertexAttribP4uiv");
  1180. glad_glVertexP2ui = (PFNGLVERTEXP2UIPROC)load("glVertexP2ui");
  1181. glad_glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)load("glVertexP2uiv");
  1182. glad_glVertexP3ui = (PFNGLVERTEXP3UIPROC)load("glVertexP3ui");
  1183. glad_glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)load("glVertexP3uiv");
  1184. glad_glVertexP4ui = (PFNGLVERTEXP4UIPROC)load("glVertexP4ui");
  1185. glad_glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)load("glVertexP4uiv");
  1186. glad_glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)load("glTexCoordP1ui");
  1187. glad_glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)load("glTexCoordP1uiv");
  1188. glad_glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)load("glTexCoordP2ui");
  1189. glad_glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)load("glTexCoordP2uiv");
  1190. glad_glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)load("glTexCoordP3ui");
  1191. glad_glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)load("glTexCoordP3uiv");
  1192. glad_glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)load("glTexCoordP4ui");
  1193. glad_glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)load("glTexCoordP4uiv");
  1194. glad_glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)load("glMultiTexCoordP1ui");
  1195. glad_glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)load("glMultiTexCoordP1uiv");
  1196. glad_glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)load("glMultiTexCoordP2ui");
  1197. glad_glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)load("glMultiTexCoordP2uiv");
  1198. glad_glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)load("glMultiTexCoordP3ui");
  1199. glad_glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)load("glMultiTexCoordP3uiv");
  1200. glad_glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)load("glMultiTexCoordP4ui");
  1201. glad_glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)load("glMultiTexCoordP4uiv");
  1202. glad_glNormalP3ui = (PFNGLNORMALP3UIPROC)load("glNormalP3ui");
  1203. glad_glNormalP3uiv = (PFNGLNORMALP3UIVPROC)load("glNormalP3uiv");
  1204. glad_glColorP3ui = (PFNGLCOLORP3UIPROC)load("glColorP3ui");
  1205. glad_glColorP3uiv = (PFNGLCOLORP3UIVPROC)load("glColorP3uiv");
  1206. glad_glColorP4ui = (PFNGLCOLORP4UIPROC)load("glColorP4ui");
  1207. glad_glColorP4uiv = (PFNGLCOLORP4UIVPROC)load("glColorP4uiv");
  1208. glad_glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)load("glSecondaryColorP3ui");
  1209. glad_glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)load("glSecondaryColorP3uiv");
  1210. }
  1211. static void load_GL_VERSION_4_0(GLADloadproc load) {
  1212. if(!GLAD_GL_VERSION_4_0) return;
  1213. glad_glMinSampleShading = (PFNGLMINSAMPLESHADINGPROC)load("glMinSampleShading");
  1214. glad_glBlendEquationi = (PFNGLBLENDEQUATIONIPROC)load("glBlendEquationi");
  1215. glad_glBlendEquationSeparatei = (PFNGLBLENDEQUATIONSEPARATEIPROC)load("glBlendEquationSeparatei");
  1216. glad_glBlendFunci = (PFNGLBLENDFUNCIPROC)load("glBlendFunci");
  1217. glad_glBlendFuncSeparatei = (PFNGLBLENDFUNCSEPARATEIPROC)load("glBlendFuncSeparatei");
  1218. glad_glDrawArraysIndirect = (PFNGLDRAWARRAYSINDIRECTPROC)load("glDrawArraysIndirect");
  1219. glad_glDrawElementsIndirect = (PFNGLDRAWELEMENTSINDIRECTPROC)load("glDrawElementsIndirect");
  1220. glad_glUniform1d = (PFNGLUNIFORM1DPROC)load("glUniform1d");
  1221. glad_glUniform2d = (PFNGLUNIFORM2DPROC)load("glUniform2d");
  1222. glad_glUniform3d = (PFNGLUNIFORM3DPROC)load("glUniform3d");
  1223. glad_glUniform4d = (PFNGLUNIFORM4DPROC)load("glUniform4d");
  1224. glad_glUniform1dv = (PFNGLUNIFORM1DVPROC)load("glUniform1dv");
  1225. glad_glUniform2dv = (PFNGLUNIFORM2DVPROC)load("glUniform2dv");
  1226. glad_glUniform3dv = (PFNGLUNIFORM3DVPROC)load("glUniform3dv");
  1227. glad_glUniform4dv = (PFNGLUNIFORM4DVPROC)load("glUniform4dv");
  1228. glad_glUniformMatrix2dv = (PFNGLUNIFORMMATRIX2DVPROC)load("glUniformMatrix2dv");
  1229. glad_glUniformMatrix3dv = (PFNGLUNIFORMMATRIX3DVPROC)load("glUniformMatrix3dv");
  1230. glad_glUniformMatrix4dv = (PFNGLUNIFORMMATRIX4DVPROC)load("glUniformMatrix4dv");
  1231. glad_glUniformMatrix2x3dv = (PFNGLUNIFORMMATRIX2X3DVPROC)load("glUniformMatrix2x3dv");
  1232. glad_glUniformMatrix2x4dv = (PFNGLUNIFORMMATRIX2X4DVPROC)load("glUniformMatrix2x4dv");
  1233. glad_glUniformMatrix3x2dv = (PFNGLUNIFORMMATRIX3X2DVPROC)load("glUniformMatrix3x2dv");
  1234. glad_glUniformMatrix3x4dv = (PFNGLUNIFORMMATRIX3X4DVPROC)load("glUniformMatrix3x4dv");
  1235. glad_glUniformMatrix4x2dv = (PFNGLUNIFORMMATRIX4X2DVPROC)load("glUniformMatrix4x2dv");
  1236. glad_glUniformMatrix4x3dv = (PFNGLUNIFORMMATRIX4X3DVPROC)load("glUniformMatrix4x3dv");
  1237. glad_glGetUniformdv = (PFNGLGETUNIFORMDVPROC)load("glGetUniformdv");
  1238. glad_glGetSubroutineUniformLocation = (PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)load("glGetSubroutineUniformLocation");
  1239. glad_glGetSubroutineIndex = (PFNGLGETSUBROUTINEINDEXPROC)load("glGetSubroutineIndex");
  1240. glad_glGetActiveSubroutineUniformiv = (PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC)load("glGetActiveSubroutineUniformiv");
  1241. glad_glGetActiveSubroutineUniformName = (PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC)load("glGetActiveSubroutineUniformName");
  1242. glad_glGetActiveSubroutineName = (PFNGLGETACTIVESUBROUTINENAMEPROC)load("glGetActiveSubroutineName");
  1243. glad_glUniformSubroutinesuiv = (PFNGLUNIFORMSUBROUTINESUIVPROC)load("glUniformSubroutinesuiv");
  1244. glad_glGetUniformSubroutineuiv = (PFNGLGETUNIFORMSUBROUTINEUIVPROC)load("glGetUniformSubroutineuiv");
  1245. glad_glGetProgramStageiv = (PFNGLGETPROGRAMSTAGEIVPROC)load("glGetProgramStageiv");
  1246. glad_glPatchParameteri = (PFNGLPATCHPARAMETERIPROC)load("glPatchParameteri");
  1247. glad_glPatchParameterfv = (PFNGLPATCHPARAMETERFVPROC)load("glPatchParameterfv");
  1248. glad_glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC)load("glBindTransformFeedback");
  1249. glad_glDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC)load("glDeleteTransformFeedbacks");
  1250. glad_glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC)load("glGenTransformFeedbacks");
  1251. glad_glIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC)load("glIsTransformFeedback");
  1252. glad_glPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC)load("glPauseTransformFeedback");
  1253. glad_glResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC)load("glResumeTransformFeedback");
  1254. glad_glDrawTransformFeedback = (PFNGLDRAWTRANSFORMFEEDBACKPROC)load("glDrawTransformFeedback");
  1255. glad_glDrawTransformFeedbackStream = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC)load("glDrawTransformFeedbackStream");
  1256. glad_glBeginQueryIndexed = (PFNGLBEGINQUERYINDEXEDPROC)load("glBeginQueryIndexed");
  1257. glad_glEndQueryIndexed = (PFNGLENDQUERYINDEXEDPROC)load("glEndQueryIndexed");
  1258. glad_glGetQueryIndexediv = (PFNGLGETQUERYINDEXEDIVPROC)load("glGetQueryIndexediv");
  1259. }
  1260. static void load_GL_VERSION_4_1(GLADloadproc load) {
  1261. if(!GLAD_GL_VERSION_4_1) return;
  1262. glad_glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC)load("glReleaseShaderCompiler");
  1263. glad_glShaderBinary = (PFNGLSHADERBINARYPROC)load("glShaderBinary");
  1264. glad_glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC)load("glGetShaderPrecisionFormat");
  1265. glad_glDepthRangef = (PFNGLDEPTHRANGEFPROC)load("glDepthRangef");
  1266. glad_glClearDepthf = (PFNGLCLEARDEPTHFPROC)load("glClearDepthf");
  1267. glad_glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC)load("glGetProgramBinary");
  1268. glad_glProgramBinary = (PFNGLPROGRAMBINARYPROC)load("glProgramBinary");
  1269. glad_glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC)load("glProgramParameteri");
  1270. glad_glUseProgramStages = (PFNGLUSEPROGRAMSTAGESPROC)load("glUseProgramStages");
  1271. glad_glActiveShaderProgram = (PFNGLACTIVESHADERPROGRAMPROC)load("glActiveShaderProgram");
  1272. glad_glCreateShaderProgramv = (PFNGLCREATESHADERPROGRAMVPROC)load("glCreateShaderProgramv");
  1273. glad_glBindProgramPipeline = (PFNGLBINDPROGRAMPIPELINEPROC)load("glBindProgramPipeline");
  1274. glad_glDeleteProgramPipelines = (PFNGLDELETEPROGRAMPIPELINESPROC)load("glDeleteProgramPipelines");
  1275. glad_glGenProgramPipelines = (PFNGLGENPROGRAMPIPELINESPROC)load("glGenProgramPipelines");
  1276. glad_glIsProgramPipeline = (PFNGLISPROGRAMPIPELINEPROC)load("glIsProgramPipeline");
  1277. glad_glGetProgramPipelineiv = (PFNGLGETPROGRAMPIPELINEIVPROC)load("glGetProgramPipelineiv");
  1278. glad_glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC)load("glProgramParameteri");
  1279. glad_glProgramUniform1i = (PFNGLPROGRAMUNIFORM1IPROC)load("glProgramUniform1i");
  1280. glad_glProgramUniform1iv = (PFNGLPROGRAMUNIFORM1IVPROC)load("glProgramUniform1iv");
  1281. glad_glProgramUniform1f = (PFNGLPROGRAMUNIFORM1FPROC)load("glProgramUniform1f");
  1282. glad_glProgramUniform1fv = (PFNGLPROGRAMUNIFORM1FVPROC)load("glProgramUniform1fv");
  1283. glad_glProgramUniform1d = (PFNGLPROGRAMUNIFORM1DPROC)load("glProgramUniform1d");
  1284. glad_glProgramUniform1dv = (PFNGLPROGRAMUNIFORM1DVPROC)load("glProgramUniform1dv");
  1285. glad_glProgramUniform1ui = (PFNGLPROGRAMUNIFORM1UIPROC)load("glProgramUniform1ui");
  1286. glad_glProgramUniform1uiv = (PFNGLPROGRAMUNIFORM1UIVPROC)load("glProgramUniform1uiv");
  1287. glad_glProgramUniform2i = (PFNGLPROGRAMUNIFORM2IPROC)load("glProgramUniform2i");
  1288. glad_glProgramUniform2iv = (PFNGLPROGRAMUNIFORM2IVPROC)load("glProgramUniform2iv");
  1289. glad_glProgramUniform2f = (PFNGLPROGRAMUNIFORM2FPROC)load("glProgramUniform2f");
  1290. glad_glProgramUniform2fv = (PFNGLPROGRAMUNIFORM2FVPROC)load("glProgramUniform2fv");
  1291. glad_glProgramUniform2d = (PFNGLPROGRAMUNIFORM2DPROC)load("glProgramUniform2d");
  1292. glad_glProgramUniform2dv = (PFNGLPROGRAMUNIFORM2DVPROC)load("glProgramUniform2dv");
  1293. glad_glProgramUniform2ui = (PFNGLPROGRAMUNIFORM2UIPROC)load("glProgramUniform2ui");
  1294. glad_glProgramUniform2uiv = (PFNGLPROGRAMUNIFORM2UIVPROC)load("glProgramUniform2uiv");
  1295. glad_glProgramUniform3i = (PFNGLPROGRAMUNIFORM3IPROC)load("glProgramUniform3i");
  1296. glad_glProgramUniform3iv = (PFNGLPROGRAMUNIFORM3IVPROC)load("glProgramUniform3iv");
  1297. glad_glProgramUniform3f = (PFNGLPROGRAMUNIFORM3FPROC)load("glProgramUniform3f");
  1298. glad_glProgramUniform3fv = (PFNGLPROGRAMUNIFORM3FVPROC)load("glProgramUniform3fv");
  1299. glad_glProgramUniform3d = (PFNGLPROGRAMUNIFORM3DPROC)load("glProgramUniform3d");
  1300. glad_glProgramUniform3dv = (PFNGLPROGRAMUNIFORM3DVPROC)load("glProgramUniform3dv");
  1301. glad_glProgramUniform3ui = (PFNGLPROGRAMUNIFORM3UIPROC)load("glProgramUniform3ui");
  1302. glad_glProgramUniform3uiv = (PFNGLPROGRAMUNIFORM3UIVPROC)load("glProgramUniform3uiv");
  1303. glad_glProgramUniform4i = (PFNGLPROGRAMUNIFORM4IPROC)load("glProgramUniform4i");
  1304. glad_glProgramUniform4iv = (PFNGLPROGRAMUNIFORM4IVPROC)load("glProgramUniform4iv");
  1305. glad_glProgramUniform4f = (PFNGLPROGRAMUNIFORM4FPROC)load("glProgramUniform4f");
  1306. glad_glProgramUniform4fv = (PFNGLPROGRAMUNIFORM4FVPROC)load("glProgramUniform4fv");
  1307. glad_glProgramUniform4d = (PFNGLPROGRAMUNIFORM4DPROC)load("glProgramUniform4d");
  1308. glad_glProgramUniform4dv = (PFNGLPROGRAMUNIFORM4DVPROC)load("glProgramUniform4dv");
  1309. glad_glProgramUniform4ui = (PFNGLPROGRAMUNIFORM4UIPROC)load("glProgramUniform4ui");
  1310. glad_glProgramUniform4uiv = (PFNGLPROGRAMUNIFORM4UIVPROC)load("glProgramUniform4uiv");
  1311. glad_glProgramUniformMatrix2fv = (PFNGLPROGRAMUNIFORMMATRIX2FVPROC)load("glProgramUniformMatrix2fv");
  1312. glad_glProgramUniformMatrix3fv = (PFNGLPROGRAMUNIFORMMATRIX3FVPROC)load("glProgramUniformMatrix3fv");
  1313. glad_glProgramUniformMatrix4fv = (PFNGLPROGRAMUNIFORMMATRIX4FVPROC)load("glProgramUniformMatrix4fv");
  1314. glad_glProgramUniformMatrix2dv = (PFNGLPROGRAMUNIFORMMATRIX2DVPROC)load("glProgramUniformMatrix2dv");
  1315. glad_glProgramUniformMatrix3dv = (PFNGLPROGRAMUNIFORMMATRIX3DVPROC)load("glProgramUniformMatrix3dv");
  1316. glad_glProgramUniformMatrix4dv = (PFNGLPROGRAMUNIFORMMATRIX4DVPROC)load("glProgramUniformMatrix4dv");
  1317. glad_glProgramUniformMatrix2x3fv = (PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC)load("glProgramUniformMatrix2x3fv");
  1318. glad_glProgramUniformMatrix3x2fv = (PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC)load("glProgramUniformMatrix3x2fv");
  1319. glad_glProgramUniformMatrix2x4fv = (PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC)load("glProgramUniformMatrix2x4fv");
  1320. glad_glProgramUniformMatrix4x2fv = (PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC)load("glProgramUniformMatrix4x2fv");
  1321. glad_glProgramUniformMatrix3x4fv = (PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC)load("glProgramUniformMatrix3x4fv");
  1322. glad_glProgramUniformMatrix4x3fv = (PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC)load("glProgramUniformMatrix4x3fv");
  1323. glad_glProgramUniformMatrix2x3dv = (PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC)load("glProgramUniformMatrix2x3dv");
  1324. glad_glProgramUniformMatrix3x2dv = (PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC)load("glProgramUniformMatrix3x2dv");
  1325. glad_glProgramUniformMatrix2x4dv = (PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC)load("glProgramUniformMatrix2x4dv");
  1326. glad_glProgramUniformMatrix4x2dv = (PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC)load("glProgramUniformMatrix4x2dv");
  1327. glad_glProgramUniformMatrix3x4dv = (PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC)load("glProgramUniformMatrix3x4dv");
  1328. glad_glProgramUniformMatrix4x3dv = (PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC)load("glProgramUniformMatrix4x3dv");
  1329. glad_glValidateProgramPipeline = (PFNGLVALIDATEPROGRAMPIPELINEPROC)load("glValidateProgramPipeline");
  1330. glad_glGetProgramPipelineInfoLog = (PFNGLGETPROGRAMPIPELINEINFOLOGPROC)load("glGetProgramPipelineInfoLog");
  1331. glad_glVertexAttribL1d = (PFNGLVERTEXATTRIBL1DPROC)load("glVertexAttribL1d");
  1332. glad_glVertexAttribL2d = (PFNGLVERTEXATTRIBL2DPROC)load("glVertexAttribL2d");
  1333. glad_glVertexAttribL3d = (PFNGLVERTEXATTRIBL3DPROC)load("glVertexAttribL3d");
  1334. glad_glVertexAttribL4d = (PFNGLVERTEXATTRIBL4DPROC)load("glVertexAttribL4d");
  1335. glad_glVertexAttribL1dv = (PFNGLVERTEXATTRIBL1DVPROC)load("glVertexAttribL1dv");
  1336. glad_glVertexAttribL2dv = (PFNGLVERTEXATTRIBL2DVPROC)load("glVertexAttribL2dv");
  1337. glad_glVertexAttribL3dv = (PFNGLVERTEXATTRIBL3DVPROC)load("glVertexAttribL3dv");
  1338. glad_glVertexAttribL4dv = (PFNGLVERTEXATTRIBL4DVPROC)load("glVertexAttribL4dv");
  1339. glad_glVertexAttribLPointer = (PFNGLVERTEXATTRIBLPOINTERPROC)load("glVertexAttribLPointer");
  1340. glad_glGetVertexAttribLdv = (PFNGLGETVERTEXATTRIBLDVPROC)load("glGetVertexAttribLdv");
  1341. glad_glViewportArrayv = (PFNGLVIEWPORTARRAYVPROC)load("glViewportArrayv");
  1342. glad_glViewportIndexedf = (PFNGLVIEWPORTINDEXEDFPROC)load("glViewportIndexedf");
  1343. glad_glViewportIndexedfv = (PFNGLVIEWPORTINDEXEDFVPROC)load("glViewportIndexedfv");
  1344. glad_glScissorArrayv = (PFNGLSCISSORARRAYVPROC)load("glScissorArrayv");
  1345. glad_glScissorIndexed = (PFNGLSCISSORINDEXEDPROC)load("glScissorIndexed");
  1346. glad_glScissorIndexedv = (PFNGLSCISSORINDEXEDVPROC)load("glScissorIndexedv");
  1347. glad_glDepthRangeArrayv = (PFNGLDEPTHRANGEARRAYVPROC)load("glDepthRangeArrayv");
  1348. glad_glDepthRangeIndexed = (PFNGLDEPTHRANGEINDEXEDPROC)load("glDepthRangeIndexed");
  1349. glad_glGetFloati_v = (PFNGLGETFLOATI_VPROC)load("glGetFloati_v");
  1350. glad_glGetDoublei_v = (PFNGLGETDOUBLEI_VPROC)load("glGetDoublei_v");
  1351. }
  1352. static void load_GL_VERSION_4_2(GLADloadproc load) {
  1353. if(!GLAD_GL_VERSION_4_2) return;
  1354. glad_glDrawArraysInstancedBaseInstance = (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)load("glDrawArraysInstancedBaseInstance");
  1355. glad_glDrawElementsInstancedBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)load("glDrawElementsInstancedBaseInstance");
  1356. glad_glDrawElementsInstancedBaseVertexBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)load("glDrawElementsInstancedBaseVertexBaseInstance");
  1357. glad_glGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC)load("glGetInternalformativ");
  1358. glad_glGetActiveAtomicCounterBufferiv = (PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC)load("glGetActiveAtomicCounterBufferiv");
  1359. glad_glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)load("glBindImageTexture");
  1360. glad_glMemoryBarrier = (PFNGLMEMORYBARRIERPROC)load("glMemoryBarrier");
  1361. glad_glTexStorage1D = (PFNGLTEXSTORAGE1DPROC)load("glTexStorage1D");
  1362. glad_glTexStorage2D = (PFNGLTEXSTORAGE2DPROC)load("glTexStorage2D");
  1363. glad_glTexStorage3D = (PFNGLTEXSTORAGE3DPROC)load("glTexStorage3D");
  1364. glad_glDrawTransformFeedbackInstanced = (PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC)load("glDrawTransformFeedbackInstanced");
  1365. glad_glDrawTransformFeedbackStreamInstanced = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC)load("glDrawTransformFeedbackStreamInstanced");
  1366. }
  1367. static void load_GL_VERSION_4_3(GLADloadproc load) {
  1368. if(!GLAD_GL_VERSION_4_3) return;
  1369. glad_glClearBufferData = (PFNGLCLEARBUFFERDATAPROC)load("glClearBufferData");
  1370. glad_glClearBufferSubData = (PFNGLCLEARBUFFERSUBDATAPROC)load("glClearBufferSubData");
  1371. glad_glDispatchCompute = (PFNGLDISPATCHCOMPUTEPROC)load("glDispatchCompute");
  1372. glad_glDispatchComputeIndirect = (PFNGLDISPATCHCOMPUTEINDIRECTPROC)load("glDispatchComputeIndirect");
  1373. glad_glCopyImageSubData = (PFNGLCOPYIMAGESUBDATAPROC)load("glCopyImageSubData");
  1374. glad_glFramebufferParameteri = (PFNGLFRAMEBUFFERPARAMETERIPROC)load("glFramebufferParameteri");
  1375. glad_glGetFramebufferParameteriv = (PFNGLGETFRAMEBUFFERPARAMETERIVPROC)load("glGetFramebufferParameteriv");
  1376. glad_glGetInternalformati64v = (PFNGLGETINTERNALFORMATI64VPROC)load("glGetInternalformati64v");
  1377. glad_glInvalidateTexSubImage = (PFNGLINVALIDATETEXSUBIMAGEPROC)load("glInvalidateTexSubImage");
  1378. glad_glInvalidateTexImage = (PFNGLINVALIDATETEXIMAGEPROC)load("glInvalidateTexImage");
  1379. glad_glInvalidateBufferSubData = (PFNGLINVALIDATEBUFFERSUBDATAPROC)load("glInvalidateBufferSubData");
  1380. glad_glInvalidateBufferData = (PFNGLINVALIDATEBUFFERDATAPROC)load("glInvalidateBufferData");
  1381. glad_glInvalidateFramebuffer = (PFNGLINVALIDATEFRAMEBUFFERPROC)load("glInvalidateFramebuffer");
  1382. glad_glInvalidateSubFramebuffer = (PFNGLINVALIDATESUBFRAMEBUFFERPROC)load("glInvalidateSubFramebuffer");
  1383. glad_glMultiDrawArraysIndirect = (PFNGLMULTIDRAWARRAYSINDIRECTPROC)load("glMultiDrawArraysIndirect");
  1384. glad_glMultiDrawElementsIndirect = (PFNGLMULTIDRAWELEMENTSINDIRECTPROC)load("glMultiDrawElementsIndirect");
  1385. glad_glGetProgramInterfaceiv = (PFNGLGETPROGRAMINTERFACEIVPROC)load("glGetProgramInterfaceiv");
  1386. glad_glGetProgramResourceIndex = (PFNGLGETPROGRAMRESOURCEINDEXPROC)load("glGetProgramResourceIndex");
  1387. glad_glGetProgramResourceName = (PFNGLGETPROGRAMRESOURCENAMEPROC)load("glGetProgramResourceName");
  1388. glad_glGetProgramResourceiv = (PFNGLGETPROGRAMRESOURCEIVPROC)load("glGetProgramResourceiv");
  1389. glad_glGetProgramResourceLocation = (PFNGLGETPROGRAMRESOURCELOCATIONPROC)load("glGetProgramResourceLocation");
  1390. glad_glGetProgramResourceLocationIndex = (PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC)load("glGetProgramResourceLocationIndex");
  1391. glad_glShaderStorageBlockBinding = (PFNGLSHADERSTORAGEBLOCKBINDINGPROC)load("glShaderStorageBlockBinding");
  1392. glad_glTexBufferRange = (PFNGLTEXBUFFERRANGEPROC)load("glTexBufferRange");
  1393. glad_glTexStorage2DMultisample = (PFNGLTEXSTORAGE2DMULTISAMPLEPROC)load("glTexStorage2DMultisample");
  1394. glad_glTexStorage3DMultisample = (PFNGLTEXSTORAGE3DMULTISAMPLEPROC)load("glTexStorage3DMultisample");
  1395. glad_glTextureView = (PFNGLTEXTUREVIEWPROC)load("glTextureView");
  1396. glad_glBindVertexBuffer = (PFNGLBINDVERTEXBUFFERPROC)load("glBindVertexBuffer");
  1397. glad_glVertexAttribFormat = (PFNGLVERTEXATTRIBFORMATPROC)load("glVertexAttribFormat");
  1398. glad_glVertexAttribIFormat = (PFNGLVERTEXATTRIBIFORMATPROC)load("glVertexAttribIFormat");
  1399. glad_glVertexAttribLFormat = (PFNGLVERTEXATTRIBLFORMATPROC)load("glVertexAttribLFormat");
  1400. glad_glVertexAttribBinding = (PFNGLVERTEXATTRIBBINDINGPROC)load("glVertexAttribBinding");
  1401. glad_glVertexBindingDivisor = (PFNGLVERTEXBINDINGDIVISORPROC)load("glVertexBindingDivisor");
  1402. glad_glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)load("glDebugMessageControl");
  1403. glad_glDebugMessageInsert = (PFNGLDEBUGMESSAGEINSERTPROC)load("glDebugMessageInsert");
  1404. glad_glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)load("glDebugMessageCallback");
  1405. glad_glGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGPROC)load("glGetDebugMessageLog");
  1406. glad_glPushDebugGroup = (PFNGLPUSHDEBUGGROUPPROC)load("glPushDebugGroup");
  1407. glad_glPopDebugGroup = (PFNGLPOPDEBUGGROUPPROC)load("glPopDebugGroup");
  1408. glad_glObjectLabel = (PFNGLOBJECTLABELPROC)load("glObjectLabel");
  1409. glad_glGetObjectLabel = (PFNGLGETOBJECTLABELPROC)load("glGetObjectLabel");
  1410. glad_glObjectPtrLabel = (PFNGLOBJECTPTRLABELPROC)load("glObjectPtrLabel");
  1411. glad_glGetObjectPtrLabel = (PFNGLGETOBJECTPTRLABELPROC)load("glGetObjectPtrLabel");
  1412. glad_glGetPointerv = (PFNGLGETPOINTERVPROC)load("glGetPointerv");
  1413. }
  1414. static int find_extensionsGL(void) {
  1415. if (!get_exts()) return 0;
  1416. (void)&has_ext;
  1417. free_exts();
  1418. return 1;
  1419. }
  1420. static void find_coreGL(void) {
  1421. /* Thank you @elmindreda
  1422. * https://github.com/elmindreda/greg/blob/master/templates/greg.c.in#L176
  1423. * https://github.com/glfw/glfw/blob/master/src/context.c#L36
  1424. */
  1425. int i, major, minor;
  1426. const char* version;
  1427. const char* prefixes[] = {
  1428. "OpenGL ES-CM ",
  1429. "OpenGL ES-CL ",
  1430. "OpenGL ES ",
  1431. NULL
  1432. };
  1433. version = (const char*) glGetString(GL_VERSION);
  1434. if (!version) return;
  1435. for (i = 0; prefixes[i]; i++) {
  1436. const size_t length = strlen(prefixes[i]);
  1437. if (strncmp(version, prefixes[i], length) == 0) {
  1438. version += length;
  1439. break;
  1440. }
  1441. }
  1442. /* PR #18 */
  1443. #ifdef _MSC_VER
  1444. sscanf_s(version, "%d.%d", &major, &minor);
  1445. #else
  1446. sscanf(version, "%d.%d", &major, &minor);
  1447. #endif
  1448. GLVersion.major = major; GLVersion.minor = minor;
  1449. max_loaded_major = major; max_loaded_minor = minor;
  1450. GLAD_GL_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1;
  1451. GLAD_GL_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1;
  1452. GLAD_GL_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1;
  1453. GLAD_GL_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1;
  1454. GLAD_GL_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1;
  1455. GLAD_GL_VERSION_1_5 = (major == 1 && minor >= 5) || major > 1;
  1456. GLAD_GL_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2;
  1457. GLAD_GL_VERSION_2_1 = (major == 2 && minor >= 1) || major > 2;
  1458. GLAD_GL_VERSION_3_0 = (major == 3 && minor >= 0) || major > 3;
  1459. GLAD_GL_VERSION_3_1 = (major == 3 && minor >= 1) || major > 3;
  1460. GLAD_GL_VERSION_3_2 = (major == 3 && minor >= 2) || major > 3;
  1461. GLAD_GL_VERSION_3_3 = (major == 3 && minor >= 3) || major > 3;
  1462. GLAD_GL_VERSION_4_0 = (major == 4 && minor >= 0) || major > 4;
  1463. GLAD_GL_VERSION_4_1 = (major == 4 && minor >= 1) || major > 4;
  1464. GLAD_GL_VERSION_4_2 = (major == 4 && minor >= 2) || major > 4;
  1465. GLAD_GL_VERSION_4_3 = (major == 4 && minor >= 3) || major > 4;
  1466. if (GLVersion.major > 4 || (GLVersion.major >= 4 && GLVersion.minor >= 3)) {
  1467. max_loaded_major = 4;
  1468. max_loaded_minor = 3;
  1469. }
  1470. }
  1471. int gladLoadGLLoader(GLADloadproc load) {
  1472. GLVersion.major = 0; GLVersion.minor = 0;
  1473. glGetString = (PFNGLGETSTRINGPROC)load("glGetString");
  1474. if(glGetString == NULL) return 0;
  1475. if(glGetString(GL_VERSION) == NULL) return 0;
  1476. find_coreGL();
  1477. load_GL_VERSION_1_0(load);
  1478. load_GL_VERSION_1_1(load);
  1479. load_GL_VERSION_1_2(load);
  1480. load_GL_VERSION_1_3(load);
  1481. load_GL_VERSION_1_4(load);
  1482. load_GL_VERSION_1_5(load);
  1483. load_GL_VERSION_2_0(load);
  1484. load_GL_VERSION_2_1(load);
  1485. load_GL_VERSION_3_0(load);
  1486. load_GL_VERSION_3_1(load);
  1487. load_GL_VERSION_3_2(load);
  1488. load_GL_VERSION_3_3(load);
  1489. load_GL_VERSION_4_0(load);
  1490. load_GL_VERSION_4_1(load);
  1491. load_GL_VERSION_4_2(load);
  1492. load_GL_VERSION_4_3(load);
  1493. if (!find_extensionsGL()) return 0;
  1494. return GLVersion.major != 0 || GLVersion.minor != 0;
  1495. }

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/291855
推荐阅读
相关标签
  

闽ICP备14008679号