Detecting Video Card

Started by
7 comments, last by Rhaal 15 years, 4 months ago
So I'm trying to detect system information to compare against system requirements that I set for my game. So far, I've found testing CPU, RAM, HD space and Windows version is straightforward, but when it comes to Video Cards I'm a bit lost. I know I will be targeting Windows XP and above, so using the registry or win32 is ok with me. So let's say I want to require "Ati x1300 OR Nvidia 7800". How do I check the computer to see what brand of video card they have, and then go from there to checking the version number? Is it in the registry somewhere, and if so - is it going to be there without DirectX installed? Do I need to get some ATI and Nvidia API to link with? Edit: I should say I can't use DirectX, because that's another thing I'm checking. If they don't have it installed, I still want to show whether the video card is otherwise sufficient. [Edited by - Rhaal on December 11, 2008 10:46:34 AM]
- A momentary maniac with casual delusions.
Advertisement
Quote:Original post by Rhaal
So I'm trying to detect system information to compare against system requirements that I set for my game. So far, I've found testing CPU, RAM, HD space and Windows version is straightforward, but when it comes to Video Cards I'm a bit lost. I know I will be targeting Windows XP and above, so using the registry or win32 is ok with me.

So let's say I want to require "Ati x1300 OR Nvidia 7800". How do I check the computer to see what brand of video card they have, and then go from there to checking the version number?

Is it in the registry somewhere, and if so - is it going to be there without DirectX installed?

Do I need to get some ATI and Nvidia API to link with?


Edit: I should say I can't use DirectX, because that's another thing I'm checking. If they don't have it installed, I still want to show whether the video card is otherwise sufficient.
Short answer is you don't. Long answer is that you shouldn't care about the name of the video card; different driver versions for the same card could have different features. You should always check that the card supports the features you need.

As an aside, you can still use DirectX; just load d3d9.dll at runtime with LoadLibrary(), and use GetProcAddress() to get the address of Direct3DCreate9(). Then you can create an IDirect3DDevice9 interface and get the adapter names. If any of those steps fails, then D3D or D3D drivers aren't installed.
Yeah I probably should check specific capabilities. I do still want to display the name of the video card for cosmetic purposes though. I see this in msinfo32.exe:

System Summary->Components->Display->"Adapter Type->"Geforce 6800 Ultra, Microsoft Compatible"

I'm digging in the registry though, and can't find this information. I'd think it'd be under HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\VIDEO but no luck. I've even searched the entire registry for the exact string.
- A momentary maniac with casual delusions.
Quote:Original post by Rhaal
Yeah I probably should check specific capabilities. I do still want to display the name of the video card for cosmetic purposes though. I see this in msinfo32.exe:

System Summary->Components->Display->"Adapter Type->"Geforce 6800 Ultra, Microsoft Compatible"

I'm digging in the registry though, and can't find this information. I'd think it'd be under HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\VIDEO but no luck. I've even searched the entire registry for the exact string.
I'd be inclined to load d3d9.dll at runtime and get the adapter identifier string.
D3DADAPTER_IDENTIFIER9 AdapterInfo;

lpD3D->GetAdapterIdentifier(D3DADAPTER_DEFAULT, D3DENUM_WHQL_LEVEL, &AdapterInfo);

then AdapterInfo.Description will be the adapter name as an array of chars.
Quote:Original post by Evil Steve
I'd be inclined to load d3d9.dll at runtime and get the adapter identifier string.


Ok I'll try that. I thought you were implying GetAdapterIdentifier would fail in the case they don't have DirectX but it's worth a shot. Thanks!
- A momentary maniac with casual delusions.
Quote:Original post by Rhaal
Quote:Original post by Evil Steve
I'd be inclined to load d3d9.dll at runtime and get the adapter identifier string.


Ok I'll try that. I thought you were implying GetAdapterIdentifier would fail in the case they don't have DirectX but it's worth a shot. Thanks!
It may well still fail. But if there's no drivers installed, how can Windows know what the video card name is?
Quote:Original post by Evil Steve
It may well still fail. But if there's no drivers installed, how can Windows know what the video card name is?


I don't know, but it does. Like I said, when I run msinfo32 it knows I have "Geforce 6800 Ultra, Microsoft Compatible". I'm sure it's just a brand string somewhere, similar to the cpu, but I don't know where it comes from.

Edit: Nevermind, I think you're talking about display drivers and I'm talking about DirectX drivers. I am ok displaying "Unknown" with no display drivers. It seems that one dx lib is enough :)
- A momentary maniac with casual delusions.
Ok I'm able to get the Description and Pixel Shader version, but I can't figure out how to get the VRAM size. How do I determine if they have a big enough video card in that regard? (128 MB / 512 MB etc). It doesn't seem to be a part of D3DCAPS9.
- A momentary maniac with casual delusions.

This topic is closed to new replies.

Advertisement