This topic is now archived and is closed to further replies.


Locking a pointer to an array of verts.

Recommended Posts

Hi all, I''m having trouble locking a pointer that is defined as follows: m_Vertices=new CUSTOMVERTEX[256*256]; I then fill in m_vertices and then lock it as follows: VOID* pVertices; if( FAILED( m_pVB->Lock( 0, sizeof(m_Vertices), (BYTE**)&pVertices, D3DLOCK_DISCARD ) ) ) return E_FAIL; memcpy( pVertices, m_Vertices, sizeof(m_Vertices)); m_pVB->Unlock(); but I think I''m getting trouble with the sizeof(m_Vertices) because it takes the size of the pointer instead of what it''s pointing to. So I tried sizeof(*m_Vertices) but it didn''t seem to give me the size of the array that m_vertices was pointing to. I''m completely lost. If anyone can point me in the right direction I''d be greatful. ~Wave

Share this post

Link to post
Share on other sites