123456789101112131415161718192021222324252627282930313233343536373839404142 |
- #ifndef MESH_H
- #define MESH_H
- #include <GL/glew.h>
- #include <vector>
- class Mesh final
- {
- public:
- struct VertexData final
- {
- float x;
- float y;
- float z;
- float tx;
- float ty;
- float nx;
- float ny;
- float nz;
- };
-
- Mesh();
- ~Mesh();
-
- void add(const VertexData& data);
-
- void clear();
- void build() const;
- void draw() const;
-
- private:
- Mesh(const Mesh& other) = delete;
- Mesh(Mesh&& other) = delete;
- Mesh& operator=(const Mesh& other) = delete;
- Mesh& operator=(Mesh&& other) = delete;
-
- GLuint vba;
- GLuint vbo;
- std::vector<VertexData> buffer;
- };
- #endif
|