PDA

View Full Version : How can i detect that the user have installed the graphics driver?



Ehsan Kamrani
12-21-2005, 03:43 AM
Some users don't install their graphics driver. They think that XP installs the OpenGL driver for them. Then they play my demo and see some ugly objects. Then they say that my program is invaluable!

So i should detect whether the user have installed his/her graphics card?And more important i want to know that if their graphics card support the OpenGL API? Or does it have enough memory to run my demo?

So how can i detect the graphics card features?
-Ehsan-

Jan
12-21-2005, 05:02 AM
You can do this pretty easy:


char renderer[256] = "";
strcpy (renderer, (const char*) glGetString (GL_VENDOR));
strupr (renderer);
if (strstr (renderer, "MICROSOFT") != NULL)
throw EXCEPTION ("Your graphics-card does not support OpenGL.\nPlease update your display-driver.");If the user didn't install any drivers, the Renderer will be "Microsoft Generic" or so. Else it would contain "nVidia" or "Ati" or something else ("Intel", "XGI", ...).

Hope that helps you.

Jan.

mikael_aronsson
12-21-2005, 05:03 AM
You shouldn't!

There ate lots of drivers available and the user might be running an old one for specific reasons (bugs in new drivers for example), you do not know where to get the driver unless you start try to figure out what hardware is in use, any there may be hardware you do not know anything about so how would you get a driver....

The short answer, you should not mess with the users drivers.

Many drivers are downloaded when you run "Windows Update" (optional choice).

OpenGL 1.1 is going to work on any XP because there is a fallback software implementation.

What you can do is to check if the user is running the software opengl driver (glGetString) and also check if correct extensions are available and if not give the user a notification at startup.

Mikael

Jan
12-21-2005, 06:48 AM
Of course, you can be less drastic and not shut down, if the user runs in software and simply notify him, that his gaming experience might be very limited, as long as he doesn't upgrade.

If you need more advance features, through extensions, you need to check for their availability anyway.

Jan.