#pragma once

#include <SDL3/SDL_stdinc.h>

class crApp;

class crDevProfiler
{
public:
    bool enabled = false;

private:
    static constexpr int32_t HISTORY_SIZE     = 100;
    static constexpr float   REFRESH_INTERVAL = 0.1f;

    float   _history[ HISTORY_SIZE ] = {};
    int32_t _historyIndex           = 0;

    float   _accumTime   = 0.0f;
    int32_t _accumFrames = 0;

    float _displayFps  = 0.0f;
    float _displayMs   = 0.0f;

    // native only — the wasm build reports its context in the shell page instead (crWasmBridge)
    bool    _ctxQueried   = false;
    int32_t _ctxAntialias = -1;   // backbuffer msaa sample count; -1 = query failed
    int32_t _ctxAlpha     = -1;   // backbuffer alpha bit depth

public:
    void Init();
    void Cleanup();

    void TryRenderPanel( const crApp* const app, float unscaledDelta );
};
