Sign in to follow this  
Downie

[Directx 10] Quick Question About VB's Please!!!

Recommended Posts

Downie    130
Hi. I was wondering if it is possible to map vertex data from a list to a vertex buffer, maybe something like this
	//Lock the buffer 
	mVB->Map(D3D10_MAP_WRITE_NO_OVERWRITE, 0, reinterpret_cast<void**>(&pVert));

	//Copy the vertex data into the buffer
	for(int i=0; i<ListSize; i++) 
		*pVert++ = *mllVertexList.GetByIndex(i);

	//Unlock the buffer
	mVB->Unmap();
Or is it only possible with contiguous storage like arrays? I know arrays are better for this as I could use update subresource or memcpy to update quicker. But my vertex data is dynamic and using a list allows me to track which vertices have been changed and only update them. Thanks [Edited by - Downie on April 30, 2009 2:33:24 PM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this