Skip to content

Commit

Permalink
Load custom GL lib after SDL2 loads its instead of before shoudl help #…
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Apr 14, 2024
1 parent ba01765 commit 4861b78
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/wrapped/wrappedsdl2.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,14 +740,15 @@ 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)
if(!my_glhandle && !GetLibInternal(box86_libGL?box86_libGL:"libGL.so.1"))
// 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
Expand Down

0 comments on commit 4861b78

Please sign in to comment.