Implemented uniform buffers. Optimized data upload to GPU

This commit is contained in:
2026-09-27 05:33:36 +02:00
parent 1703ead546
commit a9bda25031
13 changed files with 382 additions and 195 deletions

View File

@@ -19,7 +19,7 @@ Rc<Mesh> Mesh::create(const std::vector<Vertex>& vertices,
// Upload vertex data
glBindBuffer(GL_ARRAY_BUFFER, VBO);
glBufferData(GL_ARRAY_BUFFER, vertices.size() * sizeof(vertices[0]),
&vertices[0], GL_STATIC_DRAW);
&vertices[0], GL_DYNAMIC_DRAW);
// Upload index data
if (has_indices) {