Added the basics for a scene explorer in ImGui

This commit is contained in:
2022-07-10 15:52:25 +02:00
parent 6a2e8d3b2f
commit e31fd036ea
4 changed files with 41 additions and 22 deletions

View File

@ -1,5 +1,32 @@
#include "GUI.h"
void SceneExplorer(Scene& scene, std::string PanelName) {
ImGui::Begin(PanelName.c_str());
ImGui::ListBoxHeader("##ObjectList");
Node& current = scene.GetRoot();
Node* next = &current;
// Show first node
ImGui::Selectable(next->name.c_str(), true);
ImGui::Indent();
if (next->children.size() != 0) {
for (auto child : next->children)
{
std::string& name = child->name;
ImGui::Selectable(name.c_str(), false);
}
}
ImGui::ListBoxFooter();
ImGui::End();
}
void CameraTool(Camera* cam) {
ImGui::Begin("Camera");