aboutsummaryrefslogtreecommitdiff
path: root/src/core/application.cpp
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-08-20 16:51:57 +0200
committerhachem <im@hachem.wtf>2026-08-20 16:51:57 +0200
commitca9b8beaf69f06cac9b91b66ccd03bb99f09dd22 (patch)
treed1c40b26920eb901ba980b146238399807823642 /src/core/application.cpp
parent9a19ae463880e06bae84eb8ae1b7279595ecdc38 (diff)
[chore]: move imgui HDRI switching to vulkan
Diffstat (limited to 'src/core/application.cpp')
-rw-r--r--src/core/application.cpp28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/core/application.cpp b/src/core/application.cpp
index 667fc73..701e088 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"
@@ -80,15 +81,32 @@ namespace Donut
auto Application::build_vulkan_ui() -> void
{
- // Placeholder UI proving the ImGui Vulkan backend renders. The real
- // application UI (states' on_im_ui_render) moves here once the scene is
- // ported to Vulkan (B-3).
ImGui::Begin("Donut - Vulkan backend");
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();
}