D3D1x: Disable window changes on all windows.

This commit is contained in:
Branimir Karadžić
2018-10-24 17:49:13 -07:00
parent 95d0abdeb5
commit e3d80a2381
2 changed files with 20 additions and 4 deletions

View File

@@ -4592,6 +4592,15 @@ namespace bgfx { namespace d3d11
);
BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Failed to create swap chain.");
#if BX_PLATFORM_WINDOWS
DX_CHECK(s_renderD3D11->m_dxgi.m_factory->MakeWindowAssociation(
(HWND)_nwh
, 0
| DXGI_MWA_NO_WINDOW_CHANGES
| DXGI_MWA_NO_ALT_ENTER
) );
#endif // BX_PLATFORM_WINDOWS
ID3D11Resource* ptr;
DX_CHECK(m_swapChain->GetBuffer(0, IID_ID3D11Texture2D, (void**)&ptr) );
DX_CHECK(device->CreateRenderTargetView(ptr, NULL, &m_rtv[0]) );

View File

@@ -4949,13 +4949,20 @@ namespace bgfx { namespace d3d12
HRESULT hr;
hr = s_renderD3D12->m_dxgi.createSwapChain(
s_renderD3D12->getDeviceForSwapChain()
, scd
, &m_swapChain
);
s_renderD3D12->getDeviceForSwapChain()
, scd
, &m_swapChain
);
BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Failed to create swap chain.");
m_state = D3D12_RESOURCE_STATE_PRESENT;
DX_CHECK(s_renderD3D12->m_dxgi.m_factory->MakeWindowAssociation(
(HWND)_nwh
, 0
| DXGI_MWA_NO_WINDOW_CHANGES
| DXGI_MWA_NO_ALT_ENTER
) );
ID3D12Device* device = s_renderD3D12->m_device;
FrameBufferHandle fbh = { uint16_t(this - s_renderD3D12->m_frameBuffers) };