From c732a86df8244f0b13070b2405cf83e051b49c36 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Mon, 7 Feb 2022 15:52:21 -0500 Subject: [PATCH] Improve debug light interface --- engine/core/src/debug.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/engine/core/src/debug.cpp b/engine/core/src/debug.cpp index 46bfe98..6b50a61 100644 --- a/engine/core/src/debug.cpp +++ b/engine/core/src/debug.cpp @@ -60,9 +60,18 @@ void draw_lighting() { ImGui::Separator(); for(auto& [obj, light] : lights) { + ImGui::PushID(obj); + + ImGui::TextDisabled("%s", engine->get_scene()->get(obj).name.c_str()); + auto& transform = engine->get_scene()->get(obj); - ImGui::DragFloat3((engine->get_scene()->get(obj).name + "Position").c_str(), transform.position.ptr()); - ImGui::DragFloat((engine->get_scene()->get(obj).name + "Light Size").c_str(), &light.size, 0.1f); + ImGui::DragFloat3("Position", transform.position.ptr()); + ImGui::DragFloat("Light Size", &light.size, 0.1f); + ImGui::Checkbox("Shadows enable", &light.enable_shadows); + + ImGui::PopID(); + + ImGui::Separator(); } ImGui::Text("Environment");