Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Set blend mode for textures that were created from surfaces with a co…
Browse files Browse the repository at this point in the history
…lorkey
  • Loading branch information
slouken committed Jan 12, 2011
1 parent 6474ba4 commit c2021a1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/video/SDL_video.c
Expand Up @@ -1988,8 +1988,13 @@ SDL_CreateTextureFromSurface(Uint32 format, SDL_Surface * surface)
SDL_GetSurfaceAlphaMod(surface, &a);
SDL_SetTextureAlphaMod(texture, a);

SDL_GetSurfaceBlendMode(surface, &blendMode);
SDL_SetTextureBlendMode(texture, blendMode);
if (surface->map->info.flags & SDL_COPY_COLORKEY) {
/* We converted to a texture with alpha format */
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
} else {
SDL_GetSurfaceBlendMode(surface, &blendMode);
SDL_SetTextureBlendMode(texture, blendMode);
}

SDL_GetSurfaceScaleMode(surface, &scaleMode);
SDL_SetTextureScaleMode(texture, scaleMode);
Expand Down

0 comments on commit c2021a1

Please sign in to comment.