Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the graphics card model?

I was wondering how I can get the graphics card model/brand from code particularly from DirectX 9.0c (from within C++ code).

like image 336
meds Avatar asked Jul 07 '09 03:07

meds


Video Answer


2 Answers

The easiest way in DirectX is through IDirect3D9::GetAdapterIdentifier.

Just create a D3DADAPTER_IDENTIFIER9 object, pass a pointer to it to GetAdapterIdentifier. DirectX fills out the graphics card description as a string in the Description field. It also includes information on which display device the card is, and what driver version you have.

You get something like this:

  • Description: "NVIDIA GeForce GTX 570"
  • Device: "\.\DISPLAY1"
  • Driver: "nvd3dum.dll"
like image 187
JustinB Avatar answered Oct 16 '22 09:10

JustinB


At runtime, you can query the device model and vendor:

  • In OpenGL, use the command glGetString(GL_VENDOR) or GL_RENDERER or GL_VERSION to get the information you're after.

  • In DirectX 9, it appears the info is in the Microsoft config system, and is queried from the device database. It's section 3 of this document, which also has example code: http://msdn.microsoft.com/en-us/library/bb204848(VS.85).aspx Using the same system you can get such information as the amount of ram the video card has, the driver number, etc.

like image 42
Decker Avatar answered Oct 16 '22 09:10

Decker