Establishing Graphics Hardware On Windows

Started by
12 comments, last by Prototype 19 years ago
Hi, I am hoping that someone may be able to help with a problem that I am having, I need to be able to establish the graphics card of a PC without relying on a graphics API to do so. Ideally there would be some kind of windows functions to do this. Basically this is for a game based learning application (www.caspianlearning.co.uk) which will runs on the Windows platform going as far back as Windows 98. We need to be able to check that a PC has a 3D graphics card with 32Mb of ram, and given that the target audience is the School market they are likely to be years behind the times interns of hardware and software. I have searched MSDN and googled without any joy. Any assistance in this matter would be greatly appreciated. Cheers.
Advertisement
Why can't you get the graphics hardware to do that? You could write a quick app in DX7 (which most machines should have) that will get the video card name, and an estimate of the availiable video memory (It's impossible to get an exact amount).
Why do you need to check for 32Mb of video RAM?

You might be able to poke around in the registry for the list of display adapters, but I just had a look and it seems to all be hidden around behind CLSIDs, which wouldn't be too fun to parse.

You can use EnumDisplayDevices to get the device name, but you shouldn't really need to know the amount of video memory availiable on the system.
Firstly thanks for such a quick response, its much appreciated. We need to check if a graphics card has 32Mb as is the minimum spec that we support. We have run our application on out test PCs, which are a lower spec, but get a frame rate of about 5 - 12 fps which is too low. I am trying to stay away from any graphics API because school computers in the UK tend to be anything from brand new to 7 years old and I am fairly sure that direct X 7 would not be supported on a machine that old. We have considered using the registry but would prefer a method that checks dynamically if possible.
What does your application use to draw? Windows GDI?
I can't seem to find any function in the MSDN to get the amount of free video memory without using DirectX.

Apparently, SDL gives you a method to get the amount of video memory, and that returns 0 if there's no hardware acceleration availiable (I.e. no video card) (Link). Although adding SDL to your project just to get the amount of video memory might be overkill...
Actually we use commercial 3D engine to produce our application, which itself uses DirectX 9.0c. Ideally we would like to have this information before the part of our application that relies on 3D engine runs as we will choose which assets will be deployed for the application over a network to the client machine based on the client’s capabilities. As for SDL we would not want to add an additional library just for this purpose but a good none the less. The more I look into it the more relying on DirectX seem the solution.
There was a sample in the DX SDK (I don't know if it's still there) that lets you get the current DirectX version. You could use that to make sure that DX9 is installed, and if it is, you could load d3d9.dll with LoadLibrary(), get the address of "Direct3DCreate9", and use it to create a D3D9 interface without relying on D3D9 being installed. Then you could create a device (windowed mode, offscreen if possible) and query it for the amount of free video memory.
The sample code for getting the installed DX version is located at
%DX90SDK%\Samples\C++\Misc\getdxver\.
I highly doubt that you can load DX9 without having it installed.

Dunno if it works for every Windows version, but check the Registry:

HKLM\HARDWARE\DEVICEMAP\VIDEO
should contain an entry, e.g.
\Device\Video0 = \REGISTRY\Machine\System\ControlSet001\Services\nv\Device0

HKLM\Machine\System\ControlSet001\Services\nv\Device0
contains a key
HardwareInformation.MemorySize = 00 00 00 02

for my 32MB Geforce256. (0x02000000 = 32MB)

Let me know if this helps.
Quote:Original post by darookie
I highly doubt that you can load DX9 without having it installed.
There I go with my rubbish grammar again [smile]
I meant you can create a D3D device if DX9 is installed, and if it isn't, you know your app won't run, and you don't get that annoying "Windows cannot find the DLL d3d9.dll in the path [blah]" message box before your app even starts up.
Quote:Original post by nmi
Dunno if it works for every Windows version, but check the Registry:

HKLM\HARDWARE\DEVICEMAP\VIDEO
should contain an entry, e.g.
\Device\Video0 = \REGISTRY\Machine\System\ControlSet001\Services\nv\Device0

HKLM\Machine\System\ControlSet001\Services\nv\Device0
contains a key
HardwareInformation.MemorySize = 00 00 00 02

for my 32MB Geforce256. (0x02000000 = 32MB)

Let me know if this helps.
Ooh, awesome. Works on my GeForce 4 too. Anyone here got a non-nVidia card to test it on?

This topic is closed to new replies.

Advertisement