To draw in OpenGL, you specify an array of vertices, and then indices that connect together the array of vertices into a sensical order of primitives. You can do this with glDrawElements. To specify vertices, you can use glVertexPointer, in which you can specify a parameter "stride" - the gaps between contiguous elements in your array (i.e. if you store a vertex in a struct containing other data, you stride to jump past the other data).
This is great, but now I am using Assimp, which specifies its indices in a face struct.
struct aiFace {
unsigned int* indices;
unsigned int numIndices;
}
Presumably, this is to support a mesh with different sized faces (a mesh with triangles and quads). Assimp is nice enough to have the option to triangulate all meshes, so I can guarantee all faces to be the same primitive.
Thus, what I really want is to be able to stride my indices, as such:
gl/*...uh...*/ElementPointer(
3,
GL_UNSIGNED_INT,
sizeof(unsigned int) /* skip past the num_indices field*/,
&faces[0]);
But I can't figure out how to do that. glDrawElements assumes that indices is a contiguous array. Is there a way to do this in OpenGL?