#pragma once

#include <memory>
#include <vector>

#include "Core/Core.h"
#include "RHI/DriverSettings.h"
#include "RHI/RHICommond.h"

class IRHIAPI {
public:
    virtual ~IRHIAPI() = default;

    virtual bool InitEnv(const DriverSettings& setting) = 0;
    virtual bool InitRenderEnv(const DriverSettings& setting) = 0;
    virtual void UpdateRenderSize(const DriverSettings& setting) = 0;
    virtual void UninitEnv() = 0;
    virtual void PollEvents() = 0;

    virtual RHICommond* CreateVAOCommand(
        class Mesh* mesh,
        uint32 vaoHandle,
        uint32 vboHandle,
        uint32 eboHandle
    ) = 0;
    virtual RHICommond* DrawArrayCommand(
        uint32 vaoHandle,
        uint32 vaoStart,
        uint32 vaoCount
    ) = 0;
    virtual RHICommond* DrawElementsCommand(
        uint32 vaoHandle,
        uint32 eboHandle,
        uint32 eboCount
    ) = 0;
    virtual RHICommond* DeleteVAOCommand(
        uint32 vaoHandle,
        uint32 vboHandle,
        uint32 eboHandle
    ) = 0;
    virtual RHICommond* CreateShaderCommand(
        uint32 shaderHandle,
        uint32 type,
        const std::string& shader
    ) = 0;
    virtual RHICommond* DeleteShaderCommand(
        uint32 shaderHandle
    ) = 0;
    virtual RHICommond* CreateProgramCommand(
        uint32 programHandle,
        const std::vector<uint32>& shaders
    ) = 0;
    virtual RHICommond* UseProgramCommand(
        uint32 programHandle,
        bool use
    ) = 0;
    virtual RHICommond* DeleteProgramCommand(
        uint32 programHandle
    ) = 0;
    virtual RHICommond* CreateStartCommand() = 0;
    virtual RHICommond* CreateEndCommand() = 0;
};
