//
// Created by sfd on 25-4-25.
//

#include "Hazel/Renderer/Texture.h"
#include "Platform/OpenGL/OpenGLTexture.h"
#include "Renderer.h"

namespace Hazel
{
    Ref<Texture2D> Texture2D::Create(uint32_t width, uint32_t height)
    {
        switch (Renderer::GetAPI())
        {
        case RendererAPI::API::NONE:
            HZ_CORE_ERROR("NONE is not Support!");
            return nullptr;
        case RendererAPI::API::OPENGL:
            // return std::make_shared<VertexBuffer>(OpenGLVertexBuffer(vertices, size));
            return std::make_shared<OpenGLTexture2D>(width, height);
            break;
        default:
            break;
        }

        HZ_CORE_ERROR("Unknown RendererAPI!");
        return nullptr;
    }

    Ref<Texture2D> Texture2D::Create(const std::string& path)
    {
        switch (Renderer::GetAPI())
        {
        case RendererAPI::API::NONE:
            HZ_CORE_ERROR("NONE is not Support!");
            return nullptr;
        case RendererAPI::API::OPENGL:
            // return std::make_shared<VertexBuffer>(OpenGLVertexBuffer(vertices, size));
            return std::make_shared<OpenGLTexture2D>(path);
            break;
        default:
            break;
        }

        HZ_CORE_ERROR("Unknown RendererAPI!");
        return nullptr;
    }
}
