code_junkie

Texturing Vertex Buffer Objects

Nov 13th, 2011
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. // vertexes
  2. glBindBufferARB(GL_ARRAY_BUFFER_ARB, vertexBufferId);
  3. glVertexPointer(3, GL_FLOAT, 0, 0);
  4. // textures
  5. glBindBufferARB(GL_ARRAY_BUFFER_ARB, texCoordBufferId);
  6. glTexCoordPointer(2, GL_FLOAT, 0, 0);
  7. // indexes
  8. glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, indexBufferId);
  9. // draw it
  10. glDrawRangeElements(GL11.TRIANGLES, 0, size - 1, size, GL_UNSIGNED_INT, 0);
Add Comment
Please, Sign In to add comment