Mike,

 

Here is how I compute the frame rate in my app:

 

m_currentTick = osg::Timer::instance()->tick();

m_fFrameRate = 1.0 / osg::Timer::instance()->delta_s(m_previousTick, m_currentTick);

m_previousTick = m_currentTick;

 

Just do this every frame, and you should be fine.

 

-Andrew

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Osfield
Sent: Monday, September 18, 2006 2:01 PM
To: osg users
Subject: Re: [osg-users] returning framerate

 

On 9/18/06, Mike Greene <[EMAIL PROTECTED]> wrote:

I know that hitting the "s" key returns frame rate - is there an easy
way to extract a variable that holds this value?


The stats code just computes the frame rate from the inverse of the delta time between frames, pretty trivial to implement in your own code.

Robert.

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to