Last active
August 29, 2015 14:01
-
-
Save Neill3d/b4ac49ad560b308a0b75 to your computer and use it in GitHub Desktop.
VBO Render Indices in the MoBu model
This file contains 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
// Even if the function returns to us integers (in the FBModelVertexData class) | |
/** Return Index Array*/ | |
int* GetIndexArray(); | |
// you should remember that VBO buffer type of an element is unsigned int | |
// draw all model sub patches | |
for (int i=0; i<lVertexData->GetSubPatchCount(); ++i) | |
{ | |
const int indexOffset = lVertexData->GetSubPatchIndexOffset(i); | |
const int indexSize = lVertexData->GetSubPatchIndexSize(i); | |
glDrawElementsBaseVertex( GL_TRIANGLES, indexSize, GL_UNSIGNED_INT, (void*) 0, indexOffset ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment