From 48fbe4172b682ca319316a1f129f622e240ebad7 Mon Sep 17 00:00:00 2001 From: "Hunt J. Sparra" <19802403+HuntJSparra@users.noreply.github.com> Date: Tue, 5 Nov 2024 14:21:44 -0500 Subject: Register Engine, OS, ProjectSettings, and Time early. --- platform/windows/os_windows.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'platform/windows') diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index a25b7ea4ca..ca6fc2111b 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1540,7 +1540,8 @@ DWRITE_FONT_STRETCH OS_Windows::_stretch_to_dw(int p_stretch) const { } Vector OS_Windows::get_system_font_path_for_text(const String &p_font_name, const String &p_text, const String &p_locale, const String &p_script, int p_weight, int p_stretch, bool p_italic) const { - if (!dwrite2_init) { + // This may be called before TextServerManager has been created, which would cause a crash downstream if we do not check here + if (!dwrite2_init || !TextServerManager::get_singleton()) { return Vector(); } -- cgit v1.2.3 From a8cd0e9677011c989a0aae8da5888805db83d620 Mon Sep 17 00:00:00 2001 From: 0x0ACB <11277588+0x0ACB@users.noreply.github.com> Date: Mon, 18 Nov 2024 11:35:55 +0100 Subject: Use direct composition for d3d12 backend --- platform/windows/display_server_windows.cpp | 4 ++++ platform/windows/display_server_windows.h | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'platform/windows') diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index 467873ee7c..d0c7413731 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -2167,6 +2167,10 @@ void DisplayServerWindows::_get_window_style(bool p_main_window, bool p_initiali r_style |= WS_CLIPCHILDREN | WS_CLIPSIBLINGS; r_style_ex |= WS_EX_ACCEPTFILES; + + if (OS::get_singleton()->get_current_rendering_driver_name() == "d3d12") { + r_style_ex |= WS_EX_NOREDIRECTIONBITMAP; + } } void DisplayServerWindows::_update_window_style(WindowID p_window, bool p_repaint) { diff --git a/platform/windows/display_server_windows.h b/platform/windows/display_server_windows.h index 0462d3f8fa..62d2cc560f 100644 --- a/platform/windows/display_server_windows.h +++ b/platform/windows/display_server_windows.h @@ -357,6 +357,10 @@ typedef enum _SHC_PROCESS_DPI_AWARENESS { SHC_PROCESS_PER_MONITOR_DPI_AWARE = 2, } SHC_PROCESS_DPI_AWARENESS; +#ifndef WS_EX_NOREDIRECTIONBITMAP +#define WS_EX_NOREDIRECTIONBITMAP 0x00200000L +#endif + class DropTargetWindows; class DisplayServerWindows : public DisplayServer { -- cgit v1.2.3