// Copyright (c) 2022 Dominic Masters // // This software is released under the MIT License. // https://opensource.org/licenses/MIT #include "display/mesh/TriangleMesh.hpp" using namespace Dawn; void TriangleMesh::createTriangleMesh(Mesh &mesh) { glm::vec3 positions[3] = { glm::vec3(-0.5f, -0.5f, 0), glm::vec3(0.5f, -0.5f, 0), glm::vec3(0, 0.5f, 0) }; glm::vec2 coordinates[3] = { glm::vec2(0, 0), glm::vec2(0, 1), glm::vec2(1, 0) }; meshindice_t indices[3] = { 0, 1, 2 }; mesh.createBuffers(3, 3); mesh.bufferPositions(0, positions, 3); mesh.bufferCoordinates(0, coordinates, 3); mesh.bufferIndices(0, indices, 3); }