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;
|
||||
|
||||
Reference in New Issue
Block a user