Advertisement
microwerx

Untitled

Jun 17th, 2017
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. glBindBuffer(GL_ARRAY_BUFFER, abo);
  2. glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, eabo);
  3.  
  4. GLsizei stride = sizeof(float) * 8;
  5. glVertexAttribPointer(vloc, 3, GL_FLOAT, GL_FALSE, stride, (const void *)0);
  6. glVertexAttribPointer(nloc, 3, GL_FLOAT, GL_FALSE, stride, (const void *)12);
  7. glVertexAttribPointer(tloc, 2, GL_FLOAT, GL_FALSE, stride, (const void *)24);
  8. if (vloc >= 0) glEnableVertexAttribArray(vloc);
  9. if (nloc >= 0) glEnableVertexAttribArray(nloc);
  10. if (tloc >= 0) glEnableVertexAttribArray(tloc);
  11. glDrawElements(GL_TRIANGLES, 36, GL_UNSIGNED_SHORT, 0);
  12. if (vloc >= 0) glDisableVertexAttribArray(vloc);
  13. if (nloc >= 0) glDisableVertexAttribArray(nloc);
  14. if (tloc >= 0) glDisableVertexAttribArray(tloc);
  15.  
  16. glBindBuffer(GL_ARRAY_BUFFER, 0);
  17. glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement