问题
I'm having this nasty problem with my game randomly crashing when changing the game window size, and I can't seem to find the source of the issue, so I'd like to try and approach this from another angle.
Say the GraphicsDevice
got disposed somehow. Can I recreate it or return it to its working state, so the game could continue running?
回答1:
Nope.
That instance is coupled to so many things, that using a new one after that's been disposed in its life cycle would be pratically reimplementing XNA. If you're trying to use it and it's been disposed, you're doing something very wrong. And you can't make things right by fixing a small implementation error with a huge design and project error.
For your own good, try to figure out what you've done wrong, and fix that instead. Check whether everything you're doing is being done at the right moment.
来源:https://stackoverflow.com/questions/16656002/is-it-possible-to-restore-a-graphicsdevice-if-something-goes-wrong-with-it