#ifndef WINDOW_HPP
#define WINDOW_HPP

#include "../core.hpp"
#include "../events/event.hpp"
#include <functional>

#include <string>

namespace OpenEngine {
    struct WindowProps
    {
        std::string title;
        unsigned int width;
        unsigned int height;

        WindowProps(const std::string& title = "OpenEngine",
                unsigned int width = 1280,
                unsigned int height = 729)
            :title(title), width(width), height(height)
        {
        }
    };

    class OE_API Window
    {
        public:
            using EventCallbackFunction = std::function<void(Event&)>;

            struct WindowData
            {
                std::string title;
                unsigned int width, height;
                bool vsync;

                EventCallbackFunction event_callback;
            };

            virtual ~Window() = default;

            virtual void OnUpdate() = 0;

            virtual unsigned int GetWidth() const = 0;
            virtual unsigned int GetHeight() const = 0;

            virtual void SetEventCallback(const EventCallbackFunction& callback) = 0;
            virtual void SetVSync(bool enabled) = 0;
            virtual bool IsVSync() const = 0;

            virtual void* GetNativeWindow() const = 0;

            static Window* Create(const WindowProps& props = WindowProps());
    };
}

#endif // WINDOW_HPP
