stencil HW acceleration detection

hi, I just
read forum topics on hw accel. and from I read it seems that there’s no way to detect
if the stenciling (stencil buffer and stencil test) is accelerated in hardware ?

Am I wrong ? What would be the best to determine if the stencil is done in HW ?
Some kind of benchmark ? It’s tricky feature, cause I found, that new nvidias and atis have them, but for ex. geforce 2 doesn’t (even with yesterday’s driver), but some old onboard graphics chip Sis XX with 8 MB of memory can do stencil in HW.

The best way to handle these things is to run a mini demo on init and find the framerate/performance. Then based on this test you can determine if you wish to run the stencil buffer. Of course, you do not have to show the demo running.

Originally posted by tachyon_eagle:
hi, I just
read forum topics on hw accel. and from I read it seems that there’s no way to detect
if the stenciling (stencil buffer and stencil test) is accelerated in hardware ?

Correct.

Am I wrong ? What would be the best to determine if the stencil is done in HW ?
Some kind of benchmark ? It’s tricky feature, cause I found, that new nvidias and atis have them, but for ex. geforce 2 doesn’t (even with yesterday’s driver), but some old onboard graphics chip Sis XX with 8 MB of memory can do stencil in HW.

Geforce 2 does support stenciling. You’re most likely in a 16 bit display mode. That won’t work. In this mode, you’ll only get 16 bit color and 16 bit z buffers, but no stencil (for memory alignment reasons, most likely). If you want a stencil buffer, you should switch to a 32 bpp display mode. There you can have 32 bpp color (rgb + destination alpha), 24 bit z and 8 bit stencil.

Modeswitches in Windows are done with the ChangeDisplaySettings functions. Look it up on MSDN, it’s quite easy to use

thanks a lot,
my code just used the glut call to init the graphics mode, so I’ve trusted it to find mode with stencil, but maybe it cannot create it in windowed mode, if it’s not possible.