description of the current GFX card in use?

BlitzMax Forums/BlitzMax Programming/description of the current GFX card in use?

Damien Sturdy(Posted 2006) [#1]
Hi,

I was wondering how I would go about getting the "name" of the current graphics card/renderer in use?

For instance ,"Render Device = Sprite Nvidia 7600GS" or whatnot.

Thanks for your help :)


TartanTangerine (was Indiepath)(Posted 2006) [#2]
Device Caps I think


Damien Sturdy(Posted 2006) [#3]
Cheers. Any info on this? I'm at work at the mo and can't do much about it but i'd like to see how i'd go about it.


TartanTangerine (was Indiepath)(Posted 2006) [#4]
I seem to remember someone posted some code a while ago on how to read the Caps into a structure.


Damien Sturdy(Posted 2006) [#5]
Hmm, I did a search and found nothing. I guess I will have to poke around a bit later when I get back to my MAX PC.

I didn't know the dev caps returned the name of the device though, just caps to say it does or doesnt do cubemapping and other functions...

Aha... maybe... *checks WIKI*


tonyg(Posted 2006) [#6]
There's a private function called enum_devices_callback which uses the devicedesc including the device name.


ozak(Posted 2006) [#7]
Much easier in OpenGL where it's a simple query :)


Damien Sturdy(Posted 2006) [#8]
Ok, i've looked. No idea about Enum_Devices_callback. It seems you're talking about Windows API here-

Ozak.. Where may I find this query?


ozak(Posted 2006) [#9]
glGetString with constants GL_VENDOR and GL_RENDERER etc.

http://www.mevis.de/opengl/glGetString.html


Damien Sturdy(Posted 2006) [#10]
Gah, thats just ID numbers not the hardware name. better than nowt, but I don't fancy creating a list of all the cards in existence :)

Cheers anyway. I'm looking to get the true name of the graphics card in the system.

In my system it this is "NVIDIA GeForce 7600 GS"

I need it at the moment because I want to bypass ogres "Hardware changed" dialogue by replacing the line in the config with the current hardware and using my own default values.

I need to avoid the windows API if at all possible :)


tonyg(Posted 2006) [#11]
SetGraphicsDriver GLMax2DDriver()
Graphics 800 , 600
Local my:Byte Ptr = glGetString(GL_RENDERER) 
Local name:String = String.FromCString(my)	
Print name

might need some trimming.


Damien Sturdy(Posted 2006) [#12]
Ah, right, Sorry guys, i misread the given information.

Thanks Ozak, and Thanks TonyG :D Thats exactly what I need!