Skip to content

Commit

Permalink
fix: segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
JulioJPinto committed May 19, 2024
1 parent 1f08da4 commit d8457ef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions engine/src/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,19 @@ void Model::setupModel() {
std::cout << "Points size: " << points.size() / 3 << std::endl;
glGenBuffers(1, &this->_vbo);
glBindBuffer(GL_ARRAY_BUFFER, this->_vbo);
glBufferData(GL_ARRAY_BUFFER, 3 * sizeof(float) * points.size(),
glBufferData(GL_ARRAY_BUFFER, sizeof(float) * points.size(),
points.data(), GL_STATIC_DRAW);

std::cout << "Normals size: " << normals.size() / 3 << std::endl;
glGenBuffers(1, &this->_normals);
glBindBuffer(GL_ARRAY_BUFFER, this->_normals);
glBufferData(GL_ARRAY_BUFFER, 3 * sizeof(float) * normals.size(),
glBufferData(GL_ARRAY_BUFFER, sizeof(float) * normals.size(),
normals.data(), GL_STATIC_DRAW);

std::cout << "Textures size: " << textures.size() << std::endl;
glGenBuffers(1, &this->_textures);
glBindBuffer(GL_ARRAY_BUFFER, this->_textures);
glBufferData(GL_ARRAY_BUFFER, 2 * sizeof(float) * textures.size(),
glBufferData(GL_ARRAY_BUFFER, sizeof(float) * textures.size(),
textures.data(), GL_STATIC_DRAW);

// Generate and bind index buffer
Expand Down

0 comments on commit d8457ef

Please sign in to comment.