test/testsprite2.c
changeset 11282 180e8906dc3c
parent 10737 3406a0f8b041
child 11811 5d94cb6b24d3
     1.1 --- a/test/testsprite2.c	Sun Aug 13 22:50:23 2017 -0700
     1.2 +++ b/test/testsprite2.c	Mon Aug 14 05:51:44 2017 -0700
     1.3 @@ -99,7 +99,12 @@
     1.4              SDL_FreeSurface(temp);
     1.5              return (-1);
     1.6          }
     1.7 -        SDL_SetTextureBlendMode(sprites[i], blendMode);
     1.8 +        if (SDL_SetTextureBlendMode(sprites[i], blendMode) < 0) {
     1.9 +            SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set blend mode: %s\n", SDL_GetError());
    1.10 +            SDL_FreeSurface(temp);
    1.11 +            SDL_DestroyTexture(sprites[i]);
    1.12 +            return (-1);
    1.13 +        }
    1.14      }
    1.15      SDL_FreeSurface(temp);
    1.16  
    1.17 @@ -295,6 +300,9 @@
    1.18                      } else if (SDL_strcasecmp(argv[i + 1], "mod") == 0) {
    1.19                          blendMode = SDL_BLENDMODE_MOD;
    1.20                          consumed = 2;
    1.21 +                    } else if (SDL_strcasecmp(argv[i + 1], "sub") == 0) {
    1.22 +                        blendMode = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_SRC_ALPHA, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_SUBTRACT, SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_SUBTRACT);
    1.23 +                        consumed = 2;
    1.24                      }
    1.25                  }
    1.26              } else if (SDL_strcasecmp(argv[i], "--iterations") == 0) {