Pixel Format Descriptor

Started by
3 comments, last by djdynamic 21 years, 4 months ago
What is the difference between cColorBits and cDepthBits of PIXELFORMATDESCRIPTOR Thanks.
Advertisement
Ok, so I think cColorBits is bits per pixel, and cDepthBits is for the Z buffer.... Can anyone confirm, and what value should I use for the Z buffer ? 24 ?
I got yer PFD swingin...

: )


From MSDN:

cDepthBits
Specifies the depth of the depth (z-axis) buffer.

cColorBits
Specifies the number of color bitplanes in each color buffer. For RGBA pixel types, it is the size of the color buffer, excluding the alpha bitplanes. For color-index pixels, it is the size of the color-index buffer.
... and use a Z-depth of 32, typically.
Normally what you do is ask for the pixel format you''d like (e.g. 32bit colour and 32bit z buffer) and ChoosePixelFormat will pick the one it thinks is closest.

You''ll find that often the z buffer depth will be made to be 16bit if the colour depth is 16bit, and the z buffer made to 24 if the colour depth is 32bit (for cards that have 24+8bit depth+stencil buffers).

Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions

This topic is closed to new replies.

Advertisement