fix texture blend mode, reenabling transparency

This commit is contained in:
Green Sky 2024-06-01 12:51:50 +02:00
parent 95eb0eb26d
commit fc5023ec1c
No known key found for this signature in database

View File

@ -31,6 +31,11 @@ uint64_t SDLRendererTextureUploader::uploadRGBA(const uint8_t* data, uint32_t wi
// TODO: error reporting // TODO: error reporting
SDL_UpdateTexture(tex, nullptr, surf->pixels, surf->pitch); SDL_UpdateTexture(tex, nullptr, surf->pixels, surf->pitch);
SDL_BlendMode surf_blend_mode = SDL_BLENDMODE_NONE;
if (SDL_GetSurfaceBlendMode(surf, &surf_blend_mode) == 0) {
SDL_SetTextureBlendMode(tex, surf_blend_mode);
}
if (filter == NEAREST) { if (filter == NEAREST) {
SDL_SetTextureScaleMode(tex, SDL_SCALEMODE_NEAREST); SDL_SetTextureScaleMode(tex, SDL_SCALEMODE_NEAREST);
} else if (filter == LINEAR) { } else if (filter == LINEAR) {