12345678910111213141516171819 |
- #include "client/rendering/Mesh.h"
- #include "rendering/Attributes.h"
- Mesh::Mesh() : vertices(0) {
- }
- bool Mesh::init() {
- vertexBuffer.init(Attributes().addFloat(3).addFloat(2).addFloat(3));
- return false;
- }
- void Mesh::build(const TypedBuffer<Triangle>& buffer) {
- vertices = buffer.getLength() * 3;
- vertexBuffer.setStaticData(buffer.getByteLength(), buffer);
- }
- void Mesh::draw() {
- vertexBuffer.draw(vertices);
- }
|