2#include <SFML/System.hpp>
17 void Update(
const sf::Time& delta_time);
37 const float&
GetHighsFps()
const {
return current_highs_fps_; }
42 const float&
GetLowsFps()
const {
return current_lows_fps_; }
44 static constexpr size_t FPS_HISTORY_SIZE_ = 64;
45 float fps_history_[FPS_HISTORY_SIZE_];
46 float current_average_fps_ = 0.f;
47 float current_highs_fps_ = 0.f;
48 float current_lows_fps_ = 0.f;
49 float current_frame_time_ms_ = 0.f;
51 size_t current_index_ = 0;
57 std::array<float, FPS_HISTORY_SIZE_> GetSortedHistory();
const float & GetFrameTimeMs() const
Returns the last calculated Frame Time in MS.
Definition FPSTracker.h:32
const float & GetLowsFps() const
Returns the last calculated Low FPS.
Definition FPSTracker.h:42
const float & GetHighsFps() const
Returns the last calculated High FPS.
Definition FPSTracker.h:37
const float & GetAverageFps() const
Returns the last calculated average FPS.
Definition FPSTracker.h:27
void Update(const sf::Time &delta_time)
Adds an extra sample to the FPS history.
Definition FPSTracker.cpp:14
void UpdateStats(const sf::Time &delta_time)
Updates the current stats: average, highs, lows.
Definition FPSTracker.cpp:31