Don't use the direct3d12 renderer with transparent windows

Fixes https://github.com/libsdl-org/SDL/issues/9024
main
Sam Lantinga 2024-02-08 09:24:11 -08:00
parent 26e947f8ea
commit 91639d855f
1 changed files with 6 additions and 0 deletions

View File

@ -3139,6 +3139,12 @@ SDL_Renderer *D3D12_CreateRenderer(SDL_Window *window, SDL_PropertiesID create_p
SDL_Renderer *renderer;
D3D12_RenderData *data;
if (SDL_GetWindowFlags(window) & SDL_WINDOW_TRANSPARENT) {
/* D3D12 removed the swap effect needed to support transparent windows, use D3D11 instead */
SDL_SetError("The direct3d12 renderer doesn't work with transparent windows");
return NULL;
}
renderer = (SDL_Renderer *)SDL_calloc(1, sizeof(*renderer));
if (!renderer) {
return NULL;