From: José Fonseca Date: Thu, 9 Feb 2012 13:15:15 +0000 (+0000) Subject: Allow to specify an alternative opengl32.dll when retracing. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=c086f0d24e6ca666a2567c092b2c368d7b683069;p=apitrace Allow to specify an alternative opengl32.dll when retracing. --- diff --git a/glws_wgl.cpp b/glws_wgl.cpp index 59f4786..5fddb79 100644 --- a/glws_wgl.cpp +++ b/glws_wgl.cpp @@ -23,6 +23,8 @@ * **************************************************************************/ +#include + #include "glproc.hpp" #include "glws.hpp" @@ -199,7 +201,18 @@ init(void) { /* * OpenGL library must be loaded by the time we call GDI. */ - __libGlHandle = LoadLibraryA("OPENGL32"); + + const char * libgl_filename = getenv("TRACE_LIBGL"); + + if (!libgl_filename) { + libgl_filename = "OPENGL32"; + } + + __libGlHandle = LoadLibraryA(libgl_filename); + if (!__libGlHandle) { + std::cerr << "error: unable to open " << libgl_filename << "\n"; + exit(1); + } } void