Detecting driver version

Does anyone know of a way to find out which OpenGL driver version a user is running (e.g. detonator “6.50”)? I tried using EnumDisplayModes(), but that doesn’t return the driver version field in the DEVMODE structure. I could look in the registry, but the location of the key I need probably differs between Windows versions.

I could also read the version info resource of the OpenGL DLL, but then I need a way to find out what the DLL’s filename is (e.g. nvOpenGL.dll).

Thanks,

  • Tom

[This message has been edited by Tom Nuydens (edited 05-02-2001).]

I’m not sure,but I think windows stores ICD info in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\ registry key,and the \dll subkey contains library name,so you could read its resources.

Hope this helps.

[This message has been edited by Michail Bespalov (edited 05-02-2001).]

don’t know if it’ll help but you should know that already
glGetString(GL_VENDOR);
glGetString(GL_RENDERER);

Originally posted by Sylvain:
don’t know if it’ll help but you should know that already
glGetString(GL_VENDOR);
glGetString(GL_RENDERER);

Of course, but that returns the OpenGL version (e.g. “1.2.1”), not the driver version.

Michail, your approach seems to work, except the location of that key is different under Win9x and WinNT/2K. I guess I’ll just have to check all Windows versions for the location of that key, and write special case code for all of them

Thanks for the help,

  • Tom

The best answer is, “don’t.” Detecting driver versions is a BAD idea.

The other answer is that the version string does tell you the version. 1.2.1 doesn’t mean OGL 1.2.1 – it means 1.2, release 1. We’ve also shipped 1.2.0 and 1.2.2.

  • Matt

Originally posted by mcraighead:
The best answer is, “don’t.” Detecting driver versions is a BAD idea.

Imagine a developer tech support department. Silence. Sleepy support representatives watch the dust that swirls in the shafts of light streaming in through the half-closed blind, and filing a feature request to emulate that in the next game.

Suddenly, the phone rings!

  • Welcome to Silly Games, how can I help you?
  • Yeah, I bought that game “Dorky’s Shoot-out”
  • A-hah.
  • You make that, right?
  • Yes, we do.
  • Well, it doesn’t work.
  • Did you plug in the computer?
  • Yes, I did. At least I think I did. How do I check?

    <two hours later>
  • So what version of OpenGL drivers are you using?
  • I don’t know. How do I check?

Here, reality splits. In the alternate reality without developer-checked driver versions, the answer involves finding out which version of Windows is being run, guiding the user to the right control panel, telling him to click on the right sequence of buttons and tabs, to finally be reading a 4-component version number out of a list box. How to get there has literally been different between each version of Windows I’ve used (95, 98, ME, NT4, 2k).

In the alternate reality I prefer, the answer is “check the start-up screen of the game” or “start the game from the command line and see what it says” or maybe even “open the file c:\dorkys.txt and read it to me”

I think DirectX has some easy way of extracting the real version number, but the OGL version and renderer strings are probably still your best bet.

If the purpose of this is purely diagnostic in nature, that’s one thing. It’s very bad to put real version behavior dependencies in an app, though. (I’d hate to debug a problem like that – app works with version X but not with version Y, and it turns out changing the version number fixes the problem.)

  • Matt

Originally posted by mcraighead:
The best answer is, “don’t.” Detecting driver versions is a BAD idea.

Come on Matt, you know me better than to think I would build a driver dependency into my apps!

Oh, wait. No you don’t

Actually, the reason I’m asking is indeed purely for diagnostics, like jwatte suggested. Take a look at http://www.gamedeveloper.org/delphi3d/hardware and it will all become clear.

  • Tom

>>In the alternate reality I prefer, the answer is “check the start-up screen of the game” or “start the game from the command line and see what it says” <<

  • Well, it doesn’t work.

Couldn’t resist.