On Tue, 2011-08-09 at 22:05 +0200, Paul Leopard wrote: > I have some code I have inherited that was developed on Linux. I am trying to > get a Windows version of it to run but there is an inconsistency that I am > unable to explain. Perhaps someone here has seen this issue before ... > > Anyway, the problem is that on Windows (OSG v2.9.9 and v3.0.0) I get a NULL > viewport pointer with the following (pseudocode) call to getViewport() : > > Code: > osg::ArgumentParser arguments(&argc,argv); > osgViewer::Viewer viewer(arguments); > viewer.addEventHandler(...); > osg::Group* root = new osg::Group; > root->addChild( ... ); > viewer.frame();
Try viewer.realize() here instead; not sure it'll change anything, but it's worth a shot. > osg::Camera* camera = viewer.getCamera(); > assert(camera!=NULL); // Ok > osg::Viewport* pViewPort = camera->getViewport(); > assert(pViewPort !=NULL); // FAILS! NULL POINTER > > > > > On Linux the pointer is valid, on Windows it is always NULL. Am I missing > something here or has anyone else had this issue? > > > Thanks! > Paul > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=41955#41955 > > > > > > _______________________________________________ > 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

