GLUT 24 bits Depth Buffer

Hi, I’ve a problem, how can I switch from 16 bits z-buffer to a 24 bits z-buffer, I use glut…

Macerlask,
I don’t think GLUT is capable to choose 16bit, 24bit or 32bit depth buffer as your wish. It picks the best format based on your params in glutInitDisplayMode().

First, make sure your video card can support 24bit or 32bit depth buffer. You may use my glinfo.zip to see all possible visual modes if you are using Windows. (It will print out GL infos into “glinfo.txt” file.) If you are Linux/Unix user, just run “glxinfo” to see 24bit z-buffer is available.

If the video card can have 24bit z-buffer but GLUT still picks 16bit z-buffer only, then try to use different params in glutInitDisplayMode(), for example,
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL);

Other possibility is the video driver may limit z-buffer to 16 bit. My driver has an option to force z-buffer 16 bit only.