View Full Version : wglChoosePixelFormatARB attribute question

01-15-2011, 11:32 PM

How can I know how many max bits to pass as parameters in attributes for
I use all of these.Is there any limitation of total number of bits they can take together?


01-16-2011, 03:49 AM
I don't quite understand what you meant with "max bit to pass". All attributes you have mentioned are values not flags.

Generally, you can iterate through all supported pixel formats and find a format that suites your needs best.

01-16-2011, 04:29 AM
I meant bits and not bit
What are maximal number of bits for these attributes and can I just pass maximal number of bits for each of these attributes?
Is there any side effects of passing maximal values?
I'm a beginner and I can't find any material explaining how to know these correct values.I remember I once read about z-buffer - that if we can afford then better to pass as much as we can (even 32 bits). I dont understand - why I could not afford to have 32 bits for z-bufer?


01-16-2011, 07:00 AM
Realistic values are 8 bits for alpha and stencil.
24 for depth. 32 bits depth only exists as offscreen buffers.

Number of supported and/or useful samples vary wildly between cards. Using 2 or 4 is good value for decent hardware, drop to 0 if too slow. Can be much larger on some cards, but "available" does not mean "fast enough to be usable".

01-16-2011, 08:55 AM
Thank you!

But regards multisampling, what do you mean "if too slow drop to 0" - then will be no multisampling ? I'm using it for polygon antialiasing. Did you mean it makes little difference having 2 samples or not all?

Alfonse Reinheart
01-16-2011, 09:10 AM
He's saying that multisampling costs performance, and therefore if it is too slow for your application, you should turn it off by asking for 0 samples.