//
// Created by sebastian on 29.07.26.
//

#ifndef COLORRACE_WINDOW_H
#define COLORRACE_WINDOW_H

#pragma once
#include <string>

#include "EngineConfig.h"


struct GLFWwindow;

namespace engine {
    class Keyboard;
    class Mouse;

    class Window {
    public:
        struct CallbackTarget {
            Mouse* mouse = nullptr;
            Keyboard* keyboard = nullptr;
        };
        Window(const EngineConfig& config);
        ~Window();

        bool shouldClose() const;
        void swapBuffers();
        void pollEvents();

        [[nodiscard]] GLFWwindow* getHandle() const { return m_handle; }
        [[nodiscard]] int getWidth() const;
        [[nodiscard]] int getHeight() const;

        void setMouse(Mouse* mouse) { m_callbackTarget.mouse = mouse; }
        void setKeyboard(Keyboard* keyboard) { m_callbackTarget.keyboard = keyboard; }
    private:
        GLFWwindow* m_handle;
        CallbackTarget m_callbackTarget;
    };
}





#endif //COLORRACE_WINDOW_H
