Created
August 3, 2015 20:07
-
-
Save chrisforbes/e82eaa5fb2f2af0d6c51 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define MAX_DRAW_SIZE 16384 | |
void | |
draw_mesh(hw_mesh *m) | |
{ | |
glBindVertexArray(m->vao); | |
GLuint indices = m->num_indices; | |
GLuint offset = 0; | |
while(indices > 3 * MAX_DRAW_SIZE) { | |
glDrawElements(GL_TRIANGLES, 3 * MAX_DRAW_SIZE, GL_UNSIGNED_INT, (GLvoid const *)offset); | |
offset += 3 * MAX_DRAW_SIZE * sizeof(GLuint); | |
indices -= 3 * MAX_DRAW_SIZE; | |
} | |
glDrawElements(GL_TRIANGLES, indices, GL_UNSIGNED_INT, (GLvoid const *)offset); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment