diff options
| author | hachem <im@hachem.wtf> | 2026-08-20 22:20:49 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-08-20 22:20:49 +0200 |
| commit | 3cdb1e1186f9614b5e427e2bc46b3003ea0596ef (patch) | |
| tree | bef13b84d3e43f43f6cda282b0697c33a93012af | |
| parent | f40235b63a09191db2bbb75d7d231c27130faa87 (diff) | |
feat: reduce renderer abstraction
| -rw-r--r-- | premake5.lua | 4 | ||||
| -rw-r--r-- | src/core/application.cpp | 49 |
2 files changed, 32 insertions, 21 deletions
diff --git a/premake5.lua b/premake5.lua index 2559098..f2d840e 100644 --- a/premake5.lua +++ b/premake5.lua @@ -318,10 +318,6 @@ project "Donut" "src/**.h", "src/**.cpp", - "src/rendering/framebuffer.h", - "src/rendering/framebuffer.cpp", - "src/platform/opengl/opengl_framebuffer.h", - "src/platform/opengl/opengl_framebuffer.cpp", "ext/imgui/backends/imgui_impl_glfw.cpp", "ext/imgui/backends/imgui_impl_opengl3.cpp", diff --git a/src/core/application.cpp b/src/core/application.cpp index e486863..cf9e322 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -86,30 +86,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(); |
