Archived

This topic is now archived and is closed to further replies.

Chaucer

dynamic index buffers

Recommended Posts

Chaucer    122
I think I''m having trouble clearing my dynamic index buffers. Will this take care of it?
  
pIndexBuffer->Lock(0, 0, (BYTE**)&pIndices, D3DLOCK_DISCARD);
pIndexBuffer->Unlock();	
  
or do I need something like this?
  
pIndexBuffer->Lock(0, 0, (BYTE**)&pIndices, D3DLOCK_DISCARD);
memset(pIndices,0,numIndices*sizeof(WORD));
pIndexBuffer->Unlock();	
  
thanks.

Share this post


Link to post
Share on other sites
Osc    122
D3DLOCK_DISCARD will not touch the data itself, so you could have *anything* in there. memset is fine.

Share this post


Link to post
Share on other sites