#ifndef WINDOW_HPP
#define WINDOW_HPP

#include "open_engine/events/event.hpp"

#include <functional>
#include <string>

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

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

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

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

                EventCallbackFunction event_callback;
            };

            virtual ~Window() = default;

            virtual void OnUpdate() = 0;

            virtual uint32_t GetWidth() const = 0;
            virtual uint32_t 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 Scope<Window> Create(const WindowProps& props = WindowProps());
    };
}

#endif // WINDOW_HPP
