[osg-users] quad buffer stereo problem in an embedded window
Paul Melis
paul at science.uva.nl
Mon Jul 23 15:22:05 PDT 2007
Hi,
Evan Suma wrote:
> I am having an issue with quad buffer stereo in OpenSceneGraph 2.0.
> osgViewer does not seem to set up quad buffer stereo correctly when
> run as an embedded window. I added the following 2 lines of code to
> the osgViewerQT example, which was running fine without stereo:
>
> osg::DisplaySettings::instance()->setStereoMode(osg::DisplaySettings::StereoMode::QUAD_BUFFER);
> osg::DisplaySettings::instance()->setStereo(true);
The QGLWidget that is used by osgViewerQT (in the form of the
AdapterWidget class derived from QGLWidget) is probably not initialized
in a way that creates a quad-buffered OpenGL context. I suspect you
would only have to pass the correct options to the QGLWidget constructor
being called in the AdapterWidget constructor. Something like (QT4 only):
...
AdapterWidget::AdapterWidget( QWidget * parent, const char * name, const
QGLWidget * shareWidget, WindowFlags f):
#if USE_QT4
QGLWidget(QGLFormat( DoubleBuffer | DepthBuffer | Rgba | StencilBuffer
| AlphaChannel | StereoBuffers ), parent, shareWidget, f )
#else
QGLWidget(parent, name, shareWidget, f)
#endif
{
_gw = new osgViewer::GraphicsWindowEmbedded(0,0,width(),height());
}
...
See e.g. http://doc.trolltech.com/4.3/qtopengl.html
Hope this helps,
Paul
>
> This produces the following error at runtime:
>
> Warning: detected OpenGL error 'invalid operation' after
> RenderBin::draw(,)
>
> Please be aware that stereo is enabled on my machine. I have tested
> quad buffer stereo in other OpenSceneGraph applications (which do not
> embed the viewer in a window) and it produces the correct result. Is
> anyone aware of this issue? Is there some additional setup I have to
> do in order to get quad buffer stereo working with the osgViewerQT
> example?
>
> Thanks,
> Evan
>
> --------------------
> Evan A. Suma
> Ph.D. Student
> Future Computing Lab
> University of North Carolina at Charlotte
> http://www.evansuma.com <http://www.evansuma.com>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
More information about the osg-users
mailing list