Advertisement
Benjamin_Loison

void Gl_object::updateTranslations(vector<glm::vec3> transla

Aug 8th, 2018
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. void Gl_object::updateTranslations(vector<glm::vec3> translations)
  2. {
  3.     print("e0");
  4.     m_size = translations.size();
  5.  
  6.     print("e1");
  7.     glBindBuffer(GL_ARRAY_BUFFER, m_translationVBO);
  8.     print("e2");
  9.     //Get VBO adress
  10.     void *adresseVBO = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY);
  11.     print("e3");
  12.     if(adresseVBO != NULL)
  13.     {
  14. print(m_texturePath);
  15.         //Copy new vertices to VBO
  16.         int size = m_size * sizeof(glm::vec3);
  17.     print(convertNbToStr(m_size) + " " + convertNbToStr(sizeof(glm::vec3)));
  18.         memcpy((char*)adresseVBO, &translations[0], size);
  19.     print("e5");
  20.         glUnmapBuffer(GL_ARRAY_BUFFER);
  21.     print("e6");
  22.     }
  23.     print("e7");
  24.        
  25.     adresseVBO = 0;
  26.     print("e8");
  27.     glBindBuffer(GL_ARRAY_BUFFER, 0);
  28.     print("e9");
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement