diff test/testsprite2.c @ 5161:b3ccd1947786

Simplified and improved the process of creating a texture from a surface.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 03 Feb 2011 00:54:29 -0800
parents ad50b3db78bd
children d976b67150c5
line wrap: on
line diff
--- a/test/testsprite2.c	Thu Feb 03 00:22:18 2011 -0800
+++ b/test/testsprite2.c	Thu Feb 03 00:54:29 2011 -0800
@@ -77,11 +77,7 @@
     /* Create textures from the image */
     for (i = 0; i < state->num_windows; ++i) {
         SDL_Renderer *renderer = state->renderers[i];
-        sprites[i] = SDL_CreateTextureFromSurface(renderer, 0, temp);
-        if (!sprites[i]) {
-            SDL_SetColorKey(temp, 0, 0);
-            sprites[i] = SDL_CreateTextureFromSurface(renderer, 0, temp);
-        }
+        sprites[i] = SDL_CreateTextureFromSurface(renderer, temp);
         if (!sprites[i]) {
             fprintf(stderr, "Couldn't create texture: %s\n", SDL_GetError());
             SDL_FreeSurface(temp);