{
{-1, -1, 0} // index 0
{-1, 1, 0} // index 1
{1, 1, 0} // index 2
{1, -1, 0} // index 3
}
When drawing triangles, vertices need to come in triples. The vertices I have listed above form a square. We need to break it up into triangles but a square has four points. There are two options at this point. One options is to repeat two of the vertices so I have 6.
{
// first triangle
{-1, -1, 0}
{-1, 1, 0}
{1, 1, 0}
// second triangle
{-1, -1, 0} <-- repeats
{1, 1, 0} <--
{1, -1, 0}
}
Repeating vertices just ends up using more memory than needed. By using an index buffer we can reduce the number of repeats.
{
{-1, -1, 0}
{-1, 1, 0}
{1, 1, 0}
{1, -1, 0}
}
// index buffer
{
0, 1 ,2, <-- first triangle
0, 2, 3 <-- second triangle
}

Find content
Not Telling