Just a follow up, if you pass an integer to the std::vector constructor, it will create a vector with that many elements in it that are default constructed if you don't pass a second value. This is called the 'fill' constructor. Since UINT doesn't have a default constructor mechanism, you end up with the contents of memory in your vector.

Since UINT doesn't have a default constructor mechanism, you end up with the contents of memory in your vector.

The parameter is declared as const value_type& val = value_type(), so it will perform zero initialization for built-in types:

int a; // garbage
int b = int(); // zero initialized

Good call - I just tried it out and you are 100% correct. I wonder how the OP was getting garbage in the vector then... I suppose if he has all 0's in the index buffer, and then pushes back all of his indices, it would look like a ton of senseless indices, but I don't know...