Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

BombShell

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

This topic is 5308 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
Advertisement
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. *-

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!