Added timer code to the init in OsgCameraGroup.
Made the stats view 20 frames rather than 6.
This commit is contained in:
@@ -12,6 +12,9 @@
|
||||
*/
|
||||
|
||||
#include <osg/ApplicationUsage>
|
||||
#include <osg/Timer>
|
||||
#include <osg/Notify>
|
||||
|
||||
#include <osgUtil/DisplayRequirementsVisitor>
|
||||
#include <osgDB/FileUtils>
|
||||
|
||||
@@ -21,8 +24,6 @@ using namespace Producer;
|
||||
using namespace osgProducer;
|
||||
|
||||
|
||||
|
||||
|
||||
class RenderSurfaceRealizeCallback : public Producer::RenderSurface::Callback
|
||||
{
|
||||
public:
|
||||
@@ -33,11 +34,20 @@ public:
|
||||
|
||||
virtual void operator()( const Producer::RenderSurface & rs)
|
||||
{
|
||||
|
||||
osg::Timer timer;
|
||||
osg::Timer_t start_t = timer.tick();
|
||||
|
||||
if (_cameraGroup->getRealizeCallback())
|
||||
{
|
||||
(*(_cameraGroup->getRealizeCallback()))(*_cameraGroup,*_sceneHandler,rs);
|
||||
}
|
||||
else if (_sceneHandler) _sceneHandler->init();
|
||||
|
||||
osg::Timer_t end_t = timer.tick();
|
||||
double time = timer.delta_m(start_t,end_t);
|
||||
osg::notify(osg::INFO) << "Time to init = "<<time<<std::endl;
|
||||
|
||||
}
|
||||
|
||||
OsgCameraGroup* _cameraGroup;
|
||||
|
||||
@@ -17,7 +17,7 @@ public:
|
||||
_helpInitialized(false),
|
||||
_statsInitialized(false)
|
||||
{
|
||||
_fs.resize(6);
|
||||
_fs.resize(20);
|
||||
_index = 0;
|
||||
|
||||
_veh->getOsgCameraGroup()->setStatsHandler(this);
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
_stateset->setAttribute(_viewport.get());
|
||||
|
||||
//createHelpText();
|
||||
createStatsText();
|
||||
//createStatsText();
|
||||
|
||||
//_helpInitialized = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user