buckle2000 / gqe

Automatically exported from code.google.com/p/gqe
MIT License
0 stars 0 forks source link

Getting FPS and UPS directly from the StatManager #1

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The functions GetFrames() and GetUpdates() only return the current frame- or 
updatecount since it's last reset as a second was over.
Whith that information the user would then have to create again his own clocks 
and synchronize them somehow with the StatManager clocks to be able to 
calculate the FramePerSecond or UpdatesPerSecond rates.
But on the other hand StatManager does calculate the FPS and UPS every second, 
so it actually could return those rates, even if they are not from the current 
second, but from the last one.

With that said, it would be nice to have two functions in the StatManager, 
which returns
a) the FPS
b) the UPS

The UPS is essential for calculating the next move of any moving object, 
otherwise it would end up being dependend on the process power.

Original issue reported on code.google.com by youtube@my-gate.net on 14 Feb 2011 at 12:36

GoogleCodeExporter commented 8 years ago
I have been investigating this issue from the perspective of how to make 
animations smoother in GQE.  I believe I have found a potential solution: I 
propose adding an additional Update method for each State that will be 
gaurrenteed to be called exactly once for every Draw method call.  This way you 
can use the provided elapsed time value to correctly update all position 
related variables and thus provide smooth animations.  The current Update 
method will still be called at a fixed rate specified by the mUpdateRate 
variable in the App class.  This way you will always have a fixed Update method 
that is gaurrenteed to be called at a fixed rate regardless of the speed of the 
computer and a variable Update method that will be called at the variable rate 
of the computer, satisfying both types of game engine processing design.

Original comment by RyanLind...@gmail.com on 1 Apr 2011 at 6:21

GoogleCodeExporter commented 8 years ago

Original comment by RyanLind...@gmail.com on 14 Apr 2011 at 4:04