Textures with alpha format default to SDL_BLENDMODE_BLEND

Fixes https://github.com/libsdl-org/SDL/issues/9941
This commit is contained in:
Sam Lantinga 2024-07-16 18:00:20 -07:00
parent 2db57e2678
commit 7c0307060d
3 changed files with 9 additions and 0 deletions

View file

@ -401,6 +401,12 @@ static void testBlendModeOperation(TestRenderOperation op, int mode, SDL_PixelFo
if (dst == NULL) {
return;
}
if (SDL_ISPIXELFORMAT_ALPHA(dst_format)) {
SDL_BlendMode blendMode = SDL_BLENDMODE_NONE;
ret = SDL_GetTextureBlendMode(dst, &blendMode);
SDLTest_AssertCheck(ret == 0, "Verify result from SDL_GetTextureBlendMode(), expected: 0, got: %i", ret);
SDLTest_AssertCheck(blendMode == SDL_BLENDMODE_BLEND, "Verify alpha texture blend mode, expected %d, got %" SDL_PRIu32, SDL_BLENDMODE_BLEND, blendMode);
}
/* Set as render target */
SDL_SetRenderTarget(renderer, dst);