mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-14 22:29:15 +01:00
[dxgi] Support multiple outputs per adapter
This commit is contained in:
parent
4ab5682260
commit
1c86ed8c93
@ -81,14 +81,18 @@ namespace dxvk {
|
|||||||
if (ppOutput == nullptr)
|
if (ppOutput == nullptr)
|
||||||
return DXGI_ERROR_INVALID_CALL;
|
return DXGI_ERROR_INVALID_CALL;
|
||||||
|
|
||||||
if (Output > 0) {
|
MonitorEnumInfo info;
|
||||||
*ppOutput = nullptr;
|
info.iMonitorId = Output;
|
||||||
return DXGI_ERROR_NOT_FOUND;
|
info.oMonitor = nullptr;
|
||||||
}
|
|
||||||
|
|
||||||
// TODO support multiple monitors
|
::EnumDisplayMonitors(
|
||||||
HMONITOR monitor = ::MonitorFromPoint({ 0, 0 }, MONITOR_DEFAULTTOPRIMARY);
|
nullptr, nullptr, &MonitorEnumProc,
|
||||||
*ppOutput = ref(new DxgiOutput(this, monitor));
|
reinterpret_cast<LPARAM>(&info));
|
||||||
|
|
||||||
|
if (info.oMonitor == nullptr)
|
||||||
|
return DXGI_ERROR_NOT_FOUND;
|
||||||
|
|
||||||
|
*ppOutput = ref(new DxgiOutput(this, info.oMonitor));
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,4 +288,19 @@ namespace dxvk {
|
|||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BOOL DxgiAdapter::MonitorEnumProc(
|
||||||
|
HMONITOR hmon,
|
||||||
|
HDC hdc,
|
||||||
|
LPRECT rect,
|
||||||
|
LPARAM lp) {
|
||||||
|
auto data = reinterpret_cast<MonitorEnumInfo*>(lp);
|
||||||
|
|
||||||
|
if (data->iMonitorId--)
|
||||||
|
return TRUE; /* continue */
|
||||||
|
|
||||||
|
data->oMonitor = hmon;
|
||||||
|
return FALSE; /* stop */
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -85,6 +85,17 @@ namespace dxvk {
|
|||||||
std::mutex m_outputMutex;
|
std::mutex m_outputMutex;
|
||||||
OutputMap m_outputData;
|
OutputMap m_outputData;
|
||||||
|
|
||||||
|
struct MonitorEnumInfo {
|
||||||
|
UINT iMonitorId;
|
||||||
|
HMONITOR oMonitor;
|
||||||
|
};
|
||||||
|
|
||||||
|
static BOOL MonitorEnumProc(
|
||||||
|
HMONITOR hmon,
|
||||||
|
HDC hdc,
|
||||||
|
LPRECT rect,
|
||||||
|
LPARAM lp);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user