/******************************************************************************
*	File		-	frame_counter.h
*	Author		-	Joey Pollack
*	Date		-	2021/09/03 (y/m/d)
*	Mod Date	-	2021/09/03 (y/m/d)
*	Description	-	Tracks frame statistics
******************************************************************************/

#ifndef FRAME_COUNTER_H_
#define FRAME_COUNTER_H_

#include <stdint.h>
#include "high_resolution_timer.h"

namespace lunarium
{
    struct FrameData
    {
        uint64_t NumFrames;
        double TotalRunTime;
        double AverageFrameTime;
        double LastFrameTime;
        uint32_t CurrentFPS;
        uint32_t AverageFPS;
        uint32_t LowestFPS;
        uint32_t HighestFPS;
    };

    class FrameCounter
    {
    public:
        void Reset(bool minimalTracking = false);
        void NewFrame();

        const FrameData& GetFrameData() const;

    private:
        bool mbMinimalTracking; // If true will only track basic data
        FrameData mFrameData;
        HighResTimer mTimer;
        double mSecondTimer;
        int mFPSCount;
    };
}


#endif  // FRAME_COUNTER_H_