From 97cd4fc162e3f553871cdc974fb8a7f8a7f24b12 Mon Sep 17 00:00:00 2001 From: reuk Date: Thu, 10 Oct 2024 16:11:22 +0100 Subject: [PATCH] Direct2D: Reinstate multithreading support for D2D factory Partially reverts a change made in 362a1cc07034655d2ff3dee786b3c8a72ea1145e. The factory needs to be multithreading-enabled in order to support e.g. drawing to the screen on the main thread and drawing to an Image on a background thread, even when no resources other than the graphics device are shared between the two threads. --- modules/juce_graphics/native/juce_DirectX_windows.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/juce_graphics/native/juce_DirectX_windows.h b/modules/juce_graphics/native/juce_DirectX_windows.h index 7e1d91688f..2e911b9c59 100644 --- a/modules/juce_graphics/native/juce_DirectX_windows.h +++ b/modules/juce_graphics/native/juce_DirectX_windows.h @@ -269,7 +269,7 @@ private: options.debugLevel = D2D1_DEBUG_LEVEL_NONE; JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wlanguage-extension-token") ComSmartPtr result; - auto hr = D2D1CreateFactory (D2D1_FACTORY_TYPE_SINGLE_THREADED, + auto hr = D2D1CreateFactory (D2D1_FACTORY_TYPE_MULTI_THREADED, __uuidof (ID2D1Factory2), &options, (void**) result.resetAndGetPointerAddress());