Turn the FPSCounter namespace into a class.

This commit is contained in:
Jules Blok
2014-07-13 13:04:25 +02:00
parent 6def4ead01
commit 3b978f7c27
6 changed files with 53 additions and 57 deletions

View File

@ -4,15 +4,32 @@
#pragma once
namespace FPSCounter
#include <fstream>
#include "Common/Timer.h"
class FPSCounter
{
// Initializes the FPS counter.
void Initialize();
public:
unsigned int m_fps;
// Shutdown the FPS counter by closing the logs.
void Shutdown();
// Initializes the FPS counter.
FPSCounter();
// Called when a frame is rendered. Returns the value to be displayed on
// screen as the FPS counter (updated every second).
int Update();
}
// Shutdown the FPS counter by closing the logs.
~FPSCounter();
// Called when a frame is rendered. Returns the value to be displayed on
// screen as the FPS counter (updated every second).
int Update();
private:
unsigned int m_counter;
unsigned int m_fps_last_counter;
Common::Timer m_update_time;
Common::Timer m_render_time;
std::ofstream m_bench_file;
void LogRenderTimeToFile(u64 val);
};