From 8b988912c2e808cc19faccdc784f4e3a888bd29f Mon Sep 17 00:00:00 2001 From: hachem Date: Thu, 20 Aug 2026 16:51:57 +0200 Subject: chore: move ImGui HDRI switching to Vulkan --- src/core/application.cpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'src/core/application.cpp') diff --git a/src/core/application.cpp b/src/core/application.cpp index 11c7bd0..05c312b 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -2,6 +2,7 @@ #include "rendering/renderer.h" #include "settings_manager.h" +#include "hdri_manager.h" #include "states/simulation_state.h" #include "states/config_state.h" @@ -82,8 +83,28 @@ namespace Donut ImGui::Text("Geodesic black hole through Vulkan (MoltenVK)."); ImGui::Text("%.1f FPS", ImGui::GetIO().Framerate); ImGui::Separator(); - ImGui::TextWrapped("Drag to orbit, scroll to zoom. HDRI starfield is live; " - "next is porting the simulation UI to Vulkan."); + + if (m_vulkan_renderer) + { + 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())) + { + 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::TextDisabled("Switching rebuilds the cubemap (brief pause)."); + } + + ImGui::Separator(); + ImGui::TextWrapped("Drag to orbit, scroll to zoom."); ImGui::End(); } -- cgit v1.3