I have a 3d window hosted inside a WPF program. This is written in C#, using SlimDX. It uses a D3DImage subclass to support dx10 & dx11 rendertargets, like this site recommends: http://jmorrill.hjtcentral.com/Home/tabid/428/EntryId/437/Direct3D-10-11-Direct2D-in-WPF.aspx
However, when I resume from sleep, or even lock & unlock the screen on Windows, the 3D window goes blank until I resize it. What is the appropriate way to mitigate this issue?
After resuming, but while the 3D window is still blank, I've confirmed:
- The window ActualWidth & ActualHeight have not changed
- The device is not null
- The backbuffer is not null
- The draw loop is still looping
- The blank screen is occurring after the unlock. To prove this I put a Thread.Sleep() in the Unlock handling code to purposely lock the UI thread. The 3D image was still visible until the thread.sleep period ended, then it went blank.