Jump to content
  • Advertisement


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


lock a vertexbuffer,i failed.

This topic is 5456 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

I can''t lock a vertexbuffer use Lock(0,0,p,D3DLOCK_DISCARD); The vertexbuffer created by D3DUSAGE_WRITEONLY. It''s ok when change to the Lock(0,0,p,0); but i can''t find what''s means to set the D3DLOCK_CARD to zero. which lock parameter is better.

Share this post

Link to post
Share on other sites
Quote from the SDK:

"The D3DLOCK_DISCARD and D3DLOCK_NOOVERWRITE flags are valid only on buffers created with D3DUSAGE_DYNAMIC."

Dynamic buffers can move in the gfx memory for speed optimization. The Discard flag tells the driver that you don't care, since you don't need the old data anymore, and therefore potentially makes the lock faster.

Note that not all hw support dynamic vb:s.


EDIT: Lock parameter 0 simply uses the default lock settings (RW, non-dynamic, blocking).

[edited by - Nik02 on November 12, 2003 4:17:32 AM]

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!