Jump to content
  • Advertisement
Sign in to follow this  
Mastadex

Restoring Meshes, Lights, etc.

This topic is 4427 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. Im working with meshes, bones and animations (basic .X files). I used the MS provided code as an example and it works great now. The problem Im having now, is how do I restore a complex mesh (with animation, bones etc) after the window get minimized. I do have the code to check WHEN to restore all my objects (testing cooperative level etc) and it works fine. Im having problems reconstructing my meshes, lights, etc after a minimize. (assume im doing everything in fullscreen mode)

Share this post


Link to post
Share on other sites
Advertisement
When it comes to resets, remember that you only need to worry about your resources in the default pool and any device states. For example, if you create a vertex buffer in the default pool, and the device was lost, the entire contents of that buffer are now lost too. Using the managed pool is generally a lot easier, since it keeps a backup of the data in system memory, so when your video memory gets wiped out by a device reset, it can automatically restore it.

As far as your lights go, it would probably be easiest to keep another copy of them. This way, they are easy to update, and easy to restore.

With that said, it would probably be most convienent to have all of your stuff that can be reset by a device loss to be initialized in a function like 'InitAfterReset(). This way, when you first start your application, you can call that function. Then, when you reset your device, you call that same function. In short, you can use the same code twice: both for initialization purposes and for re-creating after device loss.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!