//
// Created by sebastian on 23.12.25.
//

#ifndef DICEWARS_SIEDLER_GLFWWINDOW_H
#define DICEWARS_SIEDLER_GLFWWINDOW_H
#include "../../core/Window.h"
#include "GLFW/glfw3.h"


class GLFWWindow : public Window {
public:
    GLFWWindow(const WindowProps& props);
    virtual ~GLFWWindow();

    void OnUpdate() override;

    uint32_t GetWidth() const override  { return m_Data.Width; }
    uint32_t GetHeight() const override { return m_Data.Height; }

    void SetVSync(bool enabled);
    bool IsVSync() const { return m_Data.VSync; }

    bool shouldClose() const override;

    void* GetNativeWindow() const override { return m_Window; }

private:
    void Init(const WindowProps& props);
    void Shutdown() const;

private:
    GLFWwindow* m_Window;

    struct WindowData
    {
        std::string Title;
        uint32_t Width, Height;
        bool VSync;
    };

    WindowData m_Data;
};


#endif //DICEWARS_SIEDLER_GLFWWINDOW_H