2018-12-11 14:38:32 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <mutex>
|
|
|
|
#include <unordered_map>
|
|
|
|
|
2019-03-14 15:20:40 +01:00
|
|
|
#include "dxgi_interfaces.h"
|
2018-12-11 14:38:32 +01:00
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
|
|
|
class DxgiSwapChain;
|
|
|
|
|
2019-03-14 15:28:05 +01:00
|
|
|
class DxgiMonitorInfo : public IDXGIVkMonitorInfo {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
DxgiMonitorInfo(IUnknown* pParent);
|
|
|
|
|
|
|
|
~DxgiMonitorInfo();
|
|
|
|
|
|
|
|
ULONG STDMETHODCALLTYPE AddRef();
|
|
|
|
|
|
|
|
ULONG STDMETHODCALLTYPE Release();
|
|
|
|
|
|
|
|
HRESULT STDMETHODCALLTYPE QueryInterface(
|
|
|
|
REFIID riid,
|
|
|
|
void** ppvObject);
|
|
|
|
|
|
|
|
HRESULT STDMETHODCALLTYPE InitMonitorData(
|
|
|
|
HMONITOR hMonitor,
|
|
|
|
const DXGI_VK_MONITOR_DATA* pData);
|
|
|
|
|
|
|
|
HRESULT STDMETHODCALLTYPE AcquireMonitorData(
|
|
|
|
HMONITOR hMonitor,
|
|
|
|
DXGI_VK_MONITOR_DATA** ppData);
|
|
|
|
|
|
|
|
void STDMETHODCALLTYPE ReleaseMonitorData();
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
IUnknown* m_parent;
|
|
|
|
|
2021-06-28 19:19:29 +02:00
|
|
|
dxvk::mutex m_monitorMutex;
|
2019-03-14 15:28:05 +01:00
|
|
|
std::unordered_map<HMONITOR, DXGI_VK_MONITOR_DATA> m_monitorData;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-12-11 15:48:57 +01:00
|
|
|
/**
|
|
|
|
* \brief Queries bits per pixel for a format
|
|
|
|
*
|
|
|
|
* The format must be a valid swap chain format.
|
|
|
|
* \param [in] Format The DXGI format to query
|
|
|
|
* \returns Bits per pixel for this format
|
|
|
|
*/
|
|
|
|
uint32_t GetMonitorFormatBpp(
|
|
|
|
DXGI_FORMAT Format);
|
|
|
|
|
2018-12-11 14:38:32 +01:00
|
|
|
}
|