Add texture alpha blending

This commit is contained in:
2021-03-07 13:18:58 +01:00
parent fbc1fdd6f7
commit c7ec12584c
4 changed files with 19 additions and 1 deletions
+5
View File
@@ -73,4 +73,9 @@ void Texture::setTextureFromSurface( std::shared_ptr< Renderer > &renderer,
}
SDL_FreeSurface( surface );
}
void Texture::setAlpha( uint8_t alpha ) {
SDL_SetTextureBlendMode( texture, SDL_BLENDMODE_BLEND );
SDL_SetTextureAlphaMod( texture, alpha );
}
} // namespace SDLPP