#ifndef MESH_INCLUDED_H #define MESH_INCLUDED_H #include #include #include #include #include #include #include #include #include class ObjParser; enum MeshBufferPositions { POSITION_VB, TEXCOORD_VB, NORMAL_VB, INDEX_VB }; class Mesh { public: using Data = std::pair, std::vector>; explicit Mesh(const std::filesystem::path & fileName); explicit Mesh(const ObjParser & obj); Mesh(std::span vertices, std::span indices, GLenum = GL_TRIANGLES); virtual ~Mesh(); NO_COPY(Mesh); NO_MOVE(Mesh); void Draw() const; private: explicit Mesh(Data && vandi, GLenum = GL_TRIANGLES); static Data packObjParser(const ObjParser &); static constexpr unsigned int NUM_BUFFERS {4}; GLuint m_vertexArrayObject; std::array m_vertexArrayBuffers; size_t m_numIndices; GLenum mode; }; #endif