Thanks, Robert, The osgViewer works great with stereo on my machine. It must be the OpenGL visual created by FOX. I'll try to use the context created by osg::Viewer itself.
Yanling On Tue, Aug 26, 2008 at 4:11 AM, Robert Osfield <[EMAIL PROTECTED]>wrote: > Hi Yanling, > > Yuu can't use a standard OpenGL visual to do quad buffer stereo, > you'll need to create a context with a visual that explicitly support > quad buffer stereo. The GraphicsContext support in osgViewer does > support quad buffer where this visual is supported by the underlying > OpenGL driver/hardware, so I'd recommend just using this route, at > least as an initial test to see if you can get quad buffer stereo > work. A quick test would be : > > osgviewer cow.osg --stereo QUAD_BUFFER > > Robert. > > On Mon, Aug 25, 2008 at 8:07 PM, Yanling Liu <[EMAIL PROTECTED]> wrote: > > Hi, I was trying to enable QUAD_BUFFER stereo in my OSG based application > > but failed. OSG reports error message saying "error reported in OpenGL > after > > Renderbin:draw()". > > > > I am using osgViewer::setUpViewerAsEmbeddedInWindow() to use OSG with > > fox-toolkit: > > > > //parepare fox OpenGL canvas > > m_pGLVisual = new FXGLVisual(getApp(), VISUAL_DOUBLEBUFFER|VISUAL_BEST); > > m_pGLCanvas = new FXGLCanvas(pGLFrame, m_pGLVisual, this, ID_CANVAS, > > LAYOUT_FILL); > > > > //create osgViewer object and enable stereo > > m_pGLCanvas->makeCurrent(); > > > > // create the view of the scene. > > m_osgViewer = new osgViewer::Viewer; > > m_osgGraphicsWindow = > > m_osgViewer->setUpViewerAsEmbeddedInWindow(0,0,4,3); > > m_osgViewer->setCameraManipulator(new osgGA::TrackballManipulator); > > m_osgViewer->addEventHandler(new osgViewer::StatsHandler); > > m_osgViewer->getCamera()->setClearColor(osg::Vec4f(1.0f, 1.0f, 1.0f, > > 1.0f)); > > > > osg::DisplaySettings* pDS = new osg::DisplaySettings; > > pDS->setStereo(true); > > pDS->setStereoType(osg::DisplaySettings::QUAD_BUFFER); > > m_osgViewer->setDisplaySettings(pDS); > > > > m_osgViewer->realize(); > > > > m_osgGraphicsWindow->resized(m_pGLCanvas->getX(), > m_pGLCanvas->getY(), > > m_pGLCanvas->getWidth(), m_pGLCanvas->getHeight()); > > m_osgGraphicsWindow->getEventQueue()->windowResize( > > m_pGLCanvas->getX(), m_pGLCanvas->getY(), m_pGLCanvas->getWidth(), > > m_pGLCanvas->getHeight()); > > > > m_pGLCanvas->makeNonCurrent(); > > > > Any help on this? Maybe this is not the correct way to osgViewer with > > stereo? Or should I use osgViewer in its own window in order to enable > > QUAD_BUFFER stereo? I can pass --stereo QUAD_BUFFER to the osgViewer > > application to enable stereo on my machine. So it must be something wrong > in > > my code....:( > > > > Many thanks, > > Yanling > > > > _______________________________________________ > > osg-users mailing list > > [email protected] > > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

