hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/src/states/config_state.cpp
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2025-08-17 22:38:29 +0200
committerhachem <im@hachem.wtf>2025-08-17 22:38:29 +0200
commitd65233be9433a01c54e959aea72e87ff2e385937 (patch)
tree70cea1cf2b1f62b09f94d5b0dcbc7c193cec2fe4 /src/states/config_state.cpp
parentdf479e3f8b803f8675fedb009f7ea78aa107d194 (diff)
feat: add world builder state
Diffstat (limited to 'src/states/config_state.cpp')
-rw-r--r--src/states/config_state.cpp38
1 files changed, 23 insertions, 15 deletions
diff --git a/src/states/config_state.cpp b/src/states/config_state.cpp
index 1f1ef16..41fbaad 100644
--- a/src/states/config_state.cpp
+++ b/src/states/config_state.cpp
@@ -16,20 +16,20 @@ namespace Donut
const auto& settings = SettingsManager::get_settings_const();
- m_selected_api = (settings.graphics.render_api == "Vulkan") ? RendererAPI::API::Vulkan : RendererAPI::API::OpenGL;
- m_selected_theme = (settings.graphics.selected_theme == "Light") ? 1 :
- (settings.graphics.selected_theme == "Blue") ? 2 : 0;
- m_target_fps = settings.simulation.target_fps;
- m_compute_height = settings.simulation.compute_height;
- m_max_steps_moving = settings.simulation.max_steps_moving;
- m_max_steps_static = settings.simulation.max_steps_static;
- m_early_exit_distance = settings.simulation.early_exit_distance;
- m_gravity_enabled = settings.simulation.gravity_enabled;
- m_v_sync_enabled = settings.graphics.v_sync_enabled;
- m_show_fps = settings.graphics.show_fps;
+ m_selected_api = (settings.graphics.render_api == "Vulkan") ? RendererAPI::API::Vulkan : RendererAPI::API::OpenGL;
+ m_selected_theme = (settings.graphics.selected_theme == "Light") ? 1 :
+ (settings.graphics.selected_theme == "Blue") ? 2 : 0;
+ m_target_fps = settings.simulation.target_fps;
+ m_compute_height = settings.simulation.compute_height;
+ m_max_steps_moving = settings.simulation.max_steps_moving;
+ m_max_steps_static = settings.simulation.max_steps_static;
+ m_early_exit_distance = settings.simulation.early_exit_distance;
+ m_gravity_enabled = settings.simulation.gravity_enabled;
+ m_v_sync_enabled = settings.graphics.v_sync_enabled;
+ m_show_fps = settings.graphics.show_fps;
m_show_performance_metrics = settings.graphics.show_performance_metrics;
- m_show_debug_info = settings.graphics.show_debug_info;
- m_enable_anti_aliasing = settings.graphics.enable_anti_aliasing;
+ m_show_debug_info = settings.graphics.show_debug_info;
+ m_enable_anti_aliasing = settings.graphics.enable_anti_aliasing;
}
void ConfigState::on_exit()
@@ -52,7 +52,7 @@ namespace Donut
void ConfigState::on_render()
{
- Renderer::set_clear_color({ 0.05f, 0.05f, 0.1f, 1.0f });
+ Renderer::set_clear_color({ 0.1f, 0.1f, 0.1f, 1.0f });
Renderer::clear();
}
@@ -104,6 +104,7 @@ namespace Donut
if (is_selected)
ImGui::SetItemDefaultFocus();
}
+
ImGui::EndCombo();
}
@@ -215,7 +216,7 @@ namespace Donut
ImGui::Separator();
ImGui::Spacing();
- float button_width = (ImGui::GetWindowWidth() - 100) / 5.0f;
+ float button_width = (ImGui::GetWindowWidth() - 120) / 6.0f;
if (ImGui::Button("Start Simulation", ImVec2(button_width, 35)))
{
@@ -224,6 +225,13 @@ namespace Donut
}
ImGui::SameLine();
+ if (ImGui::Button("World Builder", ImVec2(button_width, 35)))
+ {
+ apply_settings();
+ Application::get().get_state_manager().switch_to_state("WorldBuilder");
+ }
+
+ ImGui::SameLine();
if (ImGui::Button("Reset to Defaults", ImVec2(button_width, 35)))
reset_to_defaults();