#ifndef OPENGL_BUFFER_HPP
#define OPENGL_BUFFER_HPP

#include "renderer/buffer.hpp"

#include <cstdint>

namespace OpenEngine {
    class OpenGLVertexBuffer : public VertexBuffer
    {
        public:
            OpenGLVertexBuffer(uint32_t size);
            OpenGLVertexBuffer(float* vertices, uint32_t size);
            virtual ~OpenGLVertexBuffer();

            virtual void SetData(const void* data, uint32_t size) override;

            virtual void Bind() const override;
            virtual void UnBind() const override;

            virtual const BufferLayout& GetLayout() const override { return layout; };
            virtual void SetLayout(const BufferLayout& layout) override { this->layout = layout; };

        private:
            BufferLayout layout;
            unsigned int id;
    };

    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 count; };

        private:
            unsigned int id;
            uint32_t count;
    };
}

#endif // OPENGL_BUFFER_HPP
