Video initialization

Hi! I’m trying to detect the video card & monitor so that my program can adjust to the computer that’s currently running it.

Is there any easy way to do this?

mw

depends on the platform …

on win32 you will use
choosePixelFormat, DescribePixelFormat, GetPixelFormat, SetPixelFormat

to get the hardware capabilities like depth buffer bits, …

afterwards you can use glGetString…
to obtain information about your gl subsystem

This question is like a question about the OpenML implementation.But in OpenGL, why do you want to detect the monitor or graphics card?You set the pixel format with some functions and they find the best pixel format for you and set it–You don’t need to know that what they do. You set a resolution like 800*600 and All the graphics monitors can support it.But you can use from the error chceking in your program and ensure that all things are correct.
If you want to use from the extensions, you can query them.
glGet String can get the name of the extensions, vendor, renderer and also version number.
-Ehsan-

What if I want high definition output for hardware that has it & non-high def for hardware without it?

mw

There are OS specific APIs to set the video mode, this is not strictly OpenGL but it is related, then when you have your resolution you can create a window and set the pixel format you need.