Skip to content

Commit

Permalink
Don't load libGL in SDL_GL_GetProcAddress for GOA_CLONES config (for #…
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Apr 14, 2024
1 parent 4861b78 commit 3744603
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/wrapped/wrappedsdl2.c
Original file line number Diff line number Diff line change
Expand Up @@ -739,15 +739,17 @@ 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);
#ifndef GOA_CLONE
static int lib_checked = 0;
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);
}
#endif
return ret;
}

Expand Down

0 comments on commit 3744603

Please sign in to comment.