Fixed brick code which caused memory override for mesh data and fucked up rendering

This commit is contained in:
2022-04-24 11:27:23 +03:00
parent 77b267af4c
commit 6aaeeb49a7
5 changed files with 54 additions and 47 deletions
+2
View File
@@ -42,6 +42,7 @@ BEGIN_NAMESPACE
// fill in buffer
size_t i = 0;
size_t face_index = 0;
for (auto& f: facets) {
for (int j = 0; j < 3; j++) {
vbo_data[i++] = vertices[f.vertices[j]].position.x;
@@ -59,6 +60,7 @@ BEGIN_NAMESPACE
vbo_data[i++] = f.text_coords[j].x;
vbo_data[i++] = f.text_coords[j].y;
}
face_index++;
}
glBindVertexArray(vao_id);