Fall back to opaque sprite if no formats with alpha are supported.
authorSam Lantinga <slouken@libsdl.org>
Sun, 20 Sep 2009 23:09:30 +0000
changeset 32850d7b20a4a629
parent 3284 2b95b2c0b6d4
child 3286 d390778b59c1
Fall back to opaque sprite if no formats with alpha are supported.
test/testsprite2.c
     1.1 --- a/test/testsprite2.c	Sun Sep 20 22:47:28 2009 +0000
     1.2 +++ b/test/testsprite2.c	Sun Sep 20 23:09:30 2009 +0000
     1.3 @@ -82,6 +82,10 @@
     1.4          SDL_SelectRenderer(state->windows[i]);
     1.5          sprites[i] = SDL_CreateTextureFromSurface(0, temp);
     1.6          if (!sprites[i]) {
     1.7 +		SDL_SetColorKey(temp, 0, 0);
     1.8 +		sprites[i] = SDL_CreateTextureFromSurface(0, temp);
     1.9 +	}
    1.10 +        if (!sprites[i]) {
    1.11              fprintf(stderr, "Couldn't create texture: %s\n", SDL_GetError());
    1.12              SDL_FreeSurface(temp);
    1.13              return (-1);