test/testsprite2.c
changeset 2884 9dde605c7540
parent 2834 feb6ccdb888f
child 3183 d1436442215f
     1.1 --- a/test/testsprite2.c	Sat Dec 20 08:41:05 2008 +0000
     1.2 +++ b/test/testsprite2.c	Sat Dec 20 12:00:00 2008 +0000
     1.3 @@ -20,7 +20,7 @@
     1.4  static SDL_Rect *positions;
     1.5  static SDL_Rect *velocities;
     1.6  static int sprite_w, sprite_h;
     1.7 -static SDL_TextureBlendMode blendMode = SDL_TEXTUREBLENDMODE_MASK;
     1.8 +static SDL_BlendMode blendMode = SDL_BLENDMODE_MASK;
     1.9  static SDL_TextureScaleMode scaleMode = SDL_TEXTURESCALEMODE_NONE;
    1.10  
    1.11  /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
    1.12 @@ -119,7 +119,8 @@
    1.13  
    1.14      /* Move the sprite, bounce at the wall, and draw */
    1.15      n = 0;
    1.16 -    SDL_RenderFill(0xA0, 0xA0, 0xA0, 0xFF, NULL);
    1.17 +    SDL_SetRenderDrawColor(0xA0, 0xA0, 0xA0, 0xFF);
    1.18 +    SDL_RenderFill(NULL);
    1.19      for (i = 0; i < num_sprites; ++i) {
    1.20          position = &positions[i];
    1.21          velocity = &velocities[i];
    1.22 @@ -166,19 +167,19 @@
    1.23              if (SDL_strcasecmp(argv[i], "--blend") == 0) {
    1.24                  if (argv[i + 1]) {
    1.25                      if (SDL_strcasecmp(argv[i + 1], "none") == 0) {
    1.26 -                        blendMode = SDL_TEXTUREBLENDMODE_NONE;
    1.27 +                        blendMode = SDL_BLENDMODE_NONE;
    1.28                          consumed = 2;
    1.29                      } else if (SDL_strcasecmp(argv[i + 1], "mask") == 0) {
    1.30 -                        blendMode = SDL_TEXTUREBLENDMODE_MASK;
    1.31 +                        blendMode = SDL_BLENDMODE_MASK;
    1.32                          consumed = 2;
    1.33                      } else if (SDL_strcasecmp(argv[i + 1], "blend") == 0) {
    1.34 -                        blendMode = SDL_TEXTUREBLENDMODE_BLEND;
    1.35 +                        blendMode = SDL_BLENDMODE_BLEND;
    1.36                          consumed = 2;
    1.37                      } else if (SDL_strcasecmp(argv[i + 1], "add") == 0) {
    1.38 -                        blendMode = SDL_TEXTUREBLENDMODE_ADD;
    1.39 +                        blendMode = SDL_BLENDMODE_ADD;
    1.40                          consumed = 2;
    1.41                      } else if (SDL_strcasecmp(argv[i + 1], "mod") == 0) {
    1.42 -                        blendMode = SDL_TEXTUREBLENDMODE_MOD;
    1.43 +                        blendMode = SDL_BLENDMODE_MOD;
    1.44                          consumed = 2;
    1.45                      }
    1.46                  }
    1.47 @@ -230,7 +231,8 @@
    1.48      }
    1.49      for (i = 0; i < state->num_windows; ++i) {
    1.50          SDL_SelectRenderer(state->windows[i]);
    1.51 -        SDL_RenderFill(0xA0, 0xA0, 0xA0, 0xFF, NULL);
    1.52 +        SDL_SetRenderDrawColor(0xA0, 0xA0, 0xA0, 0xFF);
    1.53 +        SDL_RenderFill(NULL);
    1.54      }
    1.55      if (LoadSprite("icon.bmp") < 0) {
    1.56          quit(2);
    1.57 @@ -275,7 +277,8 @@
    1.58                  switch (event.window.event) {
    1.59                  case SDL_WINDOWEVENT_EXPOSED:
    1.60                      SDL_SelectRenderer(event.window.windowID);
    1.61 -                    SDL_RenderFill(0xA0, 0xA0, 0xA0, 0xFF, NULL);
    1.62 +                    SDL_SetRenderDrawColor(0xA0, 0xA0, 0xA0, 0xFF);
    1.63 +                    SDL_RenderFill(NULL);
    1.64                      break;
    1.65                  }
    1.66                  break;