mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +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))))
|
if (FAILED(m_presenter->GetAdapter(__uuidof(IDXGIAdapter), reinterpret_cast<void**>(&m_adapter))))
|
||||||
throw DxvkError("DXGI: Failed to get adapter for present device");
|
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
|
// Apply initial window mode and fullscreen state
|
||||||
if (!m_descFs.Windowed && FAILED(EnterFullscreenMode(nullptr)))
|
if (!m_descFs.Windowed && FAILED(EnterFullscreenMode(nullptr)))
|
||||||
throw DxvkError("DXGI: Failed to set initial fullscreen state");
|
throw DxvkError("DXGI: Failed to set initial fullscreen state");
|
||||||
@ -688,4 +691,19 @@ namespace dxvk {
|
|||||||
return DXGI_ERROR_NOT_FOUND;
|
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 <mutex>
|
||||||
|
|
||||||
#include "dxgi_interfaces.h"
|
#include "dxgi_interfaces.h"
|
||||||
|
#include "dxgi_monitor.h"
|
||||||
#include "dxgi_object.h"
|
#include "dxgi_object.h"
|
||||||
|
|
||||||
#include "../d3d11/d3d11_interfaces.h"
|
#include "../d3d11/d3d11_interfaces.h"
|
||||||
@ -172,6 +173,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
Com<IDXGIFactory> m_factory;
|
Com<IDXGIFactory> m_factory;
|
||||||
Com<IDXGIAdapter> m_adapter;
|
Com<IDXGIAdapter> m_adapter;
|
||||||
|
Com<IDXGIVkMonitorInfo> m_monitorInfo;
|
||||||
|
|
||||||
HWND m_window;
|
HWND m_window;
|
||||||
DXGI_SWAP_CHAIN_DESC1 m_desc;
|
DXGI_SWAP_CHAIN_DESC1 m_desc;
|
||||||
@ -203,6 +205,12 @@ namespace dxvk {
|
|||||||
HMONITOR Monitor,
|
HMONITOR Monitor,
|
||||||
IDXGIOutput** ppOutput);
|
IDXGIOutput** ppOutput);
|
||||||
|
|
||||||
|
HRESULT AcquireMonitorData(
|
||||||
|
HMONITOR hMonitor,
|
||||||
|
DXGI_VK_MONITOR_DATA** ppData);
|
||||||
|
|
||||||
|
void ReleaseMonitorData();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user