From e6880de032b2ee963b68cdf269a4c023442ffe7d Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 19 Mar 2015 00:37:33 +0100 Subject: [PATCH] Better fix for wireframe crashes --- apps/nifosgtest/test.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/nifosgtest/test.cpp b/apps/nifosgtest/test.cpp index 4593217c84..1c34afbc47 100644 --- a/apps/nifosgtest/test.cpp +++ b/apps/nifosgtest/test.cpp @@ -131,6 +131,11 @@ int main(int argc, char** argv) viewer.realize(); viewer.setCameraManipulator(new osgGA::TrackballManipulator()); viewer.addEventHandler(new WireframeKeyHandler(root)); + + // We're going to change this from the event callback, set the variance to DYNAMIC so that + // we don't interfere with the draw thread. + root->getOrCreateStateSet()->setDataVariance(osg::Node::DYNAMIC); + viewer.addEventHandler(new osgViewer::StatsHandler); while (!viewer.done())