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

Commit

Permalink
Browse files Browse the repository at this point in the history
Fall back to opaque sprite if no formats with alpha are supported.
  • Loading branch information
slouken committed Sep 20, 2009
1 parent 179d8fd commit a4991ec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/testsprite2.c
Expand Up @@ -81,6 +81,10 @@ LoadSprite(char *file)
for (i = 0; i < state->num_windows; ++i) {
SDL_SelectRenderer(state->windows[i]);
sprites[i] = SDL_CreateTextureFromSurface(0, temp);
if (!sprites[i]) {
SDL_SetColorKey(temp, 0, 0);
sprites[i] = SDL_CreateTextureFromSurface(0, temp);
}
if (!sprites[i]) {
fprintf(stderr, "Couldn't create texture: %s\n", SDL_GetError());
SDL_FreeSurface(temp);
Expand Down

0 comments on commit a4991ec

Please sign in to comment.