wyrd
Senior Contributor
I have a method here which tests the cooperative level of the device and attempts to restore the surfaces if it has to;
The problem is, it throws an exception when trying to perform RestoreAllSurfaces().
I've also tried catching the SurfaceLostException, but it gives me the same error when trying to perform RestoreAllSurfaces().
I get no errors when running in windowed mode, so I can only assume it has something to do with FullscreenExclusive.
Any ideas on how to fix this?
C#:
/// <summary>
/// Insures that the surfaces for this GameSurface are accessible.
/// </summary>
private void _checkSurfaces()
{
if (_device.TestCooperativeLevel() == false) {
// TODO: Bug - Throws error in FullscreenExclusive.
_device.RestoreAllSurfaces();
}
}
The problem is, it throws an exception when trying to perform RestoreAllSurfaces().
An unhandled exception of type 'Microsoft.DirectX.DirectDraw.WrongModeException' occurred in microsoft.directx.directdraw.dll
Additional information: Error in the application.
I've also tried catching the SurfaceLostException, but it gives me the same error when trying to perform RestoreAllSurfaces().
I get no errors when running in windowed mode, so I can only assume it has something to do with FullscreenExclusive.
Any ideas on how to fix this?