1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #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
|