summaryrefslogtreecommitdiff
path: root/gfx/models/mesh.h
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/models/mesh.h')
-rw-r--r--gfx/models/mesh.h17
1 files changed, 12 insertions, 5 deletions
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 <GL/glew.h>
#include <array>
#include <cstddef>
+#include <filesystem>
+#include <gfx/models/vertex.hpp>
#include <span>
#include <special_members.hpp>
-#include <string>
+#include <utility>
+#include <vector>
-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<Vertex>, std::vector<unsigned int>>;
+ explicit Mesh(const std::filesystem::path & fileName);
+ explicit Mesh(const ObjParser & obj);
Mesh(std::span<Vertex> vertices, std::span<unsigned int> 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;