From 45baf48db974c66cfdc51f26cee191abbbd89a0b Mon Sep 17 00:00:00 2001 From: hachem Date: Thu, 20 Aug 2026 22:20:49 +0200 Subject: [feat]: reduce renderer abstraction --- src/core/application.cpp | 49 +++++++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 17 deletions(-) (limited to 'src/core/application.cpp') diff --git a/src/core/application.cpp b/src/core/application.cpp index 4d21586..8708417 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -88,30 +88,45 @@ namespace Donut if (m_vulkan_renderer) { - bool free_fly = m_vulkan_renderer->is_free_fly(); - ImGui::Text("Camera"); - if (ImGui::RadioButton("Orbital", !free_fly)) m_vulkan_renderer->set_free_fly(false); + bool scene = m_vulkan_renderer->is_scene_mode(); + ImGui::Text("View"); + if (ImGui::RadioButton("Black hole", !scene)) m_vulkan_renderer->set_scene_mode(false); ImGui::SameLine(); - if (ImGui::RadioButton("Free-fly", free_fly)) m_vulkan_renderer->set_free_fly(true); - ImGui::TextDisabled(free_fly ? "WASD move | Q/E down-up | Shift boost | drag to look" - : "Drag to orbit | scroll to zoom"); + if (ImGui::RadioButton("Scene", scene)) m_vulkan_renderer->set_scene_mode(true); ImGui::Separator(); - auto& hdri = HDRIManager::get(); - std::string current = m_vulkan_renderer->current_hdri(); - std::string preview = hdri.get_hdri_name(current); - if (ImGui::BeginCombo("HDRI", preview.c_str())) + if (scene) { - for (const auto& path : hdri.get_available_hdri()) + ImGui::TextDisabled("World-builder scene (grid). Drag to orbit, scroll to zoom."); + ImGui::TextDisabled("Lit sphere + skybox coming next."); + } + else + { + bool free_fly = m_vulkan_renderer->is_free_fly(); + ImGui::Text("Camera"); + if (ImGui::RadioButton("Orbital", !free_fly)) m_vulkan_renderer->set_free_fly(false); + ImGui::SameLine(); + if (ImGui::RadioButton("Free-fly", free_fly)) m_vulkan_renderer->set_free_fly(true); + ImGui::TextDisabled(free_fly ? "WASD move | Q/E down-up | Shift boost | drag to look" + : "Drag to orbit | scroll to zoom"); + ImGui::Separator(); + + auto& hdri = HDRIManager::get(); + std::string current = m_vulkan_renderer->current_hdri(); + std::string preview = hdri.get_hdri_name(current); + if (ImGui::BeginCombo("HDRI", preview.c_str())) { - bool selected = (path == current); - if (ImGui::Selectable(hdri.get_hdri_name(path).c_str(), selected)) - m_vulkan_renderer->set_hdri(path); - if (selected) ImGui::SetItemDefaultFocus(); + for (const auto& path : hdri.get_available_hdri()) + { + bool selected = (path == current); + if (ImGui::Selectable(hdri.get_hdri_name(path).c_str(), selected)) + m_vulkan_renderer->set_hdri(path); + if (selected) ImGui::SetItemDefaultFocus(); + } + ImGui::EndCombo(); } - ImGui::EndCombo(); + ImGui::TextDisabled("Switching rebuilds the cubemap (brief pause)."); } - ImGui::TextDisabled("Switching rebuilds the cubemap (brief pause)."); } ImGui::End(); -- cgit v1.3