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

@@ -1355,6 +1355,7 @@ SDL_Texture *SDL_CreateTextureWithProperties(SDL_Renderer *renderer, SDL_Propert
texture->color.g = 1.0f;
texture->color.b = 1.0f;
texture->color.a = 1.0f;
texture->blendMode = SDL_ISPIXELFORMAT_ALPHA(format) ? SDL_BLENDMODE_BLEND : SDL_BLENDMODE_NONE;
texture->scaleMode = SDL_SCALEMODE_LINEAR;
texture->view.pixel_w = w;
texture->view.pixel_h = h;