From c086f0d24e6ca666a2567c092b2c368d7b683069 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Thu, 9 Feb 2012 13:15:15 +0000 Subject: [PATCH] Allow to specify an alternative opengl32.dll when retracing. --- glws_wgl.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 -- 2.45.2