PDA

View Full Version : Determine if Stereo is supported under GLUT



picard2
02-14-2002, 05:28 AM
Hi!

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.

Olumide
02-14-2002, 08:17 AM
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?

picard2
02-14-2002, 09:37 AM
I also thought about this (although i dont know how to do this right now), but this would lead to loosing plattform indepency.

wimmer
02-15-2002, 06:10 AM
There are 2 issues here:

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

glutGet(GLUT_DISPLAY_MODE_POSSIBLE);

before creating the window.

2) 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:

case GLX_STEREO:
*value = (visual->dwFlags & PFD_STEREO) == PFD_STEREO;
break;

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,

Michael

picard2
02-17-2002, 06:36 AM
Thanks alot. I wonder how I could miss this one, reading the Glut-Spec.