The Direct2D render loop is run on its own thread for aesthetic reasons. This enables smooth and instantaneous animations, regardless of window resize or other message pump blocks on the main thread. This render thread stays blocked most of the time (using Monitor.Wait
) unless the scene is invalidated by mouse hovers, scrolling, window resizing, and so on.
I don't see a way to cancel the presentation once the drawing code calls BeginDraw
on the render target. If the window is invalidated in certain ways, the scene is going to be thrown away and redrawn anyway. What can I do to get back to a clean slate, ready for the next BeginDraw
, without finishing and presenting the scene? Can I cause a render error to interrupt the drawing thread that would skip the presentation?