I'm programming a small OpenGL application on a Win32 window. I would like to automatically detect the graphics card that is installed on the system where the application is running, as well as its features (i.e. current resolution, current bit depth, current refresh rate,dual monitors?, if yes, which one is the primary, its resolution, refresh rate, maximum resolution, maximum refresh rate,...). So, basically, how can I query for graphics hardware capabilities?
At the moment, what I have is an structure that can hold the default resolution, default bit depth, default refresh rate, the name of the graphics card, the name of the vendor (e.g. NVIDIA), and the model of the graphics card. I do this by accesing a registry key, however, I think this is an "unelegant" way of doing it. I was thinking, maybe I could use some DirectX commands, I've heard that it is easier for obtaining hardware features.
Any piece of advice will be welcome, and since this is not an easy question (I've done a thourough search on the web, and have found nothing so far =( _ if you provide me with a very good answer, I'll double the points.