Original Post
I am looking for a way to "transparently" release my device. It's a little hard to explain what I mean, but I'll try anyway. I have the game menu all nicely rendered. When I start up the game itself, I dynamically load another dll that contains information about how the map will be run - this lets me do all the scripting I could ever dream of. However, this is C#, and I don't have the ability to directly unload an assembly once I load it. I need to create a separate application domain and unload that. Switching between domains is not the most efficient operation, and normally the rendering core would be outside of it. I want to move it inside. That's all fine and good. The problem comes when the game ends and I go back to the menu screen. I want to unload the map assembly so they don't start piling up as the person plays different games. This requires me to unload all of the assemblies in the application domain, including the rendering core. The rendering core has my device object, which means I need to release that. If the user is in fullscreen there will be an awkward flicker as the display mode is returned to the original when the device is released, and then set back when it's recreated to display the menu. I need a way to 1) keep fullscreen active between the device release and recreation, or 2) move the graphics object into the appdomain and then out again. Currently I can't think of a good way to do either. I don't think #2 is possible. Even if new app domain had a reference to the graphics object, it would still jump outside any time a function was called. When the graphics core goes to render, it jumps inside the app domain...not good at all. I'll keep the idea open just in case, but I think #1 would be the simplest. So, does anyone know a way to preserve the fullscreen while destroying the device?