Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Gl_object::updateTranslations(vector<glm::vec3> translations)
- {
- print("e0");
- m_size = translations.size();
- print("e1");
- glBindBuffer(GL_ARRAY_BUFFER, m_translationVBO);
- print("e2");
- //Get VBO adress
- void *adresseVBO = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY);
- print("e3");
- if(adresseVBO != NULL)
- {
- print(m_texturePath);
- //Copy new vertices to VBO
- int size = m_size * sizeof(glm::vec3);
- print(convertNbToStr(m_size) + " " + convertNbToStr(sizeof(glm::vec3)));
- memcpy((char*)adresseVBO, &translations[0], size);
- print("e5");
- glUnmapBuffer(GL_ARRAY_BUFFER);
- print("e6");
- }
- print("e7");
- adresseVBO = 0;
- print("e8");
- glBindBuffer(GL_ARRAY_BUFFER, 0);
- print("e9");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement