#pragma once
#include "Eigen/Eigen"
#include "GLFW/glfw3.h"

class renderer_window;

class window_manager {
public:
    ~window_manager();
    renderer_window* create_window(const Eigen::Vector2i& in_size, const std::string& in_title);

    const auto& get_windows() const { return windows; }

    void on_glfw_window_size_callback(GLFWwindow* in_window, int width, int height);
private:
    renderer_window* find_window(GLFWwindow* in_window);
    std::vector<renderer_window*> windows;
};

namespace aorii {
    inline window_manager* s_window_manager;
    inline void create_window_manager() { s_window_manager = new window_manager(); }
    inline void destroy_window_manager() { delete s_window_manager; }

    inline renderer_window* create_window(const Eigen::Vector2i& in_size, const std::string& in_title) {
        return s_window_manager->create_window(in_size, in_title);
    }

    inline const auto& get_all_window() { return s_window_manager->get_windows(); }
}
