Stereo under linux with wxGTK bug

Paul Melis paul at science.uva.nl
Thu Sep 6 02:58:57 PDT 2007


Hey guys,

I noticed the recent patch in svn updating the handling of GLX_STEREO in 
wxGTK 2.8.x. I was having trouble with enabling stereo myself with the 
latest released 2.8.x version (and also 2.6) and found this thread after 
some googling.

Mehamli, Tristan wrote:

>I was wandering why the stereo was working with wxMSW and not with
>wxGTK. Apparently, after looking in gtk/glcanvas.cpp, in the function
>that turns wxAttribList into GLXAttribList, "True" or "1" is missing
>after *GLX_STEREO*.
>Source: http://www.opengl.org/sdk/docs/man/xhtml/glXChooseFBConfig.xml.

Yes, but glXChooseVisual (which also receives the attrib list) does NOT use this form of passing boolean flags
(from http://www.opengl.org/sdk/docs/man/xhtml/glXChooseVisual.xml):

"All boolean GLX attributes default to False except GLX_USE_GL, which defaults to True.
All integer GLX attributes default to zero. Default specifications are superseded by attributes included in attribList.
Boolean attributes included in attribList are understood to be True.
Integer attributes and enumerated type attributes are followed immediately by the corresponding desired or minimum value."

GLX_STEREO is a boolean attribute. The reason that the fix works is that the value 1 added in the attribList after GLX_STEREO is interpreted as GLX_USE_GL (#defined as 1) by glXChooseVisual, which is basically ignored.

After browsing through src/gtk/glcanvas.cpp I'm wondering why wxWidgets is using the framebuffer config calls at all, as another source I checked that can do OpenGL stereo rendering (OpenSceneGraph) seems to get away with just a call to glXChooseVisual to set up stereo.
Does it provide more fine-grained control over choosing the visual?

Regards,
Paul

PS Does this mean that stereo rendering has _never_ worked in wxWidgets until now?







More information about the wx-users mailing list