Retrieving info about your graphics card in C++ (OpenGL)

Started by
6 comments, last by BombShell 20 years, 1 month ago
Hello all, Is there any way one can retrieve in C++ information about the graphics card installed in the computer? I would like to know stuff like 1. The type of card (for example nVidia GeForce 4 Ti 4200) 2. Amount and type of RAM on the card 3. Number of pixelshaders 4. and so on ... Both Win32 and Linux solutions are welcome. Thx in advance!
Advertisement
look up glGetString()

You can at least get some of the info this way.
You can get Vendor with the getstring, but most of the infos you want are to be queried in an OS dependant way.



-* So many things to do, so little time to spend. *-
-* So many things to do, so little time to spend. *-
Yeah since OpenGL relies on your video drivers for info and I/O (video-wise) operations.

// Last Attacker \\---=( LA )=---// LA Extreme \\

ICQ Number : 120585863

E-mail:

laextr@icqmail.com
"Take delight in the Lord and He will give you your heart's desires" - Psalm 37:4My Blog
As the other posters said, use glGetString() and friends to access information like vendor, chipset, number of texture units, maximal texture resolutions, etc.

Pixelshader information can be retrieved by using extensions: first, check the level of pixel/vertex shading available by looking for the extensions in question (from ARB_texture_env_combine, over NV_register_combiner, to ARB_fragment_program and ARB_fragment_shader). Once an extension has been determined available, you can use queries specific to the extension to get more info about the shader.

The amount of RAM on the card cannot be retrieved in OpenGL.
Thank you all for your replies!
By using glGetString(GL_RENDERER) I am already able to retrieve the type of the graphics card. I haven''t tried the explanation on retrieving info about the pixel shaders yet, but I''m sure that will also work

Thx a lot people
you can also use the WGL_ARB_pixel_format extension (i would guess a linux version exists as well) to access extended infomation about what kind of frame buffers you can create
OK first of all thanks again for all the replies. I decided to use Cg (with it''s profiles) to check for the availability of vertex/pixel shaders. What I''m doing is:

CGprofile prof = CG_PROFILE_UNKNOWN;
if ( cgGLIsProfileSupported(CG_PROFILE_VP30) )
prof = CG_PROFILE_VP30;
else if ( cgGLIsProfileSupported(CG_PROFILE_ARBVP1) )
prof = CG_PROFILE_ARBVP1;
else if ( cgGLIsProfileSupported(CG_PROFILE_VP20) )
prof = CG_PROFILE_VP20;
return prof;

(this piece of code is for vertex shader testing). Can anyone comment on this? I think it is a quite reliable test.

Second I have a new question Can I retrieve the clockspeed of the video card in C++? Anyone any ideas?

Greetz and tia

This topic is closed to new replies.

Advertisement