void ResetDevice() { devBB.Dispose(); ResetHandlers.Reset(); for (; ;) { var result = dev.TestCooperativeLevel(); if (result.IsSuccess) { break; } if (result.Code == -2005530519) // D3DERR_DEVICENOTRESET { try { var pp = MakePresentParameters(); dev.Reset(pp); break; } catch { } } System.Threading.Thread.Sleep(100); } ResetHandlers.Restore(); devBB = dev.GetBackBuffer(0, 0); }
void ResetDevice() { ResetHandlers.Reset(); for (;;) { var pp = MakePresentParameters(); try { dev.Reset(pp); } catch { } if (dev.TestCooperativeLevel().IsSuccess) { break; } System.Threading.Thread.Sleep(100); } ResetHandlers.Restore(); }