Added StateSet event handler to osgfont and osgtext to aid with debugging

This commit is contained in:
Robert Osfield 2010-03-18 17:10:48 +00:00
parent 1590f6be3b
commit c3b7a04cf1
2 changed files with 89 additions and 84 deletions

View File

@ -5,6 +5,7 @@
#include <osg/Geode>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgGA/StateSetManipulator>
void textInfo(osgText::Text* text)
{
@ -102,6 +103,8 @@ int main(int argc, char** argv)
return 1;
}
viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) );
viewer.addEventHandler(new osgViewer::StatsHandler());
viewer.addEventHandler(new osgViewer::WindowSizeHandler());

View File

@ -22,6 +22,7 @@
#include <osgDB/WriteFile>
#include <osgDB/Registry>
#include <osgGA/StateSetManipulator>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
@ -701,6 +702,7 @@ int main(int argc, char** argv)
osgDB::writeNodeFile(*viewer.getSceneData(),"text.osg");
#endif
viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) );
viewer.addEventHandler(new osgViewer::StatsHandler());
viewer.run();