#pragma once

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

////////////////////////////////////////////////////////////////////////////////////
//	Window System Interface

#include "ICoreSystem.h"
#include <cstdint>

namespace ApplicationFramework {

class IWindow;
class Window;

class IWindowSystem : public ICoreSystem
{
public:
    virtual IWindow* CreateWindow(Window* window, int width, int height, const char* title) = 0;
    virtual void DestroyWindow(IWindow* window) = 0;  // releases memory of the IWindow pointer

    // This is based on ImGui's platform API
    virtual void ShowWindow(IWindow* window) = 0;
    virtual void CloseWindow(IWindow* window) = 0;    // closes the window. DestroyWindow still needs to be called to clean up resources
    virtual void SetWindowPosition(IWindow* window, uint32_t x, uint32_t y) = 0;
    virtual void GetWindowPosition(IWindow* window, uint32_t& x, uint32_t& y) = 0;
    virtual void SetWindowSize(IWindow* window, uint32_t width, uint32_t height) = 0;
    virtual void GetWindowSize(IWindow* window, uint32_t& width, uint32_t& height) = 0;
    virtual void SetWindowFocus(IWindow* window) = 0;
    virtual bool GetWindowFocus(IWindow* window) = 0;
    virtual bool GetWindowMinimized(IWindow* window) = 0;
    virtual void SetWindowTitle(IWindow* window, const char* str) = 0;
    virtual void SetWindowAlpha(IWindow* window, float alpha) = 0;
    virtual bool IsKeyPressed(IWindow* window, int key) = 0;

/*
    virtual void UpdateWindow(IWindow* window) = 0;
    virtual void RenderWindow(IWindow* window, void* renderArg) = 0;
    virtual void SwapBuffers(IWindow* window, void* renderArg) = 0;
    virtual float GetWindowDpiScale(IWindow* window) = 0;
    virtual void OnChangedViewport(IWindow* window) = 0;
    virtual int CreateVkSurface(IWindow* window, ImU64 vk_inst, const void* vk_allocators, ImU64* out_vk_surface) = 0;
*/

    virtual bool LastWindowClosed() = 0;
};

} // ApplicationFramework namespace
