Mesh.h 521 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef MESH_H
  2. #define MESH_H
  3. #include "data/List.h"
  4. #include "rendering/VertexBuffer.h"
  5. #include "utils/TypedBuffer.h"
  6. struct Mesh final {
  7. struct VertexData final {
  8. float x;
  9. float y;
  10. float z;
  11. float tx;
  12. float ty;
  13. float nx;
  14. float ny;
  15. float nz;
  16. };
  17. private:
  18. VertexBuffer vertexBuffer;
  19. TypedBuffer<VertexData> buffer;
  20. public:
  21. Mesh();
  22. void add(const VertexData& data);
  23. void clear();
  24. void build();
  25. void draw();
  26. };
  27. #endif