#pragma once #include #include #include #include "app.hh" namespace pg { class Initiator final : App { public: Initiator() noexcept { } void Update() noexcept override { if (ImGui::BeginMainMenuBar()) { if (ImGui::BeginMenu("Apps")) { for (const auto& type : registry()) { if (ImGui::MenuItem(type.first.c_str())) { apps_.push_back(type.second->Create()); } } ImGui::EndMenu(); } ImGui::EndMainMenuBar(); } for (auto& app : apps_) { app->Update(); } } private: std::vector> apps_; }; } // namespace pg