2017-11-29 16:23:33 +01:00
|
|
|
#include "d3d11_device.h"
|
|
|
|
#include "d3d11_present.h"
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
2018-10-23 15:10:01 +02:00
|
|
|
D3D11PresentDevice::D3D11PresentDevice(
|
2018-12-03 19:26:29 +01:00
|
|
|
D3D11DXGIDevice* pContainer,
|
|
|
|
D3D11Device* pDevice)
|
|
|
|
: m_container (pContainer),
|
|
|
|
m_device (pDevice) {
|
2018-03-28 21:24:52 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-10-23 15:10:01 +02:00
|
|
|
D3D11PresentDevice::~D3D11PresentDevice() {
|
2018-03-28 21:24:52 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-10-23 15:10:01 +02:00
|
|
|
ULONG STDMETHODCALLTYPE D3D11PresentDevice::AddRef() {
|
2018-03-28 21:24:52 +02:00
|
|
|
return m_container->AddRef();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-10-23 15:10:01 +02:00
|
|
|
ULONG STDMETHODCALLTYPE D3D11PresentDevice::Release() {
|
2018-03-28 21:24:52 +02:00
|
|
|
return m_container->Release();
|
|
|
|
}
|
2017-11-29 16:23:33 +01:00
|
|
|
|
|
|
|
|
2018-10-23 15:10:01 +02:00
|
|
|
HRESULT STDMETHODCALLTYPE D3D11PresentDevice::QueryInterface(REFIID riid, void** ppvObject) {
|
2018-03-28 21:24:52 +02:00
|
|
|
return m_container->QueryInterface(riid, ppvObject);
|
2017-11-29 16:23:33 +01:00
|
|
|
}
|
2018-10-22 22:42:28 +02:00
|
|
|
|
|
|
|
|
2018-10-23 15:10:01 +02:00
|
|
|
HRESULT STDMETHODCALLTYPE D3D11PresentDevice::CreateSwapChainForHwnd(
|
2018-10-22 22:42:28 +02:00
|
|
|
HWND hWnd,
|
|
|
|
const DXGI_SWAP_CHAIN_DESC1* pDesc,
|
|
|
|
IDXGIVkSwapChain** ppSwapChain) {
|
|
|
|
InitReturnPtr(ppSwapChain);
|
|
|
|
|
|
|
|
try {
|
|
|
|
*ppSwapChain = ref(new D3D11SwapChain(
|
2018-12-03 19:26:29 +01:00
|
|
|
m_container, m_device, hWnd, pDesc));
|
2018-10-22 22:42:28 +02:00
|
|
|
return S_OK;
|
|
|
|
} catch (const DxvkError& e) {
|
|
|
|
Logger::err(e.message());
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
}
|
2017-11-29 16:23:33 +01:00
|
|
|
|
|
|
|
}
|