void LoopUntilRetrieved() { ScheduledTask task = new ScheduledTask(); task.Interval = 1.0 / 20; task.Callback = LostContextFunction; while (true) { Thread.Sleep(50); uint code = (uint)device.TestCooperativeLevel(); if ((uint)code == (uint)Direct3DError.DeviceNotReset) { Utils.LogDebug("Retrieved Direct3D device again."); return; } task.Callback(task); } }
void LoopUntilRetrieved() { ScheduledTask task = new ScheduledTask(); task.Interval = 1.0 / 60; task.Callback = LostContextFunction; while (true) { Thread.Sleep(16); int res = Device.TestCooperativeLevel(device); if (res == (int)Direct3DError.DeviceNotReset) { return; } task.Callback(task); } }