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


Dynamic Vertex Buffer

Recommended Posts

ok I use
hr =D3DD->CreateVertexBuffer(MAX_PARTICLES * (sizeof(D3DVertex) * 6),D3DUSAGE_DYNAMIC,
to create a dynamic VB and
struct D3DVertex
	float x,y,z;
	DWORD color;
	float u,v;

	D3DVertex *temp;
	hr = Vertex_Buffer->Lock(0,0,(void **)&temp,D3DLOCK_DISCARD);
	if (FAILED(hr))
		return 1;
to fill it. My problem is my program acts as though the VB is not being cleared. Is there something else I should be doing. The example I read in the documentation only shows how to lock it. My version is almost exatcly like it except a different struct for "temp". Any help would be great. Thanks.

Share this post

Link to post
Share on other sites