#pragma once #include "GLFW/glfw3.h" #include "misc/singleton/singleton.h" #include #include "imgui.h" class plugin_host; class window_manager : public singleton_t { public: window_manager(); void init(singleton_initliazer& initliazer) override; void release(singleton_release_guard& release_guard) override; void tick(); bool should_close() const { return glfwWindowShouldClose(main_window_); } void destroy_all_plugin_host_window(); GLFWwindow* create_main_window(const char* title, int width, int height); void request_exit() const { glfwSetWindowShouldClose(main_window_, GLFW_TRUE); } GLFWwindow* get_main_window() const { return main_window_; } GLFWwindow* create_plugin_host_window(plugin_host* host); void destroy_plugin_host_window(plugin_host* host); void resize_plugin_host_window(plugin_host* host, int width, int height); void idle_plugin_host_window() const; const char* get_name() override { return "window_manager"; } private: void update_host_window(); GLFWwindow* main_window_; std::map host_window_map_; std::map host_window_pos_map_; }; DEFINE_SINGLETON_INSTANCE(window_manager)