From 6848b45c7af5d3378162b0238900146a974ab1f6 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 16 Jul 2018 19:07:32 +0200 Subject: [PATCH] Revert "[dxgi] Support multiple outputs per adapter" This reverts commit 1c86ed8c93e0cca3006c7702012cb5db8e9ca860. Causes build issues on 32-bit platforms. --- src/dxgi/dxgi_adapter.cpp | 31 ++++++------------------------- src/dxgi/dxgi_adapter.h | 11 ----------- 2 files changed, 6 insertions(+), 36 deletions(-) diff --git a/src/dxgi/dxgi_adapter.cpp b/src/dxgi/dxgi_adapter.cpp index 5bb73aea4..24e4a18f7 100644 --- a/src/dxgi/dxgi_adapter.cpp +++ b/src/dxgi/dxgi_adapter.cpp @@ -81,18 +81,14 @@ namespace dxvk { if (ppOutput == nullptr) return DXGI_ERROR_INVALID_CALL; - MonitorEnumInfo info; - info.iMonitorId = Output; - info.oMonitor = nullptr; - - ::EnumDisplayMonitors( - nullptr, nullptr, &MonitorEnumProc, - reinterpret_cast(&info)); - - if (info.oMonitor == nullptr) + if (Output > 0) { + *ppOutput = nullptr; return DXGI_ERROR_NOT_FOUND; + } - *ppOutput = ref(new DxgiOutput(this, info.oMonitor)); + // TODO support multiple monitors + HMONITOR monitor = ::MonitorFromPoint({ 0, 0 }, MONITOR_DEFAULTTOPRIMARY); + *ppOutput = ref(new DxgiOutput(this, monitor)); return S_OK; } @@ -288,19 +284,4 @@ namespace dxvk { return S_OK; } - - BOOL DxgiAdapter::MonitorEnumProc( - HMONITOR hmon, - HDC hdc, - LPRECT rect, - LPARAM lp) { - auto data = reinterpret_cast(lp); - - if (data->iMonitorId--) - return TRUE; /* continue */ - - data->oMonitor = hmon; - return FALSE; /* stop */ - } - } diff --git a/src/dxgi/dxgi_adapter.h b/src/dxgi/dxgi_adapter.h index 78d2a1347..674a502f4 100644 --- a/src/dxgi/dxgi_adapter.h +++ b/src/dxgi/dxgi_adapter.h @@ -85,17 +85,6 @@ namespace dxvk { std::mutex m_outputMutex; OutputMap m_outputData; - struct MonitorEnumInfo { - UINT iMonitorId; - HMONITOR oMonitor; - }; - - static BOOL MonitorEnumProc( - HMONITOR hmon, - HDC hdc, - LPRECT rect, - LPARAM lp); - }; }