Thank you for the explanation. I understand it better now! And I have read more 
about the CompositeViewer so I'll be using that instead.

One last thing, the program crashes, the code that creates a window (and some 
temporarary testing code below) looks like this:


Code:
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new 
osg::GraphicsContext::Traits();
traits->x = 100;
traits->y = 100;
traits->width = 800;
traits->height = 600;
traits->depth = 16;
traits->windowDecoration = true;
traits->supportsResize = false;
traits->windowName = "test";

osg::ref_ptr<osg::GraphicsContext> graphicscontext = 
osg::GraphicsContext::createGraphicsContext(traits);
graphicscontext->realize();

osg::ref_ptr<osg::Group> root = new osg::Group();
osg::ref_ptr<osg::Geode> geode = new osg::Geode;
osg::ref_ptr<osg::Capsule> capsule = new osg::Capsule(osg::Vec3(), 1, 2);
osg::ref_ptr<osg::ShapeDrawable> drawable = new 
osg::ShapeDrawable(capsule.get());
geode->addDrawable(drawable.get());
root->addChild(geode);

osg::ref_ptr<osgViewer::View> view;
m_views.push_back(view);
view->setSceneData(root);
view->getCamera()->setGraphicsContext(graphicscontext);



I get First-chance exception at 0x00287d84 in game.exe: 0xC0000005: Access 
violation reading location 0x00000000. on the second row from the bottom and if 
I comment that out I get First-chance exception at 0x6238d8a1 (osg55-osgd.dll) 
in game.exe: 0xC0000005: Access violation reading location 0x00000014. on the 
last row... and then it exits game.exe: Native' has exited with code 3 (0x3). 
when I run it in debug mode.

I'm saving the view to a std::vector so it can't be that it's running out of 
scope, right? I'm still learning...

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=15258#15258





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to