Can the field cColorBits of my PIXELFORMATDESCRIPTOR structure be another thing of the color depth the windows work on?
I mean can I assign it to be 16 bit and my windows OS operates on 32bit color depth??
If yes, what would be the situation?
I checked at msdn.microsoft.com, searched for PIXELFORMATDESCRIPTOR and ChoosePixelFormat.
Yes, you can set cColorBits to anything you want, and it doesn’t have to match your desktop color depth. However, ChoosePixelFormat can return “the closest match” to your pfd, which means you might not get 16 bits of color for a 32-bit desktop.
I tried this with a simple WGL program – desktop set to 32 bits, requested 16 bits in cColorIndex… and when I queried OpenGL for GL_RED_BITS/GL_GREEN_BITS/GL_BLUE_BITS, I got 8/8/8. (This is with a GeForce 6800, and you might get different results with different devices.)
This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.