The other thing I am unsure of is "#5 Draw it using the pre-generated 16-bit index buffer.". What index buffer? Do I need to add anther step somewhere?
Ashaman73 already gave you an example of it.
At the beginning of the program you make a single vertex buffer with 16-bit indices with the values [0 1 2 0 2 3 4 5 6 4 6 5] etc. with enough indices to draw the maximum number of sprites a vertex buffer can hold.
Do not draw the whole index buffer; you only draw as many primitives as you actually put into the vertex buffer.
if(FAILED(mRenderer->getDevice()->CreateVertexBuffer(nQuantity*4*sizeof(D3DVERTEX),NULL,D3DFVF_XYZRHW|D3DFVF_DIFFUSE|D3DFVF_TEX1,D3DPOOL_MANAGED,&pVertexObjectDynamic,NULL)))
That is not a dynamic vertex buffer.
You didn’t specify the D3DUSAGE_DYNAMIC flag nor did you put it in the D3DPOOL_SYSTEMMEM memory pool.
Just as a side note; white-space is not your enemy:
if( FAILED( mRenderer->getDevice()->CreateVertexBuffer( nQuantity*4*sizeof(D3DVERTEX),
D3DUSAGE_DYNAMIC,
D3DFVF_XYZRHW|D3DFVF_DIFFUSE|D3DFVF_TEX1,
D3DPOOL_SYSTEMMEM,
&pVertexObjectDynamic,
NULL ) ) )
pVertexObjectDynamic->Release();
Why are you releasing it? There is no information in your post about where these steps are happening.
Is this done on every loop? Once at shut-down?
I said create and destroy the vertex buffer only once, fill it every frame.
// #3: Fill it with the sprite vertices. Drawing 32 sprites means you put 32×4 vertices into the buffer.
memcpy(pVertexBuffer,vertices,nQuantity*4*sizeof(D3DVERTEX));
Just copying the vertices? Did you transform them?
Are the sprites actually moving? We have all been assuming you had 1,000 sprites moving on the screen.
If these sprites are all static, then go back to a static buffer and only put vertices into it once.
A dynamic vertex buffer is for frequent updating. If you aren’t going to move the sprites around then don’t update the vertex buffer.
L. Spiro