Prototype waterfall rate smoothing / fps matching

This commit is contained in:
Charles J. Cliffe
2015-09-09 23:29:38 -04:00
parent 7163cd13f2
commit a1bf5b839e
7 changed files with 81 additions and 25 deletions
+13
View File
@@ -5,6 +5,8 @@
#include <mmsystem.h>
#endif
#include <iostream>
Timer::Timer(void) : time_elapsed(0), system_milliseconds(0), start_time(0), end_time(0), last_update(0), num_updates(0), paused_time(0), offset(0), paused_state(false), lock_state(0), lock_rate(0)
{
}
@@ -157,3 +159,14 @@ bool Timer::paused()
{
return paused_state;
}
void Timer::timerTestFunc() {
update();
if (getNumUpdates() % 120 == 0) {
std::cout << getNumUpdates() << "," << getSeconds() << " Rate: " << ((double)getNumUpdates()/getSeconds()) << "/sec" << std::endl;
}
if (getNumUpdates() >= 600) {
reset();
}
}
+3
View File
@@ -155,6 +155,9 @@ public:
* \return Current pause state, true if paused, false otherwise
*/
bool paused();
void timerTestFunc();
};
#endif