What I want to do is to render a mesh multiple times with the same vbo but with different offset. Example:
//Load VBO
glGenBuffers(2, &bufferObjects[0]);
glBindBuffer(GL_ARRAY_BUFFER, bufferObjects[VERTEX_DATA]);
glBufferData(GL_ARRAY_BUFFER, sizeof(float)*size(vertices)*3, &vertices[0], GL_STATIC_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bufferObjects[INDEX_DATA]);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(int)*size(indices), &indices[0], GL_STATIC_DRAW);
//Render VBO
glBindBuffer(GL_ARRAY_BUFFER, bufferObjects[VERTEX_DATA]);
glVertexPointer(3, GL_FLOAT, 0, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bufferObjects[INDEX_DATA]);
glDrawElements(renderFlag, nrIndices, GL_UNSIGNED_INT, 0);
If I draw the hole mesh at the same time there is no problem, but is it possible to draw the same mesh with a different start index, like this:
glDrawElements(renderFlag, 20, GL_UNSIGNED_INT, "WHAT TO WRITE HERE"?);