I wrote this article out of good-natured spite after realizing I had no idea what most of the DrawIndexedPrimitive parameters did, even after carefully reading the documentation; it's since been included in the Microsoft DirectX 9.0 SDK Update (Summer 2004) documentation under the heading "Rendering from Vertex and Index Buffers".
Scenario 1: Drawing Two Triangles without IndexingLet's say you want to draw this quad: If you use the Triangle List primitive type to render the two triangles, each triangle will be stored as 3 individual vertices, resulting in a similar vertex buffer to this: The drawing call is very straight-forward; starting at location 0 within the vertex buffer, draw two triangles. If culling is enabled, the order of the vertices will be important. This example assumes the default counter-clockwise culling state, so visible triangles must be drawn in clockwise order. The Triangle List primitive type simply reads three vertices in linear order from the buffer for each triangle, so this call will draw triangles (0, 1, 2) and (3, 4, 5):
DrawPrimitive( D3DPT_TRIANGLELIST, // PrimitiveType 0, // StartVertex 2 ); // PrimitiveCount
DrawIndexPrimitive( D3DPT_TRIANGLELIST, // PrimitiveType 0, // BaseVertexIndex 0, // MinIndex 4, // NumVertices 0, // StartIndex 2 ); // PrimitiveCount
DrawIndexPrimitive( D3DPT_TRIANGLELIST, // PrimitiveType 0, // BaseVertexIndex 0, // MinIndex 4, // NumVertices 3, // StartIndex 1 ); // PrimitiveCount
DrawIndexPrimitive( D3DPT_TRIANGLELIST, // PrimitiveType 50, // BaseVertexIndex 0, // MinIndex 4, // NumVertices 3, // StartIndex 1 ); // PrimitiveCount