What you''d normally do (well, I would anyway) is one of two things. Either:
1) Have an array of vertex data set up already and just memcpy the data into the buffer after it''s been locked, e.g.:
pdevice->CreateVertexBuffer(8*sizeof(vertextype), D3DUSAGE_SOFTWAREPROCESSING, CUSTOM_VERTEX, D3DPOOL_SYSTEMMEM, &pbuf);
pbuf->Lock(0, sizeof(vertextype), &pmem, 0);
memcpy(pmem, vertArray, 8 * sizeof(vertextype);
OR
2) Cast your pmem pointer e.g.:
vertextype * pmem;
pdevice->CreateVertexBuffer(8*sizeof(vertextype), D3DUSAGE_SOFTWAREPROCESSING, CUSTOM_VERTEX, D3DPOOL_SYSTEMMEM, &pbuf);
pbuf->Lock(0, sizeof(vertextype), (void**)&pmem, 0);
for(int j = 0; j < 8; j++)
{
pmem[j].x = 1;
etc....
}
---------------------------------------
Let''s struggle for our dream of Game!
http://andrewporritt.4t.com