Path: blob/master/thirdparty/glad/patches/0001-enable-both-gl-and-gles.patch
9912 views
diff --git a/thirdparty/glad/gl.c b/thirdparty/glad/gl.c1index e8cc5ff1d9..ee0cc188fc 1006442--- a/thirdparty/glad/gl.c3+++ b/thirdparty/glad/gl.c4@@ -2475,7 +2475,7 @@ static GLADapiproc glad_gl_get_proc(void *vuserptr, const char *name) {5return result;6}78-static void* _glad_GL_loader_handle = NULL;9+static void* _glad_gles_loader_handle = NULL;1011static void* glad_gl_dlopen_handle(void) {12#if GLAD_PLATFORM_APPLE13@@ -2497,11 +2497,11 @@ static void* glad_gl_dlopen_handle(void) {14};15#endif1617- if (_glad_GL_loader_handle == NULL) {18- _glad_GL_loader_handle = glad_get_dlopen_handle(NAMES, sizeof(NAMES) / sizeof(NAMES[0]));19+ if (_glad_gles_loader_handle == NULL) {20+ _glad_gles_loader_handle = glad_get_dlopen_handle(NAMES, sizeof(NAMES) / sizeof(NAMES[0]));21}2223- return _glad_GL_loader_handle;24+ return _glad_gles_loader_handle;25}2627static struct _glad_gl_userptr glad_gl_build_userptr(void *handle) {28@@ -2527,7 +2527,7 @@ int gladLoaderLoadGL(void) {29int did_load = 0;30struct _glad_gl_userptr userptr;3132- did_load = _glad_GL_loader_handle == NULL;33+ did_load = _glad_gles_loader_handle == NULL;34handle = glad_gl_dlopen_handle();35if (handle) {36userptr = glad_gl_build_userptr(handle);37@@ -2545,9 +2545,9 @@ int gladLoaderLoadGL(void) {383940void gladLoaderUnloadGL(void) {41- if (_glad_GL_loader_handle != NULL) {42- glad_close_dlopen_handle(_glad_GL_loader_handle);43- _glad_GL_loader_handle = NULL;44+ if (_glad_gles_loader_handle != NULL) {45+ glad_close_dlopen_handle(_glad_gles_loader_handle);46+ _glad_gles_loader_handle = NULL;47}48}4950diff --git a/thirdparty/glad/glad/gl.h b/thirdparty/glad/glad/gl.h51index 7f77d6a13f..307ea4dbb8 10064452--- a/thirdparty/glad/glad/gl.h53+++ b/thirdparty/glad/glad/gl.h54@@ -67,6 +67,7 @@55#endif5657#define GLAD_GL58+#define GLAD_GLES259#define GLAD_OPTION_GL_LOADER6061#ifdef __cplusplus626364