#pragma once #include "GLFW/glfw3.h" #include "misc/singleton/singleton.h" #include #include #include class plugin_host; class CORE_API window_manager : public singleton_t { public: void init(singleton_initliazer& initliazer) override; void release(singleton_release_guard& release_guard) override; std::shared_ptr create_window(int width, int height, const char* title); auto create_plugin_window(plugin_host* host) -> void*; void destroy_plugin_window(plugin_host* host); void resize_plugin_window(plugin_host* host, int width, int height); const char* get_name() override { return "window_manager"; } void update(); private: std::vector> windows_; struct host_info { int32_t x; int32_t y; std::shared_ptr window; }; void on_host_window_close(GLFWwindow* window); std::unordered_map host_infos_; }; DEFINE_SINGLETON_INSTANCE(window_manager)