[Renderer/MG](fix): Actually load ANGLE properly

Thank you @Tungstend (again) for the tip (and code, sorry)
Co-authored-by: Tungstend <hanjinlong197@gmail.com>
This commit is contained in:
alexytomi 2025-04-11 14:23:54 +08:00
parent d9daf405b7
commit 261db7a0a8

View File

@ -4,6 +4,7 @@
#include <stddef.h>
#include <stdlib.h>
#include <dlfcn.h>
#include <string.h>
#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) {