Determine if Stereo is supported under GLUT


I am writing an editor using GLUT 3.7.6 and a Geforce Quadro2 Pro (modified GTS 2).
The Programm should also supply a stereo-display. My Problem now is letting the program decide if it can use GLUT_STEREO or not.
The problem is, that glutCreateWindow exits with a fatal error, if the hardware doesnot support quad-buffering. On the other hand the glGetBooleanv(GL_STEREO,&isstereo) or glutget(…) do only work with a valid window created.
So how do I decide if I can do
glutInitDisplayMode(…| GLUT_STEREO)
or not?

Any sugestions out there?

p.s.: It would bei much easier if glutCreateWindow just returns an invalid handle if something goes wrong instead of exiting the whole Application.

Hmmm… I see you have a knotty problem here!

I don’t think it’s possible to do this with GLUT but maybe if you tried the Platform Dependent extensions/Windowing System commands (e.g. GLX, WGL etc…)

I say! is it possible to mix WGL and GLUT commands?

I also thought about this (although i dont know how to do this right now), but this would lead to loosing plattform indepency.

There are 2 issues here:

  1. You can determine whether a display mode is supported by calling:


before creating the window.

  1. As far as I know, stereo support in GLUT is broken for Win32. The fix is very simple, though, if you care to recompile glut:

Look for the first occurence of the string “case GLX_STEREO” in win32_glx.c, and replace this case statement with:

*value = (visual->dwFlags & PFD_STEREO) == PFD_STEREO;

The test that is there returns a “2” instead of a “1”, which will cause troubles later. Stereo works for me with this fix (SoftQuadro on Geforce 3).

Hope this helps,


Thanks alot. I wonder how I could miss this one, reading the Glut-Spec.