Files
LifeProject/LifeCore/FrameCounter.h
T

32 lines
533 B
C++
Raw Normal View History

2025-05-13 02:46:21 +03:00
#ifndef FrameCounter_h__
#define FrameCounter_h__
namespace LifeCore
{
class Timer;
class FrameCounter
{
public:
FrameCounter();
~FrameCounter();
int GetFrameId();
float GetFps();
float GetFpsAvg();
float GetTimeElapled();
float GetTimeElapsedAvg();
void SetFrameRange(int range);
void OnFrameEnd();
private:
float* prev_time;
int buffer_pos;
float fps;
float avg_fps;
float time_elapsed;
float time_elapsed_avg;
int frame_range;
int frame_id;
Timer* timer;
};
}
#endif // FrameCounter_h__