From 4861b78dc4f84359cf696824593e106035aa29e1 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sun, 14 Apr 2024 11:51:06 +0200 Subject: [PATCH] Load custom GL lib after SDL2 loads its instead of before shoudl help #950 --- src/wrapped/wrappedsdl2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wrapped/wrappedsdl2.c b/src/wrapped/wrappedsdl2.c index 074a9615f..2fcf59e4e 100755 --- a/src/wrapped/wrappedsdl2.c +++ b/src/wrapped/wrappedsdl2.c @@ -740,6 +740,7 @@ EXPORT void* my2_SDL_GL_GetProcAddress(x86emu_t* emu, void* name) khint_t k; const char* rname = (const char*)name; static int lib_checked = 0; + void* ret = getGLProcAddress(emu, (glprocaddress_t)my->SDL_GL_GetProcAddress, rname); if(!lib_checked) { lib_checked = 1; // check if libGL is loaded, load it if not (helps some Haxe games, like DeadCells or Nuclear Blaze) @@ -747,7 +748,7 @@ EXPORT void* my2_SDL_GL_GetProcAddress(x86emu_t* emu, void* name) // use a my_dlopen to actually open that lib, like SDL2 is doing... my_glhandle = my_dlopen(emu, box86_libGL?box86_libGL:"libGL.so.1", RTLD_LAZY|RTLD_GLOBAL); } - return getGLProcAddress(emu, (glprocaddress_t)my->SDL_GL_GetProcAddress, rname); + return ret; } #define nb_once 16