aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-08-10 07:12:37 +0200
committerdec05eba <dec05eba@protonmail.com>2024-08-10 07:12:37 +0200
commit01b8cdcb77d0821bd9af3a733329fdde5091fb24 (patch)
treecb7046be544b9f8ed6271dd108bea855dea63950
parentb9b60ab29c133599032e49054f51a2adfd5ea39d (diff)
Make libglx optional (alpine doesn't have it)
-rw-r--r--src/egl.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/egl.c b/src/egl.c
index 87bb8fb..73645d6 100644
--- a/src/egl.c
+++ b/src/egl.c
@@ -503,10 +503,6 @@ bool gsr_egl_load(gsr_egl *self, Display *dpy, bool wayland, bool is_monitor_cap
}
self->glx_library = dlopen("libGLX.so.0", RTLD_LAZY);
- if(!self->glx_library) {
- fprintf(stderr, "gsr error: gsr_egl_load: failed to load libGLX.so.0, error: %s\n", dlerror());
- goto fail;
- }
self->gl_library = dlopen("libGL.so.1", RTLD_LAZY);
if(!self->egl_library) {
@@ -517,7 +513,8 @@ bool gsr_egl_load(gsr_egl *self, Display *dpy, bool wayland, bool is_monitor_cap
if(!gsr_egl_load_egl(self, self->egl_library))
goto fail;
- if(!gsr_egl_load_glx(self, self->glx_library))
+ /* In some distros (alpine for example libGLX doesn't exist, but libGL can be used instead) */
+ if(!gsr_egl_load_glx(self, self->glx_library ? self->glx_library : self->gl_library))
goto fail;
if(!gsr_egl_load_gl(self, self->gl_library))