Advertisement

Restore method

Started by November 21, 2002 04:21 PM
0 comments, last by Zorbfish 21 years, 11 months ago
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?
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 :-)

This topic is closed to new replies.

Advertisement