#ifndef SCENE_HIERARCHY_HPP #define SCENE_HIERARCHY_HPP #include "imgui.h" #include #include namespace OpenEngine { class SceneHierarchy { public: SceneHierarchy() = default; SceneHierarchy(const Ref& scene); void SetContext(const Ref& scene); void OnImGuiRender(); private: void DrawEntityNode(Entity& entity); void DrawComponents(Entity& entity); template void DrawComponentDrawer(Entity& entity, const char* header) { if (entity.HasComponent()) if (ImGui::TreeNodeEx((void*)typeid(T).hash_code(), ImGuiTreeNodeFlags_DefaultOpen, "%s", header)) { entity.GetComponents().OnImGuiRender(entity); ImGui::TreePop(); ImGui::Separator(); } } private: Ref scene; Entity selected_context, renamed_entity; double last_selected_time = 10.0; }; } #endif // SCENE_HIERARCHY_HPP