bjz

Untitled

bjz
Jul 17th, 2012
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. glGenVertexArrays(1, &vao)
  2.  
  3. glBindVertexArray(vao)
  4. glGenBuffers(1, &indexBuffer)
  5. glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer)
  6. glBufferData(GL_ELEMENT_ARRAY_BUFFER, ...)
  7. glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0)
  8. glBindVertexArray(0)
  9.  
  10. glBindVertexArray(vao)
  11. glGenBuffers(1, &positionBuffer)
  12. glBindBuffer(GL_ARRAY_BUFFER, positionBuffer)
  13. glBufferData(GL_ARRAY_BUFFER, ...)
  14. glVertexAttribPointer(...)
  15. glBindBuffer(GL_ARRAY_BUFFER, 0)
  16. glBindVertexArray(0)
  17.  
  18. glBindVertexArray(vao)
  19. glGenBuffers(1, &normalbuffer)
  20. glBindBuffer(GL_ARRAY_BUFFER, normalbuffer)
  21. glBufferData(GL_ARRAY_BUFFER, ...)
  22. glVertexAttribPointer(...)
  23. glBindBuffer(GL_ARRAY_BUFFER, 0)
  24. glBindVertexArray(0)
Advertisement
Add Comment
Please, Sign In to add comment