Examples: DX10, DX11: Disabled DXGI's Alt+Enter default behavior in examples. (#4350)

This commit is contained in:
David Maas
2025-09-25 17:35:35 +02:00
committed by ocornut
parent 15c88c4941
commit 3d937beb62
5 changed files with 31 additions and 0 deletions

View File

@@ -92,6 +92,9 @@ Docking+Viewports Branch:
viewports managed by the backend. (#4350) [@PathogenDavid]
- Backends: Vulkan: Added ImGui_ImplVulkanH_GetWindowDataFromViewport() accessor/helper.
(#8946, #8940) [@olivier-gerard]
- Examples: DX10, DX11: Disabled DXGI's Alt+Enter default behavior in examples.
Applications are free to leave this enabled, but it does not work properly with
multiple viewports. (#4350) [@PathogenDavid]
-----------------------------------------------------------------------

View File

@@ -256,6 +256,13 @@ bool CreateDeviceD3D(HWND hWnd)
if (res != S_OK)
return false;
// Disable DXGI's default Alt+Enter fullscreen behavior.
// - You are free to leave this enabled, but it will not work properly with multiple viewports.
// - This must be done for all windows associated to the device. Our DX11 backend does this automatically for secondary viewports that it creates.
IDXGIFactory* pSwapChainFactory;
if (SUCCEEDED(g_pSwapChain->GetParent(IID_PPV_ARGS(&pSwapChainFactory))))
pSwapChainFactory->MakeWindowAssociation(hWnd, DXGI_MWA_NO_ALT_ENTER);
CreateRenderTarget();
return true;
}

View File

@@ -251,6 +251,13 @@ bool CreateDeviceD3D(HWND hWnd)
if (res != S_OK)
return false;
// Disable DXGI's default Alt+Enter fullscreen behavior.
// - You are free to leave this enabled, but it will not work properly with multiple viewports.
// - This must be done for all windows associated to the device. Our DX11 backend does this automatically for secondary viewports that it creates.
IDXGIFactory* pSwapChainFactory;
if (SUCCEEDED(g_pSwapChain->GetParent(IID_PPV_ARGS(&pSwapChainFactory))))
pSwapChainFactory->MakeWindowAssociation(hWnd, DXGI_MWA_NO_ALT_ENTER);
CreateRenderTarget();
return true;
}

View File

@@ -241,6 +241,13 @@ bool CreateDeviceD3D(HWND hWnd)
if (res != S_OK)
return false;
// Disable DXGI's default Alt+Enter fullscreen behavior.
// - You are free to leave this enabled, but it will not work properly with multiple viewports.
// - This must be done for all windows associated to the device. Our DX11 backend does this automatically for secondary viewports that it creates.
IDXGIFactory* pSwapChainFactory;
if (SUCCEEDED(g_pSwapChain->GetParent(IID_PPV_ARGS(&pSwapChainFactory))))
pSwapChainFactory->MakeWindowAssociation(hWnd, DXGI_MWA_NO_ALT_ENTER);
CreateRenderTarget();
return true;
}

View File

@@ -245,6 +245,13 @@ bool CreateDeviceD3D(HWND hWnd)
if (res != S_OK)
return false;
// Disable DXGI's default Alt+Enter fullscreen behavior.
// - You are free to leave this enabled, but it will not work properly with multiple viewports.
// - This must be done for all windows associated to the device. Our DX11 backend does this automatically for secondary viewports that it creates.
IDXGIFactory* pSwapChainFactory;
if (SUCCEEDED(g_pSwapChain->GetParent(IID_PPV_ARGS(&pSwapChainFactory))))
pSwapChainFactory->MakeWindowAssociation(hWnd, DXGI_MWA_NO_ALT_ENTER);
CreateRenderTarget();
return true;
}