Skip to main content
GameDev.net gamedev.net
🔒 Locked

Obtain Video Card Name, Size, etc. in C++

Started by codemastermm Nov 18, 2005 at 3:45 AM 5 replies 13.3k views
Original Post
codemastermm
codemastermm
I am curious as to how I may be able to obtain the name of the user's graphics card(ie - GeForce 6600GT), the size it is (ie - 128 MB), and such in C/C++ I have seen a few games and programs do this (obtain the actual name and whatnot) and display it to the user during configuration. I am hoping that there is a cross-platform solution to this, but if there is not, a Windows, Mac and *nix solution would be ideal. Thanks for any help!
"Everything begins with Nu and everything ends with Nu. This is the truth! This is my belief... at least for now." - Mysteries of Life Volume 184 Chapter 26
Nitage
Nitage
You can use the graphics APIs to do this. In OpenGL it's glGetString() and I'm sure DirectX can do the same thing.
someusername
someusername
The previous reply is from me. Does anyone know why the forum logs me out while I'm replying? This is like the 2nd time in 2 days... Anyway... hope you found it useful :)
SirLuthor
SirLuthor
I've found the forum logs you out if you have a long (don't know the exact time length, probably about 15 minutes or so) period of inactivity, ie. not browsing or looking at articles, etc, so if you take a long time to type your posts, or a long time to collect the information you use in your post, well, it could happen. That's my hypothesis, anyway. I get logged out when I leave firefox on with GNnet up while playing WoW, for example.
Free speech for the living, dead men tell no tales,Your laughing finger will never point again...Omerta!Sing for me now!
codemastermm
codemastermm
I've found glGetString(GL_RENDERER) to return the name of the video card, but it displays some of its features, as well.

I'm trying to figure out a way to strip off the extra things (such as AGP, MMX, SSE, etc.) to have just a clear string of the card name such as (what I am using to test) it displays "GeForce FX 5600/AGP/SSE/3DNOW!" without any formatting or whatnot, and I'd like to have it displayed as "GeForce FX 5600" - only problem I have noticed, though. My nVidia card might be displayed as so, but an ATi card may be displayed like "Radeon 7000 DDR x86/MMX/3DNow!/SSE", so they are not the same formatting.
"Everything begins with Nu and everything ends with Nu. This is the truth! This is my belief... at least for now." - Mysteries of Life Volume 184 Chapter 26
CloudNine
CloudNine
How about parsing the string to delete anything from the '/' onwards? Of course, this would fail given a slightly different string, so it's rather pointless to try to parse, because it might fail to parse correctly on a differently formatted string. Just my thoughts.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.