LPDIRECT3DINDEXBUFFER9 pIndexBuff; WORD indices[] = {0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23}; pD3DDevice->CreateIndexBuffer(36 * sizeof(WORD), D3DUSAGE_WRITEONLY, D3DFMT_INDEX16, D3DPOOL_MANAGED, &pIndexBuff, NULL); VOID* pIndices; pIndexBuff->Lock(0, 0, (void**)&pIndices, 0); memcpy(pIndices, indices, 36 * sizeof(WORD)); pIndexBuff->Unlock();This example creates an index buffer for a cube with 12 triangles using the CreateIndexBuffer function. It then fills the buffer with 36 indices and unlocks it. Package Library: The package library for this function is d3d9.lib, which is part of the DirectX 9 SDK.