merging various commits and stashes

This commit is contained in:
Kayne Ruse
2013-05-01 21:30:02 +10:00
parent fe04561b26
commit 80004ca8d4
7 changed files with 66 additions and 3 deletions
+29
View File
@@ -0,0 +1,29 @@
#ifndef FRAMERATE_HPP_
#define FRAMERATE_HPP_
#include <ctime>
class FrameRate {
public:
FrameRate() {
frameCount = lastFrameRate = tick = 0;
}
int Calculate() {
frameCount++;
if (clock() - tick >= CLOCKS_PER_SEC) {
lastFrameRate = frameCount;
frameCount = 0;
tick = clock();
}
return lastFrameRate;
}
int GetFrameRate() {
return lastFrameRate;
}
private:
int frameCount;
int lastFrameRate;
int tick;
};
#endif