mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-15 02:37:52 +00:00
Enable transparent windows when using the D3D11 renderer
Note that this will not work with D3D12, as DXGI_SWAP_EFFECT_DISCARD is not available there.
This commit is contained in:
parent
1c64366b80
commit
924de4df48
1 changed files with 6 additions and 1 deletions
|
|
@ -786,7 +786,12 @@ static HRESULT D3D11_CreateSwapChain(SDL_Renderer *renderer, int w, int h)
|
|||
swapChainDesc.Scaling = DXGI_SCALING_STRETCH;
|
||||
}
|
||||
}
|
||||
swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; /* All Windows Store apps must use this SwapEffect. */
|
||||
if (SDL_GetWindowFlags(renderer->window) & SDL_WINDOW_TRANSPARENT) {
|
||||
swapChainDesc.Scaling = DXGI_SCALING_STRETCH;
|
||||
swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
|
||||
} else {
|
||||
swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; /* All Windows Store apps must use this SwapEffect. */
|
||||
}
|
||||
#endif
|
||||
swapChainDesc.Flags = 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue