timeSinceLastFrame for _fireFrameRenderingQueued

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
machineonpointer
Kobold
Posts: 35
Joined: Fri Dec 06, 2013 4:15 am

timeSinceLastFrame for _fireFrameRenderingQueued

Post by machineonpointer »

I added some log in the function Real Root::calculateEventTime(unsigned long now, FrameEventTimeType type) of OgreRoot.cpp
  • 09-07 21:44:16.088: E/OGRE(9723): calculateEventTime:
    09-07 21:44:16.088: E/OGRE(9723): FrameEventTimeType:2
    09-07 21:44:16.088: E/OGRE(9723): times.back ():10701426
    09-07 21:44:16.088: E/OGRE(9723): times.front ():10701841
    09-07 21:44:16.088: E/OGRE(9723): FETT_QUEUED mFrameSmoothingTime:0
    09-07 21:44:16.098: E/OGRE(9723): FETT_QUEUED timeSinceLastEvent:0.064
    09-07 21:44:16.098: E/OGRE(9723): FETT_QUEUED timeSinceLastFrame:4.29497e+06
    09-07 21:44:16.098: E/OGRE(9723): FETT_QUEUED size:2
(10701426-10701841)/((2-1)*1000) = -0.415 (if the 2 numbers are treated as integers)

Code: Select all

Real Root::calculateEventTime(unsigned long now, FrameEventTimeType type)
{
    ....
    return Real ( times.back () - times.front () ) / ((times.size () - 1) * 1000);
}
times.back () equals to 10701426
times.front () equals to 10701841
results in value of 4.29497e+06 for variable evt.timeSinceLastFrame

Because the param mFrameSmoothingTime is 0, the size of the deque for FETT_QUEUED equals to 2.
Ogre uses deque<unsigned long> type to store the time info. But here why times.back () < times.front() ?
Post Reply