#pragma once #include #include #include #include #include #include "Engine/Profiler.h" // Ensure Profiler classes are included class ProfilerWindow { public: ProfilerWindow(); ~ProfilerWindow() = default; // Render the profiler window void Show(); private: struct ProfileHistory { std::deque totalTimeHistory; std::deque averageTimeHistory; static const size_t MaxHistory = 100; }; std::unordered_map m_ProfileHistories; std::deque m_TotalFrameTimeHistory; static const size_t MaxFrameHistory = 100; // Timing variables for update throttling double m_UpdateInterval; // Interval in seconds (0.1) std::chrono::steady_clock::time_point m_LastUpdateTime; // Helper functions void UpdateHistory(const std::unordered_map &data, double totalFrameTime); void RenderTable(const std::unordered_map &data); void RenderGraphs(); // Helper for data smoothing std::vector MovingAverage(const std::deque &data, size_t window); std::vector ExponentialMovingAverage(const std::deque &data, float alpha); };