Jump to content
  • Advertisement


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


Restore method

This topic is 5843 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 still have some questions about restore after reading about it in the sdk help. 1. What would happen if I called RestoreAllSurfaces() every time I get DDERR_SURFACELOST instead of calling Restore on the specific surface lost? 2. Should I keep a variable holding the name of my bitmaps so that I can easily reload my bitmaps? 3. Q2 assumes that the memory for the bitmaps is lost. Am I correct in that assumption?

Share this post

Link to post
Share on other sites
1. it would restore (reclaim the memory) for the surfaces that were lost.. this is a nice utility function because then you do not have to call Restore on all surfaces..

2. that could be one way to do it.. everytime you get DDERR_SURFACELOST.. then just call RestoreAllSurfaces().. loop trough all your surfaces and reload their images.. if you store the filename together with each surface.. and put that into a linked list this should be really simple..

3. well.. that a surface is lost only means that some other process have been writing to the vidmen and therefore DirectX cannot guarantee, that memory still contains the stuff you loaded into it. so therefore you have to assume that the content is lost.. so you are right :-)

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!