in the book it makes a Line drawing class which looks ok but the render function it uses doesnt work i tried messing around with it but still no joy.
i think it is because of the MemoryCopy function ill show the rough code.
void* pData = 0;
r = pVB->Lock( 0, 0, (void**)&pData, 0);
if( FAILED(r))
{
pVB->Release();
return E_FAIL;
}
CopyMemory( pData, (void*)&m_StartPoint, sizeof( CZenVertex));
CopyMemory( pData + sizeof(CZenVertex), (void*)&m_EndPoint, sizeof( CZenVertex));
pVB->Unlock();
more code to draw primitive here...
the problem is it dont know how to count from the void pointer address?
there is some code missing but hopefully from this snippet you can understand what im trying to do and how i should be doing it
im not sure why the book makes void* i think its needed as a void** in another function before the memorycopy
many thanks in advance
EDIT: im sorry what i need is a way to find the address of pData and add the sizeof(Vertex) to that as the starting point to copy the Endpoint Vertex into the Vertex Buffer the start point goes in there easy enough though