Skip to content

Instantly share code, notes, and snippets.

@Neill3d
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Neill3d/b4ac49ad560b308a0b75 to your computer and use it in GitHub Desktop.
Save Neill3d/b4ac49ad560b308a0b75 to your computer and use it in GitHub Desktop.
VBO Render Indices in the MoBu model
// 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