#include "mesh.h" #include "gfx/gl/vertexArrayObject.hpp" #include "glArrays.h" #include "vertex.hpp" #include Mesh::Mesh(const std::span vertices, const std::span indices, GLenum m) : m_numIndices {static_cast(indices.size())}, mode {m} { VertexArrayObject {m_vertexArrayObject} .addAttribs( m_vertexArrayBuffers[0], vertices) .addIndices(m_vertexArrayBuffers[1], indices); } void Mesh::Draw() const { glBindVertexArray(m_vertexArrayObject); glDrawElements(mode, m_numIndices, GL_UNSIGNED_INT, nullptr); glBindVertexArray(0); }