#pragma once

#include <vector>

#include "RHI/IRHIAPI.h"

class GLDrvAPI : public IRHIAPI {
public:
    explicit GLDrvAPI() noexcept = default;
    ~GLDrvAPI() override = default;

    bool InitEnv(const DriverSettings& setting) override;
    bool InitRenderEnv(const DriverSettings& setting) override;
    void UpdateRenderSize(const DriverSettings& setting) override;
    void UninitEnv() override;
    void PollEvents() override;

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