#include <pch.hpp>

#include <renderer/framebuffer.hpp>
#include <renderer/renderer.hpp>
#include <open_engine/opengl/opengl_framebuffer.hpp>

namespace OpenEngine {
    Ref<FrameBuffer> FrameBuffer::Create(const FramebufferSpecification& spec)
    {
        OE_PROFILE_FUNCTION();

        switch (Renderer::GetAPI()) {
            case RendererAPI::API::None : OE_CORE_ASSERT(false, "No render API selected!"); return nullptr;
            case RendererAPI::API::OpenGL : return CreateRef<OpenGLFramebuffer>(spec);
        }

        OE_CORE_ASSERT(false, "Selected API not supported");
        return nullptr;
    }
}
