I am trying to build a fallback mechanism for OpenGL drivers in an application that uses GLFW and GLAD, where if the system provided library does not support 4.5 version, a MESA implementation is used instead.
Let’s name the system OpenGL library as opengl32.dll
and Mesa one as opengl32_mesa.dll
.
I believe GLFW loads in the OpenGL driver libraries by the standard system name opengl32.dll
. I could interject by using LoadLibrary*
functions to select the correct implementation but the library names are different. If, I load opengl32_mesa.dll
, then it won’t be picked up by GLFW since it does not match the name it expects, i.e. opengl32.dll
.
So, is it possible to load a library under a different name?
Any alternative suggestion are welcome.
TIA.