Jump to content
  • Advertisement


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


Locking a pointer to an array of verts.

This topic is 5481 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
try sizeof(CUSTOM_VERTEX)* 256* 256

Get busy livin'' or get busy dyin''... - Shawshank Redemption
If a man is talking in the forest, and no woman is around to hear him, is he still wrong? - Unknown

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!