//
// Created by sfd on 25-4-17.
//

#ifndef WINDOW_H
#define WINDOW_H
#include <functional>
#include <string>
#include <SDL3/SDL_events.h>

#include "Core.h"

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

        WindowProps(const std::string& title = "Hazel App",
            uint32_t width = 1280,
            uint32_t height = 720) : title(title), width(width), height(height) {}

    };

    class HAZEL_API Window
    {
    public:
        using EventCallbackFn = std::function<void(SDL_Event&)>;
        using WindowsResizeCallbackFn = std::function<void(SDL_Event&)>;

        virtual ~Window() = default;

        virtual void OnUpdate() = 0;

        virtual uint32_t GetWidth() const = 0;
        virtual uint32_t GetHeight() const = 0;

        // Window attributes
        virtual void SetEventCallback(const EventCallbackFn& callback) = 0;
        virtual void SetWindowResizeEventCallback(const WindowsResizeCallbackFn& callback) = 0;
        virtual void SetVSync(bool enabled) = 0;
        virtual bool IsVSync() const = 0;

        static Scope<Window> Create(const WindowProps& props = WindowProps());

        virtual Uint32 GetMainWindowID() const = 0;
        virtual void* GetNativeWindow() const = 0;
        virtual void* GetNativeGLContext() const = 0;


    };

}

#endif //WINDOW_H
