hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/src/states/simulation_state.cpp
blob: 7e9cb76723000b63799c27d37b4614a72afb8029 (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 "simulation_state.h"
#include "rendering/renderer.h"
#include "core/application.h"

#include <imgui.h>

namespace Donut
{
    void SimulationState::on_enter()
    {
        DONUT_INFO("Entering Simulation State");
    }
    
    void SimulationState::on_exit()
    {
        DONUT_INFO("Exiting Simulation State");
    }
    
    void SimulationState::on_update(float delta_time)
    {
    }
    
    void SimulationState::on_render()
    {
        Renderer::set_clear_color({ 0.0f, 0.0f, 0.0f, 1.0f });
        Renderer::clear();
    }
    
    void SimulationState::on_event(Event& event)
    {
    }
    
    void SimulationState::on_im_ui_render()
    {
        ImGui::Begin("Simulation Controls");
        
        ImGui::Text("Simulation State");
        if (ImGui::Button("Back to Config"))
            Application::get().get_state_manager().switch_to_state("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();
    }
};