From bc8e75fdfa9eb0c967eb0cffe0919f7304c05eac Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Sun, 14 Aug 2022 17:08:27 +0000 Subject: [PATCH] [dxgi] Make adapter code use new wsi interface --- src/dxgi/dxgi_adapter.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/dxgi/dxgi_adapter.cpp b/src/dxgi/dxgi_adapter.cpp index 7c1de323e..df8c6b541 100644 --- a/src/dxgi/dxgi_adapter.cpp +++ b/src/dxgi/dxgi_adapter.cpp @@ -12,6 +12,8 @@ #include "../util/util_luid.h" +#include "../wsi/wsi_monitor.h" + namespace dxvk { DxgiVkAdapter::DxgiVkAdapter(DxgiAdapter* pAdapter) @@ -143,18 +145,12 @@ namespace dxvk { if (ppOutput == nullptr) return E_INVALIDARG; - MonitorEnumInfo info; - info.iMonitorId = Output; - info.oMonitor = nullptr; + HMONITOR monitor = wsi::enumMonitors(Output); - ::EnumDisplayMonitors( - nullptr, nullptr, &MonitorEnumProc, - reinterpret_cast(&info)); - - if (info.oMonitor == nullptr) + if (monitor == nullptr) return DXGI_ERROR_NOT_FOUND; - *ppOutput = ref(new DxgiOutput(m_factory, this, info.oMonitor)); + *ppOutput = ref(new DxgiOutput(m_factory, this, monitor)); return S_OK; }