Added StateSet::setGlobalDefaults() to fix bug when osgViewer has stats on but no scene graph assigned

This commit is contained in:
Robert Osfield 2016-12-21 09:10:50 +00:00
parent 192e654cdb
commit 6511347d4b

View File

@ -50,6 +50,7 @@ StatsHandler::StatsHandler():
_lineHeight(1.5f) _lineHeight(1.5f)
{ {
_camera = new osg::Camera; _camera = new osg::Camera;
_camera->getOrCreateStateSet()->setGlobalDefaults();
_camera->setRenderer(new Renderer(_camera.get())); _camera->setRenderer(new Renderer(_camera.get()));
_camera->setProjectionResizePolicy(osg::Camera::FIXED); _camera->setProjectionResizePolicy(osg::Camera::FIXED);
} }