mirror of
https://github.com/glfw/glfw.git
synced 2026-09-22 16:52:57 +00:00
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:
+4
-7
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user