wpfdirect3d9d3dimage

Can WPF's D3DImage.IsFrontBufferAvailable be ignored?


I always followed the common advice for WPF's D3DImage.IsFrontBufferAvailable and stopped rendering when the front buffer is not available. But after resetting the D3D device this property sometimes remains stuck to false and never becomes true again.

Unless I drop to the debugger and ignore the property and continue rendering anyway, then it actually turns back to true and everything starts working again.

Even removing the D3DImage.IsFrontBufferAvailable check entirely and completely ignoring the property all the time seems to work well.

It seems that's also ​recommended by some people for other reasons:

Note that even if the IsFrontBufferAvailable flag is stating that it is unavailable, you’ll still be able to render properly. The trick is to simply ignore the flag.

What are the downsides to completely ignoring it? (Or is there some other trick that makes it not stop working?)


Solution

  • I think its recommended to save resources if the program is not displayed (e.g. if the user is in lock screen).

    From my experience you can safely ignore it, it just keeps rendering even if the UI is not shown to the user.

    If your application does not need a lot of resources this does not have a big impact on power consumption.