From 41913c02cd738edd703933d19cbc5c39b8786622 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 21 Aug 2022 20:08:05 +0300 Subject: [PATCH] Don't check D3D9 monitor names if Windows 10+ --- od-win32/win32gfx.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index 87371e87..b58026ea 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -926,17 +926,15 @@ void reenumeratemonitors(void) static void getd3dmonitornames (void) { - struct MultiDisplay *md = Displays; - IDirect3D9 *d3d; - int max; - // XP does not support hybrid displays, don't load Direct3D - if (!os_vista) + // Windows 10+ seems to use same names by default + if (!os_vista || os_win10) return; - d3d = Direct3DCreate9 (D3D_SDK_VERSION); + IDirect3D9 *d3d = Direct3DCreate9 (D3D_SDK_VERSION); if (!d3d) return; - max = d3d->GetAdapterCount (); + int max = d3d->GetAdapterCount (); + struct MultiDisplay* md = Displays; while (md - Displays < MAX_DISPLAYS && md->monitorid) { POINT pt; HMONITOR winmon; -- 2.47.3