#pragma once

#include "SDL3/SDL.h"
#include "Types.hpp"
#include "interfaces/IWindow.hpp"
#include "interfaces/IRenderingBackend.hpp"
#include "enums/WindowType.hpp"
#include "Color.hpp"

namespace TSE::SDL3
{
    class WindowSdl3 : public IWindow
    {
        private:
        IRenderingBackend* renderingBackend;
        bool running = true;

        public:
        WindowType windowType;
        bool useImGui = false;
        SDL_Window* window;
        SDL_GLContext context;

        WindowSdl3(string _title, int _width, int _height, IRenderingBackend* backend);
        WindowSdl3(string _title, int _width, int _height, IRenderingBackend* backend, TSE::WindowType type);
        WindowSdl3(string _title, int _width, int _height, IRenderingBackend* backend, TSE::WindowType type, int ppu);
        ~WindowSdl3();

        protected:
        bool Init() override;
        void ResizeWindow(int width, int height);

        public:
        void Clear() const override;
        void Update() override;
        void ClearDepthBuffer() const override;
        bool ShouldClose() const override;
        inline void Bind() override { };
        inline void Unbind() override { };
        void DoneSetup() override;
        void PollEvents();
    };
} // namespace TSE::SDL3
