// say i''ve locked my static vertex buffer and claimed a buffer pointer (_pVertices) and pVertices contain the vertices I want to copy
// now this line here won''t work
CopyMemory((void *)&_pVertices[iOffset], (void *)pVertices, iOffset + _iBufferPosition);
// this does!
for (int i = 0; i < (iOffset + _iBufferPosition); i++)
{
_pVertices[i]._vPosition = pVertices[i]._vPosition;
_pVertices[i]._d3dColor = pVertices[i]._d3dColor;
_pVertices[i]._vNormals = pVertices[i]._vNormals;
_pVertices[i]._vTexCoords = pVertices[i]._vTexCoords;
}
whyyyyyyyy ?
CopyMemory doesn't work w/ my vertices
Do you take into account that the CopyMemory''s third parameter is the number of _bytes_ to copy?
-Nik
-Nik
I used to make the same mistake often, when i started c++ programming.
I learned the hard way, when blue screens showed up at every second build
I copied past vid card mem boundaries, though...
-Nik
I learned the hard way, when blue screens showed up at every second build
I copied past vid card mem boundaries, though...
-Nik
All it takes is a quick glance at MSDN. Especially if the function isn''t working, that''s the first place you go.
MSDN wasn''t available when i started to learn c++, only Borland''s badly organized man pages
Besides, in this particular function, i found that it''s easy enough to forget that it''s not type safe.
-Nik
Besides, in this particular function, i found that it''s easy enough to forget that it''s not type safe.
-Nik
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement