Odd error with vertex buffers

Started by
2 comments, last by madman_k 21 years, 4 months ago
I am trying to make a wrapper class for a directX vertex buffer, but i had a bit of trouble. Assuming correct parameters and that buf is IDirect3DVertexBuffer8*: buf->Lock(); memcpy(); buf->Unlock(); the memcpy() works, but the Unlock() causes a runtime access violation. Anyone got an idea?
Advertisement
Are you sure it's croaking on the Unlock() call? I've had problems before with access violations during the copy cycle, but it has almost always been a result of the memcpy() call.

Usually what has happened is that I've accidentally copied data past the allocated range of the vertex buffer.

--Hoozit.

----------------------
Check out my game demo and resume at
www.fivestory.com/projects/game.

[edited by - HoozitWhatzit on December 2, 2002 4:35:45 PM]
----------------------Check out my game demo and resume at www.fivestory.com/projects/game.
More code and we can help you.
Thanks, but i found the problem shortly after i made the post. It was just the way I had set up my encapsulation and i made some stupid mistakes. I guess it happens to the best of us.

This topic is closed to new replies.

Advertisement