I am trying to use IDirect3DVertexBuffer9::Lock and pass an stl::vector containing my vertex structure, as data, instead of a VERTEX3* data pointer.
Can someone help me, becuase it crashes. Here is my code:
PHP Code:
meshes.pVB->Lock(iNextVertexData,iDataSize,(void**)&meshes.pVertices,flags);
memcpy((void*)&meshes.pVertices.back(),&ver,iDataSize);
meshes.pVB->Unlock();
Ignore the iNextVertexData and iData variables, I would be grateful if you helped me for the Lock and 3rd parameter only. It crashes on memcpy, so I guess a proper lock isnt done.