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

#ifndef OPENGLBUFFER_H
#define OPENGLBUFFER_H
#include <Hazel/Renderer/Buffer.h>


namespace Hazel
{
    class OpenGLVertexBuffer : public VertexBuffer
    {
    public:
        OpenGLVertexBuffer(uint32_t size);
        OpenGLVertexBuffer(float* vertices, uint32_t size);
        virtual                     ~OpenGLVertexBuffer();
        virtual void                Bind() const override;
        virtual void                Unbind() const override;
        virtual void                SetLayout(const BufferLayout& layout) override {m_Layout = layout;}
        virtual void                SetData(const void* data, uint32_t size) override;
        virtual const BufferLayout& GetLayout() const override {return m_Layout;}
    private:
        uint32_t m_RendererID;
        BufferLayout m_Layout;
    };

    class OpenGLIndexBuffer : public IndexBuffer
    {
    public:
        OpenGLIndexBuffer(uint32_t* indices, uint32_t count);
        virtual          ~OpenGLIndexBuffer();
        virtual void     Bind() const override;
        virtual void     Unbind() const override;
        virtual uint32_t GetCount() const override {return m_Count;}
    private:
        uint32_t m_RendererID;
        uint32_t m_Count;
    };

}


#endif //OPENGLBUFFER_H
