From d2b167f2d1ca15e42a177b65cdf34f35592452f7 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 13 Feb 2021 14:52:03 +0000 Subject: New .obj parser, packer, mesher --- gfx/models/mesh.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'gfx/models/mesh.h') diff --git a/gfx/models/mesh.h b/gfx/models/mesh.h index ebd300b..4982145 100644 --- a/gfx/models/mesh.h +++ b/gfx/models/mesh.h @@ -4,19 +4,22 @@ #include #include #include +#include +#include #include #include -#include +#include +#include -class IndexedModel; -class Vertex; +class ObjParser; enum MeshBufferPositions { POSITION_VB, TEXCOORD_VB, NORMAL_VB, INDEX_VB }; class Mesh { public: - explicit Mesh(const std::string & fileName); - explicit Mesh(const IndexedModel & model); + 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(); @@ -26,6 +29,10 @@ public: 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; -- cgit v1.2.3