diff --git a/USAGE.md b/USAGE.md index 266caae0..5879110f 100755 --- a/USAGE.md +++ b/USAGE.md @@ -85,3 +85,8 @@ Set level of DynaRec log #### BOX86_DYNAREC_TRACE * 0 : Disable trace for generated code (default) * 1 : Enable trace for generated code (like regular Trace, this will slow down a lot and generate huge logs) + +#### BOX86_LIBGL + * libXXXX set the name for libGL (default to libGL.so.1) + * /PATH/TO/libGLXXX set the name and path for libGL + Don't forget you need to use SDL_VIDEO_GL_DRIVER for SDL/SDL2 programs \ No newline at end of file diff --git a/src/main.c b/src/main.c index 31075c4c..3869e0a8 100755 --- a/src/main.c +++ b/src/main.c @@ -46,6 +46,7 @@ int box86_dynarec_trace = 0; #ifdef PANDORA int x11color16 = 0; #endif +char* libGL = NULL; FILE* ftrace = NULL; @@ -165,6 +166,11 @@ void LoadLogEnv() printf_log(LOG_INFO, "Try to adjust X11 Color (32->16bits) : %s\n", x11color16?"Yes":"No"); } #endif + p = getenv("BOX86_LIBGL"); + if(p) { + libGL = strdup(p); + printf("BOX86 using \"%s\" as libGL.so.1\n", p); + } } void LoadEnvPath(path_collection_t *col, const char* defpath, const char* env) @@ -268,6 +274,7 @@ void PrintHelp() { #ifdef PANDORA printf(" BOX86_X11COLOR16=1 to try convert X11 color from 32 bits to 16 bits (to avoid light green on light cyan windows\n"); #endif + printf(" BOX86_LIBGL=libXXXX set the name (and optionnaly full path) for libGL.so.1\n"); } int main(int argc, const char **argv, const char **env) { @@ -535,6 +542,8 @@ int main(int argc, const char **argv, const char **env) { // all done, free context FreeBox86Context(&context); + if(libGL) + free(libGL); return ret; } diff --git a/src/wrapped/wrappedlibgl.c b/src/wrapped/wrappedlibgl.c index bda93820..ec2c9662 100755 --- a/src/wrapped/wrappedlibgl.c +++ b/src/wrapped/wrappedlibgl.c @@ -19,6 +19,7 @@ void* my_glXGetProcAddress(x86emu_t* emu, void* name); void* my_glXGetProcAddressARB(x86emu_t* emu, void* name); void my_glDebugMessageCallback(x86emu_t* emu, void* prod, void* param); +char* libGL; const char* libglName = "libGL.so.1"; #define LIBNAME libgl @@ -57,7 +58,7 @@ EXPORT void* my_glXGetProcAddress(x86emu_t* emu, void* name) emu->context->glwrappers = fillGLProcWrapper(); // check if glxprocaddress is filled, and search for lib and fill it if needed if(!emu->context->glxprocaddress) { - library_t* lib = GetLib(emu->context->maplib, libglName); + library_t* lib = GetLib(emu->context->maplib, libGL?libGL:libglName); if(!lib) { printf_log(LOG_NONE, "Warning, libGL not found in librarian?!\n"); return NULL;