From 25989e73f59a5f8529562b88fc9b85b172a08394 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 18 Apr 2012 09:51:39 +0000 Subject: [PATCH] From Martin Naylor, "I have been experiencing a crash in the example osgtexture2D. Not sure why my system seems to be so sensitive to these problems. But attached is a fix which seems to stabilise the example. Note: it only seems to crash intermittently when spinning the object with your mouse. So I assume this is a threading issue because of the data variance missing in some of the text node setups in the example. " --- examples/osgtexture2D/osgtexture2D.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/osgtexture2D/osgtexture2D.cpp b/examples/osgtexture2D/osgtexture2D.cpp index 15cdc8ad2..b5e1752fd 100644 --- a/examples/osgtexture2D/osgtexture2D.cpp +++ b/examples/osgtexture2D/osgtexture2D.cpp @@ -180,6 +180,8 @@ osg::Node* createFilterWall(osg::BoundingBox& bb,const std::string& filename) // create the text label. osgText::Text* text = new osgText::Text; + text->setDataVariance(osg::Object::DYNAMIC); + text->setFont("fonts/arial.ttf"); text->setPosition(center); text->setCharacterSize(height*0.03f); @@ -337,13 +339,14 @@ osg::Node* createAnisotripicWall(osg::BoundingBox& bb,const std::string& filenam // create the text label. osgText::Text* text = new osgText::Text; + text->setDataVariance(osg::Object::DYNAMIC); text->setFont("fonts/arial.ttf"); text->setPosition(center); text->setCharacterSize(height*0.03f); text->setColor(osg::Vec4(1.0f,0.0f,1.0f,1.0f)); text->setAlignment(osgText::Text::CENTER_CENTER); text->setAxisAlignment(osgText::Text::XY_PLANE); - + osg::Geode* text_geode = new osg::Geode; text_geode->addDrawable(text); @@ -498,12 +501,13 @@ osg::Node* createWrapWall(osg::BoundingBox& bb,const std::string& filename) // create the text label. osgText::Text* text = new osgText::Text; + text->setDataVariance(osg::Object::DYNAMIC); text->setFont("fonts/arial.ttf"); text->setPosition(center); text->setCharacterSize(height*0.03f); text->setAlignment(osgText::Text::CENTER_CENTER); text->setAxisAlignment(osgText::Text::YZ_PLANE); - + osg::Geode* text_geode = new osg::Geode; text_geode->addDrawable(text);