Jump to content
  • Advertisement


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


Direct3D 8 newbie question

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

Somewhere in the DirectX SDK docs lies this cryptic remark: "SetStreamSource increments the reference count of the vertex buffer being assigned and decrements the reference count of the previously assigned vertex buffer. When the vertex buffer is no longer needed, set it to NULL. If you fail to do this, the vertex buffer is not released, resulting in a memory leak." I forgot about this until running one of my programs about 20 times in a row while fiddling with lighting effects suddenly left me with about 3% of my system resources. From what I can tell, you need to do this to avoid a memory leak:
lpd3ddevice->SetStreamSource( 0, NULL, 0);
So here''s my question: When do I have to do this? Before I attempt to release the vertex buffer I am using, or every frame when I am done rendering, or what? This is probably a stupid question, but the SDK docs confused the hell out of me. Things are not what they are.

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!