mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-20 19:54:19 +01:00
[dxgi] Use IDXGIVkMonitorInfo in DxgiSwapChain
This commit is contained in:
parent
50347e1256
commit
5b72e84726
@ -26,6 +26,9 @@ namespace dxvk {
|
||||
if (FAILED(m_presenter->GetAdapter(__uuidof(IDXGIAdapter), reinterpret_cast<void**>(&m_adapter))))
|
||||
throw DxvkError("DXGI: Failed to get adapter for present device");
|
||||
|
||||
// Query monitor info form DXVK's DXGI factory, if available
|
||||
m_factory->QueryInterface(__uuidof(IDXGIVkMonitorInfo), reinterpret_cast<void**>(&m_monitorInfo));
|
||||
|
||||
// Apply initial window mode and fullscreen state
|
||||
if (!m_descFs.Windowed && FAILED(EnterFullscreenMode(nullptr)))
|
||||
throw DxvkError("DXGI: Failed to set initial fullscreen state");
|
||||
@ -687,5 +690,20 @@ namespace dxvk {
|
||||
|
||||
return DXGI_ERROR_NOT_FOUND;
|
||||
}
|
||||
|
||||
|
||||
HRESULT DxgiSwapChain::AcquireMonitorData(
|
||||
HMONITOR hMonitor,
|
||||
DXGI_VK_MONITOR_DATA** ppData) {
|
||||
return m_monitorInfo != nullptr
|
||||
? m_monitorInfo->AcquireMonitorData(hMonitor, ppData)
|
||||
: E_NOINTERFACE;
|
||||
}
|
||||
|
||||
|
||||
void DxgiSwapChain::ReleaseMonitorData() {
|
||||
if (m_monitorInfo != nullptr)
|
||||
m_monitorInfo->ReleaseMonitorData();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <mutex>
|
||||
|
||||
#include "dxgi_interfaces.h"
|
||||
#include "dxgi_monitor.h"
|
||||
#include "dxgi_object.h"
|
||||
|
||||
#include "../d3d11/d3d11_interfaces.h"
|
||||
@ -172,6 +173,7 @@ namespace dxvk {
|
||||
|
||||
Com<IDXGIFactory> m_factory;
|
||||
Com<IDXGIAdapter> m_adapter;
|
||||
Com<IDXGIVkMonitorInfo> m_monitorInfo;
|
||||
|
||||
HWND m_window;
|
||||
DXGI_SWAP_CHAIN_DESC1 m_desc;
|
||||
@ -203,6 +205,12 @@ namespace dxvk {
|
||||
HMONITOR Monitor,
|
||||
IDXGIOutput** ppOutput);
|
||||
|
||||
HRESULT AcquireMonitorData(
|
||||
HMONITOR hMonitor,
|
||||
DXGI_VK_MONITOR_DATA** ppData);
|
||||
|
||||
void ReleaseMonitorData();
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user