#pragma once #include #include #include namespace XCEngine { namespace RHI { struct VertexAttribute { unsigned int index; int count; unsigned int type; bool normalized; size_t stride; size_t offset; }; class OpenGLVertexArray { public: OpenGLVertexArray(); ~OpenGLVertexArray(); bool Initialize(); void AddVertexBuffer(unsigned int buffer, const VertexAttribute& attribute); void SetIndexBuffer(unsigned int buffer, unsigned int type); void Shutdown(); void Bind() const; void Unbind() const; unsigned int GetID() const { return m_vao; } unsigned int GetIndexBuffer() const { return m_indexBuffer; } unsigned int GetIndexCount() const { return m_indexCount; } private: unsigned int m_vao; unsigned int m_indexBuffer; unsigned int m_indexCount; int m_vertexBufferCount; }; } // namespace RHI } // namespace XCEngine