#include "DebugView.hpp"
#include "utils/Time.hpp"
#include "elements/Transformable.hpp"

TSE::EDITOR::DebugView::DebugView() : GuiWindow("Debug", ImGuiWindowFlags_NoCollapse) { }

void TSE::EDITOR::DebugView::Define()
{
    lasttime += Time::deltaTime();
    if(lasttime >= 1)
    {
        lasttime = 0;
        debugFps = std::to_string(frameCount) + " FPS";
        
        frameCount = 0;
    }
    else
    {
        frameCount++;
    }

    ImGui::Text(debugFps.c_str());
    ImGui::Text(("Object count: " + std::to_string(Transformable::GetTansformableCount())).c_str());
}
