diff options
| author | hachem <im@hachem.wtf> | 2026-08-20 16:51:57 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-08-20 16:51:57 +0200 |
| commit | 8b988912c2e808cc19faccdc784f4e3a888bd29f (patch) | |
| tree | 6073ec9607ca39bb15fc0ef7a7559327fd4e49f8 /src/core | |
| parent | eee975a13c29ddbc838284a941332b905a18b430 (diff) | |
chore: move ImGui HDRI switching to Vulkan
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/application.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
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(); } |
