The last parameter in glDrawElements is an offset. If you put several objects in a buffer, you can render each separately by calling glDrawElements multiple times with different offsets and lengths.If all the objects are static you can render them all with a single call.

You code is probably not working because you have several buffers but you only have one bound for rendering. You have to bind the buffer to match your glDrawElement.

The last parameter in glDrawElements is an offset. If you put several objects in a buffer, you can render each separately by calling glDrawElements multiple times with different offsets and lengths.If all the objects are static you can render them all with a single call.

You code is probably not working because you have several buffers but you only have one bound for rendering. You have to bind the buffer to match your glDrawElement.