Hello,
I have been working with opengl and other graphics libraries and they all require the bits per pixel of the screen on initialization of a window. My question is, is there any way to get the system's preffered bits per pixel? or that of the monitor?

Hello,
I have been working with opengl and other graphics libraries and they all require the bits per pixel of the screen on initialization of a window. My question is, is there any way to get the system's preffered bits per pixel? or that of the monitor?

Depends on your OS. You can't use the OpenGL API until you have an OpenGL context, the creation of which is system-specific. Your operating system API should have some way to get both the current video mode and a list of all supported video modes.

If you check my tags, I am using microsoft windows and windows API.

Even so, please take the five seconds to put it in the question as well. You'll get better answers faster.

EnumDisplaySettings can get you the current video mode or a list of available modes.

This question has already been answered. Start a new discussion instead.