I’m writing a medical-image (3D data) viewer in C#, with OpenGL serving as the main display. I am using an OGL “front end” that marshalls the OpenGL functionality from the OGL dll via InteropServices. This makes it a lot easier for me to access and implement OGL from my managed code.
The thing is, the code is hard-written to use “opengl32.dll”, which is the default OOB Windows OGL implementation. Many of the systems I’d like to use the app with naturally have vendor-supplied driver suites installed, including their own (better) OGL files (i.e. “nvoglnt.dll”). But these files are variously named, and I’d like the program to default to using the “currently implemented” driver, and only fall back to the Windows driver in the event of errors.
So I’d like to know how, within C# (or even C++) I can poll the OS for which dll it is actually using to implement OGL. I have tried using some DirectX.Direct3D.Manager calls, but it doesn’t access this info. When I view the display driver properties (detail) from the OS, it lists all of the driver components, including the OGL dll. But I can’t for the life of me find out how to get this at runtime. Perhaps in the registry, but I’m unclear as to how to access this, and particularly, in a manner workable on XP, Vista, and 7.