diff --git a/app_pojavlauncher/src/main/jni/ctxbridges/egl_loader.c b/app_pojavlauncher/src/main/jni/ctxbridges/egl_loader.c index d64e400b0..4081dec8c 100644 --- a/app_pojavlauncher/src/main/jni/ctxbridges/egl_loader.c +++ b/app_pojavlauncher/src/main/jni/ctxbridges/egl_loader.c @@ -4,6 +4,7 @@ #include #include #include +#include #include "egl_loader.h" #include "loader_dlopen.h" @@ -32,7 +33,9 @@ EGLBoolean (*eglQuerySurface_p)( EGLDisplay display, __eglMustCastToProperFunctionPointerType (*eglGetProcAddress_p) (const char *procname); bool dlsym_EGL() { - void* dl_handle = loader_dlopen(getenv("POJAVEXEC_EGL"),"libEGL.so", RTLD_LOCAL|RTLD_LAZY); + char* gles = getenv("LIBGL_GLES"); + char* eglName = (strncmp(gles ? gles : "", "libGLESv2_angle.so", 18) == 0) ? "libEGL_angle.so" : getenv("POJAVEXEC_EGL"); + void* dl_handle = loader_dlopen(eglName,"libEGL.so", RTLD_LOCAL|RTLD_LAZY); if(dl_handle == NULL) return false; eglGetProcAddress_p = dlsym(dl_handle, "eglGetProcAddress"); if(eglGetProcAddress_p == NULL) {