Archived

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

last-bastardo

Need help urgently

Recommended Posts

If I Lock and create my vertex buffer with Buf->Lock(0, 0, (BYTE **)&vtxs, D3DLOCK_DISCARD); memcpy(vtxs, Part.vtx, sizeof(Part.vtx)); Buf->Unlock(); Where Part.vtx is an array of 4 vectors (which are of format ZRHW i.e. they are proccessed, in screen space) everything is ok but when I use Buf->Lock(0, 0, (BYTE **)&vtxs, D3DLOCK_DISCARD); vtxs[0] = Part.getVtx[0]; vtxs[1] = Part.getVtx[1]; vtxs[2] = Part.getVtx[2]; vtxs[3] = Part.getVtx[3]; Buf->Unlock(); Where getVtx just returns a vertex from that array, then nothing renders. What am I doing wrong ? CVec4 getVtx(int num) { return vtx[num]; } (Code for getVtx). So all I need to figure out is why the second one doesn''t work. As that is the one I need to use. -=Last Bastardo=-

Share this post


Link to post
Share on other sites
Define "vtxs" as a pointer to whatever type you are defineing vertices with, ie "MYVERTEX* vtxs;", where MYVERTEX is the type that cooresponds with the FVF you created the VB with.

Z.

Share this post


Link to post
Share on other sites