From d22d287c6fe4a03c64290795c01fc908b883b5fd Mon Sep 17 00:00:00 2001 From: reuk Date: Wed, 9 Oct 2024 13:15:45 +0100 Subject: [PATCH] Direct2D: Avoid presenting incomplete buffers after startFrame fails --- .../juce_graphics/native/juce_Direct2DHwndContext_windows.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/juce_graphics/native/juce_Direct2DHwndContext_windows.cpp b/modules/juce_graphics/native/juce_Direct2DHwndContext_windows.cpp index dec6112ddc..8d9d5a7610 100644 --- a/modules/juce_graphics/native/juce_Direct2DHwndContext_windows.cpp +++ b/modules/juce_graphics/native/juce_Direct2DHwndContext_windows.cpp @@ -245,6 +245,10 @@ public: // Require the entire window to be repainted deferredRepaints = size; + + // The backbuffer has no valid content until we paint a full frame + dirtyRegionsInBackBuffer.clear(); + InvalidateRect (hwnd, nullptr, TRUE); // Resize/scale the swap chain