diff options
Diffstat (limited to 'src/GFX/Binder.cpp')
| -rw-r--r-- | src/GFX/Binder.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/GFX/Binder.cpp b/src/GFX/Binder.cpp index e7b7e4c..70d045c 100644 --- a/src/GFX/Binder.cpp +++ b/src/GFX/Binder.cpp @@ -10,7 +10,8 @@ BindableMesh Binder::load(Mesh& mesh) { store_indices(mesh.raw_indices(), mesh.indices_size()); } store_in_attribute_list(0, 3, mesh.raw(), mesh.size() * 3); - store_in_attribute_list(1, 2, mesh.raw_tex_coords(), mesh.tex_coords_size() * 2); + store_in_attribute_list(1, 3, mesh.raw_normals(), mesh.normals_size() * 3); + store_in_attribute_list(2, 2, mesh.raw_tex_coords(), mesh.tex_coords_size() * 2); unbind_vao(); return {vao, mesh.indices_size()}; @@ -50,12 +51,14 @@ void BindableMesh::bind() const { glBindVertexArray(m_vao); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); + glEnableVertexAttribArray(2); } void BindableMesh::unbind() { glBindVertexArray(0); glDisableVertexAttribArray(0); glDisableVertexAttribArray(1); + glDisableVertexAttribArray(2); } size_t BindableMesh::size() const { |
