aboutsummaryrefslogtreecommitdiff
path: root/src/gl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gl.c')
-rw-r--r--src/gl.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gl.c b/src/gl.c
index d905eb0..7c9a6bc 100644
--- a/src/gl.c
+++ b/src/gl.c
@@ -116,8 +116,11 @@ static int mgl_gl_load_glx(mgl_gl *self) {
{ NULL, NULL }
};
+ /* In some distros (alpine for example libGLX doesn't exist, but libGL can be used instead) */
+ void *library = self->glx_library ? self->glx_library : self->gl_library;
+
for(int i = 0; required_dlsym[i].func; ++i) {
- *required_dlsym[i].func = dlsym_print_fail(self->glx_library, required_dlsym[i].name, 1);
+ *required_dlsym[i].func = dlsym_print_fail(library, required_dlsym[i].name, 1);
if(!*required_dlsym[i].func)
return -1;
}
@@ -169,11 +172,6 @@ int mgl_gl_load(mgl_gl *self) {
}
self->glx_library = dlopen("libGLX.so.0", RTLD_LAZY);
- if(!self->glx_library) {
- fprintf(stderr, "mgl error:dlopen(\"%s\", RTLD_LAZY) failed\n", "libGLX.so.0");
- mgl_gl_unload(self);
- return -1;
- }
self->egl_library = dlopen("libEGL.so.1", RTLD_LAZY);
if(!self->egl_library) {