mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Turn the FPSCounter namespace into a class.
This commit is contained in:
@ -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);
|
||||
};
|
||||
|
Reference in New Issue
Block a user