test/testsprite2.c
changeset 3596 f638ded38b8a
parent 3560 5543db4239e6
child 3685 64ce267332c6
     1.1 --- a/test/testsprite2.c	Fri Dec 18 08:19:18 2009 +0000
     1.2 +++ b/test/testsprite2.c	Wed Dec 23 01:55:00 2009 +0000
     1.3 @@ -139,21 +139,21 @@
     1.4  
     1.5      /* Draw a gray background */
     1.6      SDL_SetRenderDrawColor(0xA0, 0xA0, 0xA0, 0xFF);
     1.7 -    SDL_RenderRect(NULL);
     1.8 +    SDL_RenderClear();
     1.9  
    1.10      /* Test points */
    1.11      SDL_SetRenderDrawColor(0xFF, 0x00, 0x00, 0xFF);
    1.12 -    SDL_RenderPoint(0, 0);
    1.13 -    SDL_RenderPoint(window_w-1, 0);
    1.14 -    SDL_RenderPoint(0, window_h-1);
    1.15 -    SDL_RenderPoint(window_w-1, window_h-1);
    1.16 +    SDL_RenderDrawPoint(0, 0);
    1.17 +    SDL_RenderDrawPoint(window_w-1, 0);
    1.18 +    SDL_RenderDrawPoint(0, window_h-1);
    1.19 +    SDL_RenderDrawPoint(window_w-1, window_h-1);
    1.20  
    1.21      /* Test horizontal and vertical lines */
    1.22      SDL_SetRenderDrawColor(0x00, 0xFF, 0x00, 0xFF);
    1.23 -    SDL_RenderLine(1, 0, window_w-2, 0);
    1.24 -    SDL_RenderLine(1, window_h-1, window_w-2, window_h-1);
    1.25 -    SDL_RenderLine(0, 1, 0, window_h-2);
    1.26 -    SDL_RenderLine(window_w-1, 1, window_w-1, window_h-2);
    1.27 +    SDL_RenderDrawLine(1, 0, window_w-2, 0);
    1.28 +    SDL_RenderDrawLine(1, window_h-1, window_w-2, window_h-1);
    1.29 +    SDL_RenderDrawLine(0, 1, 0, window_h-2);
    1.30 +    SDL_RenderDrawLine(window_w-1, 1, window_w-1, window_h-2);
    1.31  
    1.32      /* Test fill and copy */
    1.33      SDL_SetRenderDrawColor(0xFF, 0xFF, 0xFF, 0xFF);
    1.34 @@ -161,33 +161,33 @@
    1.35      temp.y = 1;
    1.36      temp.w = sprite_w;
    1.37      temp.h = sprite_h;
    1.38 -    SDL_RenderRect(&temp);
    1.39 +    SDL_RenderFillRect(&temp);
    1.40      SDL_RenderCopy(sprite, NULL, &temp);
    1.41      temp.x = window_w-sprite_w-1;
    1.42      temp.y = 1;
    1.43      temp.w = sprite_w;
    1.44      temp.h = sprite_h;
    1.45 -    SDL_RenderRect(&temp);
    1.46 +    SDL_RenderFillRect(&temp);
    1.47      SDL_RenderCopy(sprite, NULL, &temp);
    1.48      temp.x = 1;
    1.49      temp.y = window_h-sprite_h-1;
    1.50      temp.w = sprite_w;
    1.51      temp.h = sprite_h;
    1.52 -    SDL_RenderRect(&temp);
    1.53 +    SDL_RenderFillRect(&temp);
    1.54      SDL_RenderCopy(sprite, NULL, &temp);
    1.55      temp.x = window_w-sprite_w-1;
    1.56      temp.y = window_h-sprite_h-1;
    1.57      temp.w = sprite_w;
    1.58      temp.h = sprite_h;
    1.59 -    SDL_RenderRect(&temp);
    1.60 +    SDL_RenderFillRect(&temp);
    1.61      SDL_RenderCopy(sprite, NULL, &temp);
    1.62  
    1.63      /* Test diagonal lines */
    1.64      SDL_SetRenderDrawColor(0x00, 0xFF, 0x00, 0xFF);
    1.65 -    SDL_RenderLine(sprite_w, sprite_h,
    1.66 -                   window_w-sprite_w-2, window_h-sprite_h-2);
    1.67 -    SDL_RenderLine(window_w-sprite_w-2, sprite_h,
    1.68 -                   sprite_w, window_h-sprite_h-2);
    1.69 +    SDL_RenderDrawLine(sprite_w, sprite_h,
    1.70 +                       window_w-sprite_w-2, window_h-sprite_h-2);
    1.71 +    SDL_RenderDrawLine(window_w-sprite_w-2, sprite_h,
    1.72 +                       sprite_w, window_h-sprite_h-2);
    1.73  
    1.74      /* Move the sprite, bounce at the wall, and draw */
    1.75      n = 0;
    1.76 @@ -302,7 +302,7 @@
    1.77      for (i = 0; i < state->num_windows; ++i) {
    1.78          SDL_SelectRenderer(state->windows[i]);
    1.79          SDL_SetRenderDrawColor(0xA0, 0xA0, 0xA0, 0xFF);
    1.80 -        SDL_RenderRect(NULL);
    1.81 +        SDL_RenderClear();
    1.82      }
    1.83      if (LoadSprite("icon.bmp") < 0) {
    1.84          quit(2);
    1.85 @@ -348,7 +348,7 @@
    1.86                  case SDL_WINDOWEVENT_EXPOSED:
    1.87                      SDL_SelectRenderer(event.window.windowID);
    1.88                      SDL_SetRenderDrawColor(0xA0, 0xA0, 0xA0, 0xFF);
    1.89 -                    SDL_RenderRect(NULL);
    1.90 +                    SDL_RenderClear();
    1.91                      break;
    1.92                  }
    1.93                  break;