PDA

View Full Version : Detecting driver version



Tom Nuydens
05-02-2001, 02:01 AM
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).]

Michail Bespalov
05-02-2001, 02:14 AM
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).]

Sylvain
05-02-2001, 04:46 AM
don't know if it'll help but you should know that already http://www.opengl.org/discussion_boards/ubb/smile.gif
glGetString(GL_VENDOR);
glGetString(GL_RENDERER);

Tom Nuydens
05-02-2001, 11:24 AM
Originally posted by Sylvain:
don't know if it'll help but you should know that already http://www.opengl.org/discussion_boards/ubb/smile.gif
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 http://www.opengl.org/discussion_boards/ubb/frown.gif

Thanks for the help,

- Tom

mcraighead
05-02-2001, 11:36 AM
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

jwatte
05-02-2001, 02:41 PM
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"

mcraighead
05-02-2001, 03:13 PM
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

Tom Nuydens
05-02-2001, 11:37 PM
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 http://www.opengl.org/discussion_boards/ubb/smile.gif

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

Relic
05-04-2001, 01:55 AM
>>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. http://www.opengl.org/discussion_boards/ubb/wink.gif