Hi Serge,
What you are doing looks OK, and there are already OSG examples doing
similar things so it "should" work. To track down what it might be
it'd worth trying out different threading models, and also try out
examples like osgthirdpersonview, osgcompositeviewer and osgcamera to
see if you can recreate the problems here, if so then others can try
it out at there end to see if problems occurs across OS/machines/build
combinations.
For one point of reference, the type of usage you are putting the OSG
through is something I've put the OSG through many times before
without coming across this problem.
Robert.
On Thu, Jun 26, 2008 at 1:57 PM, Serge Lages <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I am having a crash with a CompositeViewer setup on Windows XP (VS 8 Sp1, 1
> GeForce card, SVN trunk). It is composed of 2 windows into 1 screen, with
> one context for each window. My threading model is DrawThreadPerContext.
> The crash takes place into OperationQueue, the _operations list has a
> corrupted element : the last one (the SwapBuffersOperation). The two
> graphics threads have their OperationQueue corrupted.
>
> So it crash line 75 into OperationThread.cpp because
> _currentOperationIterator points to a corrupted pointer.
> About my app, it just load the cow.osg, nothing else.
>
> Anyone have seen this problem before ? Or am I making something wrong on my
> viewer setup (my code is below) ?
> Thanks in advance !
>
> osgViewer::CompositeViewer viewer;
> osg::Node *root = osgDB::readNodeFile("cow.osg");
>
> // upper window
> {
> // Traits
> osg::ref_ptr<osg::GraphicsContext::Traits> traits = new
> osg::GraphicsContext::Traits;
>
> traits->x = 300;
> traits->y = 40;
> traits->width = 600;
> traits->height = 300;
> traits->windowDecoration = true;
> traits->doubleBuffer = true;
> traits->sharedContext = 0;
>
> // Graphic context
> osg::ref_ptr<osg::GraphicsContext> gc =
> osg::GraphicsContext::createGraphicsContext(traits.get());
> osgViewer::View *view = new osgViewer::View;
> GLenum buffer = traits->doubleBuffer
> ? GL_BACK : GL_FRONT;
>
> viewer.addView(view);
> view->getCamera()->setGraphicsContext(gc.get());
> view->getCamera()->setViewport(new osg::Viewport(0,0, traits->width,
> traits->height));
> view->getCamera()->setDrawBuffer(buffer);
> view->getCamera()->setReadBuffer(buffer);
> view->setSceneData(root);
> }
> // lower window
> {
> // Traits
> osg::ref_ptr<osg::GraphicsContext::Traits> traits = new
> osg::GraphicsContext::Traits;
>
> traits->x = 300;
> traits->y = 375;
> traits->width = 600;
> traits->height = 480;
> traits->windowDecoration = true;
> traits->doubleBuffer = true;
> traits->sharedContext = 0;
>
> // Graphic context
> osg::ref_ptr<osg::GraphicsContext> gc =
> osg::GraphicsContext::createGraphicsContext(traits.get());
> osgViewer::View *view = new osgViewer::View;
> GLenum buffer = traits->doubleBuffer
> ? GL_BACK : GL_FRONT;
>
> viewer.addView(view);
> view->getCamera()->setGraphicsContext(gc.get());
> view->getCamera()->setViewport(new osg::Viewport(0,0, traits->width,
> traits->height));
> view->getCamera()->setDrawBuffer(buffer);
> view->getCamera()->setReadBuffer(buffer);
> view->setSceneData(root);
> view->addEventHandler(new
> osgGA::StateSetManipulator(view->getCamera()->getOrCreateStateSet()));
> view->addEventHandler(new osgViewer::StatsHandler());
> }
>
> viewer.run();
>
> return (0);
>
> --
> Serge Lages
> http://www.tharsis-software.com
> _______________________________________________
> 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