This snippet look right to you?

Started by
1 comment, last by edenxiii 19 years, 2 months ago
Its late and I'm out of resources. I can't find anything to tell me one way or the other, but does this code snippet look right to you? //Grab the adjacency info DWORD* AdjacencyArray = (DWORD*)pAdjacencyBuffer->GetBufferPointer(); m_MeshContainer.pAdjacency = new DWORD[(pAdjacencyBuffer->GetBufferSize()/4)]; //Copy the adjacency info over for(DWORD i = 0; i < pAdjacencyBuffer->GetBufferSize()/4; i++) { m_MeshContainer.pAdjacency = AdjacencyArray; } //Release the adjacency buffer; we no longer need it pAdjacencyBuffer->Release(); Esentially, all I'm doing is grabbing the adjacency info out of the buffer returned by LoadSkinMesh and sticking it in the DWORD* for adjacency in MeshContainer. Is there a better way? Does this work? Thanks in advance.
Advertisement
As far as I can see a simple
memcpy( m_MeshContainer.pAdjacency, AdjacencyArray, pAdjacencyBuffer->GetBufferSize());
should work as well.

Regards,
Andre
Andre Loker | Personal blog on .NET
Oh, right. Yeah, memcpy() works just fine. Thanks!

This topic is closed to new replies.

Advertisement