Hi!
If I change the value of the vertices from a mesh after call this code, Must I calling it again?:
glGenVertexArrays(1, &BufferIds[0]);
ExitOnGLError("ERROR: No se puede generar el VAO");
glBindVertexArray(BufferIds[0]);
ExitOnGLError("ERROR: No se puede bindear el VAO");
// Activamos dos vertex attribute locations
glEnableVertexAttribArray(0);
glEnableVertexAttribArray(1);
ExitOnGLError("ERROR: No se puede activar los vertex attributes");
// Creamos los VBO
glGenBuffers(2, &BufferIds[1]);
ExitOnGLError("ERROR: No se pueden generar los buffer objects");
// Bindeamos el VBO al VAO
glBindBuffer(GL_ARRAY_BUFFER, BufferIds[1]);
glBufferData(GL_ARRAY_BUFFER, vtn.size()*sizeof(VertexTextureNormal), &vtn[0], GL_STATIC_DRAW);
ExitOnGLError("ERROR: No se puede bindear el VBO al VAO");
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, sizeof(vtn[0]) ,0);
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(vtn[0]) , (GLvoid*) sizeof(vtn[0].position));
ExitOnGLError("ERROR: Could not set VAO attributes");
// Creamos el IBO
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, BufferIds[2]);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, indices.size() * sizeof(GLuint), &indices.front(), GL_STATIC_DRAW);
ExitOnGLError("ERROR: No se puede bindear el IBO al VAO");
glBindVertexArray(0);