Update glad2 and switch to header-only version

This updates to a newer version of glad2 and switches to the header-only
variant.

This also (finally) switches to the newer glad2 loader signature that
allows us to pass in glfwGetInstanceProcAddress directly.
This commit is contained in:
Camilla Löwy
2021-08-25 01:18:03 +02:00
parent 518e26e16e
commit 62074f3dea
38 changed files with 4297 additions and 3749 deletions
+4 -7
View File
@@ -23,7 +23,9 @@
//
//========================================================================
#define GLAD_GL_IMPLEMENTATION
#include <glad/gl.h>
#define GLAD_VULKAN_IMPLEMENTATION
#include <glad/vulkan.h>
#define GLFW_INCLUDE_NONE
#include <GLFW/glfw3.h>
@@ -323,11 +325,6 @@ static void print_version(void)
printf("GLFW library version string: \"%s\"\n", glfwGetVersionString());
}
static GLADapiproc glad_vulkan_callback(const char* name, void* user)
{
return glfwGetInstanceProcAddress((VkInstance) user, name);
}
int main(int argc, char** argv)
{
int ch;
@@ -866,7 +863,7 @@ int main(int argc, char** argv)
if (glfwVulkanSupported())
{
gladLoadVulkanUserPtr(NULL, glad_vulkan_callback, NULL);
gladLoadVulkanUserPtr(NULL, (GLADuserptrloadfunc) glfwGetInstanceProcAddress, NULL);
uint32_t loader_version = VK_API_VERSION_1_0;
@@ -923,7 +920,7 @@ int main(int argc, char** argv)
exit(EXIT_FAILURE);
}
gladLoadVulkanUserPtr(NULL, glad_vulkan_callback, instance);
gladLoadVulkanUserPtr(NULL, (GLADuserptrloadfunc) glfwGetInstanceProcAddress, instance);
if (re)
{