Closed d2phap closed 2 years ago
Hi,
Good remark. What I've done is added a WaitError event to the class so you can handle any error the way you like, for example:
var vbt = new VerticalBlankTicker();
vbt.Tick += ...
vbt.WaitError += Vbt_WaitError;
vbt.Start();
...
private static void Vbt_WaitError(object sender, VerticalBlankTickerErrorEventArgs e)
{
if (e.Error == unchecked((int)0xc01e0006))
{
Console.WriteLine("error! wait & continue...");
Thread.Sleep(1000);
e.Handled = true;
}
}
Awesome! Thanks for creating this library. I successfully port the C++ Direct2D project to use your WicNet and parts of DirectN in my software ImageGlass v9.0 beta 2!
Hi @smourier
As the title says, this error causes by line 122.
To reproduce
But the question is, should the ticker sleep while the monitor is off instead of throw the exception. With this way, the ticker can auto-recover again.
https://github.com/smourier/DirectN/blob/56de709b44352dbe3ee4bbccb2f301eb7fca40f8/DirectN/DirectN/Extensions/VerticalBlankTicker.cs#L91-L123
My suggestion: