aboutsummaryrefslogtreecommitdiff
path: root/src/States/SimulationState.cpp
blob: 349100c42ad616cb8ec0b119d12c32222de003f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "SimulationState.h"
#include "Rendering/Renderer.h"
#include "Core/Application.h"

#include <imgui.h>

namespace Donut
{
    void SimulationState::OnEnter()
    {
        DONUT_INFO("Entering Simulation State");
    }
    
    void SimulationState::OnExit()
    {
        DONUT_INFO("Exiting Simulation State");
    }
    
    void SimulationState::OnUpdate(float deltaTime)
    {
    }
    
    void SimulationState::OnRender()
    {
        Renderer::SetClearColor({ 0.0f, 0.0f, 0.0f, 1.0f });
        Renderer::Clear();
    }
    
    void SimulationState::OnEvent(Event& event)
    {
    }
    
    void SimulationState::OnImUIRender()
    {
        ImGui::Begin("Simulation Controls");
        
        ImGui::Text("Simulation State");
        if (ImGui::Button("Back to Config"))
            Application::Get().GetStateManager().SwitchToState("Config");

        ImGui::Separator();
        
        ImGui::Text("Simulation Info:");
        ImGui::Text("FPS: %.1f", ImGui::GetIO().Framerate);
        ImGui::Text("Frame Time: %.3f ms", 1000.0f / ImGui::GetIO().Framerate);
        
        ImGui::End();
    }
};