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);
            }
        }
Beispiel #2
0
        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);
            }
        }