From 1f675ab62f712aa0214f6423c162c8c5c0adff39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 27 Jul 2022 15:05:23 +0200 Subject: [PATCH] GLX: Add support for loading glvnd libGLX (cherry picked from commit c18851f52ec9704eb06464058a600845ec1eada1) --- README.md | 1 + src/glx_context.c | 4 ++++ src/glx_context.h | 1 - 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1802d78b..8ae21365 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,7 @@ information on what to include when reporting a bug. - [Wayland] Bugfix: Connecting a mouse after `glfwInit` would segfault (#1450) - [Linux] Bugfix: Joysticks without buttons were ignored (#2042,#2043) [EGL] Added loading of glvnd `libOpenGL.so.0` where available for OpenGL + - [GLX] Added loading of glvnd `libGLX.so.0` where available ## Contact diff --git a/src/glx_context.c b/src/glx_context.c index 1b1b3f90..46f63476 100644 --- a/src/glx_context.c +++ b/src/glx_context.c @@ -226,7 +226,10 @@ static GLFWglproc getProcAddressGLX(const char* procname) else if (_glfw.glx.GetProcAddressARB) return _glfw.glx.GetProcAddressARB((const GLubyte*) procname); else + { + // NOTE: glvnd provides GLX 1.4, so this can only happen with libGL return _glfw_dlsym(_glfw.glx.handle, procname); + } } static void destroyContextGLX(_GLFWwindow* window) @@ -263,6 +266,7 @@ GLFWbool _glfwInitGLX(void) #elif defined(__OpenBSD__) || defined(__NetBSD__) "libGL.so", #else + "libGLX.so.0", "libGL.so.1", "libGL.so", #endif diff --git a/src/glx_context.h b/src/glx_context.h index df0233eb..2ea17d19 100644 --- a/src/glx_context.h +++ b/src/glx_context.h @@ -127,7 +127,6 @@ typedef struct _GLFWlibraryGLX int eventBase; int errorBase; - // dlopen handle for libGL.so.1 void* handle; // GLX 1.3 functions