#pragma once

/*
	ApplicationFramework
	by John Ryland
	Copyright (c) 2023
*/

////////////////////////////////////////////////////////////////////////////////////
//	Glfw Window System

#include "IWindowSystem.h"
#include <vector>

namespace ApplicationFramework {

class Window;
class IWindow;

class GlfwWindowSystem : public IWindowSystem
{
public:
    GlfwWindowSystem();
    ~GlfwWindowSystem() override;

    IWindow* CreateWindow(Window* window, int width, int height, const char* title) override;
    void DestroyWindow(IWindow* window) override;

    void ShowWindow(IWindow* window) override;
    void CloseWindow(IWindow* window) override;
    void SetWindowPosition(IWindow* window, uint32_t x, uint32_t y) override;
    void GetWindowPosition(IWindow* window, uint32_t& x, uint32_t& y) override;
    void SetWindowSize(IWindow* window, uint32_t width, uint32_t height) override;
    void GetWindowSize(IWindow* window, uint32_t& width, uint32_t& height) override;
    void SetWindowFocus(IWindow* window) override;
    bool GetWindowFocus(IWindow* window) override;
    bool GetWindowMinimized(IWindow* window) override;
    void SetWindowTitle(IWindow* window, const char* str) override;
    void SetWindowAlpha(IWindow* window, float alpha) override;
    bool IsKeyPressed(IWindow* window, int key) override;

    bool LastWindowClosed() override;

    void Initialize() override;
    void Shutdown() override;

    void Prepare() override;
    void Update() override;
    void Render() override;
    void Present() override;

private:
    std::vector<IWindow*>  m_windows;
};

} // ApplicationFramework namespace
