Fixed iPhone demos
authorSam Lantinga <slouken@libsdl.org>
Tue, 17 Mar 2009 03:56:21 +0000
changeset 3093375ee92745e8
parent 3092 cad1aefa2ed9
child 3094 c0ce3380742d
Fixed iPhone demos
XCodeiPhoneOS/Demos/src/happy.c
XCodeiPhoneOS/Demos/src/keyboard.c
XCodeiPhoneOS/Demos/src/mixer.c
XCodeiPhoneOS/Demos/src/rectangles.c
XCodeiPhoneOS/Demos/src/touch.c
     1.1 --- a/XCodeiPhoneOS/Demos/src/happy.c	Tue Mar 17 03:24:22 2009 +0000
     1.2 +++ b/XCodeiPhoneOS/Demos/src/happy.c	Tue Mar 17 03:56:21 2009 +0000
     1.3 @@ -58,7 +58,8 @@
     1.4      dstRect.h = HAPPY_FACE_SIZE;
     1.5  
     1.6      /* fill background in with black */
     1.7 -    SDL_RenderFill(0, 0, 0, 255, NULL);
     1.8 +    SDL_SetRenderDrawColor(0, 0, 0, 255);
     1.9 +    SDL_RenderFill(NULL);
    1.10  
    1.11      /*
    1.12         loop through all the happy faces:
     2.1 --- a/XCodeiPhoneOS/Demos/src/keyboard.c	Tue Mar 17 03:24:22 2009 +0000
     2.2 +++ b/XCodeiPhoneOS/Demos/src/keyboard.c	Tue Mar 17 03:56:21 2009 +0000
     2.3 @@ -174,8 +174,8 @@
     2.4  drawBlank(int x, int y)
     2.5  {
     2.6      SDL_Rect rect = { x, y, GLYPH_SIZE_SCREEN, GLYPH_SIZE_SCREEN };
     2.7 -    SDL_RenderFill(bg_color.r, bg_color.g, bg_color.b, bg_color.unused,
     2.8 -                   &rect);
     2.9 +    SDL_SetRenderDrawColor(bg_color.r, bg_color.g, bg_color.b, bg_color.unused);
    2.10 +    SDL_RenderFill(&rect);
    2.11  }
    2.12  
    2.13  /* moves backwards one character, erasing the last one put down */
    2.14 @@ -254,7 +254,8 @@
    2.15      loadFont();
    2.16  
    2.17      /* draw the background, we'll just paint over it */
    2.18 -    SDL_RenderFill(bg_color.r, bg_color.g, bg_color.b, bg_color.unused, NULL);
    2.19 +    SDL_SetRenderDrawColor(bg_color.r, bg_color.g, bg_color.b, bg_color.unused);
    2.20 +    SDL_RenderFill(NULL);
    2.21      SDL_RenderPresent();
    2.22  
    2.23      int done = 0;
     3.1 --- a/XCodeiPhoneOS/Demos/src/mixer.c	Tue Mar 17 03:24:22 2009 +0000
     3.2 +++ b/XCodeiPhoneOS/Demos/src/mixer.c	Tue Mar 17 03:56:21 2009 +0000
     3.3 @@ -167,13 +167,14 @@
     3.4  render(void)
     3.5  {
     3.6      int i;
     3.7 -    SDL_RenderFill(50, 50, 50, 255, NULL);      /* draw background (gray) */
     3.8 +    SDL_SetRenderDrawColor(50, 50, 50, 255);
     3.9 +    SDL_RenderFill(NULL);      /* draw background (gray) */
    3.10      /* draw the drum buttons */
    3.11      for (i = 0; i < NUM_DRUMS; i++) {
    3.12          SDL_Color color =
    3.13              buttons[i].isPressed ? buttons[i].downColor : buttons[i].upColor;
    3.14 -        SDL_RenderFill(color.r, color.g, color.b, color.unused,
    3.15 -                       &buttons[i].rect);
    3.16 +        SDL_SetRenderDrawColor(color.r, color.g, color.b, color.unused);
    3.17 +        SDL_RenderFill(&buttons[i].rect);
    3.18      }
    3.19      /* update the screen */
    3.20      SDL_RenderPresent();
     4.1 --- a/XCodeiPhoneOS/Demos/src/rectangles.c	Tue Mar 17 03:24:22 2009 +0000
     4.2 +++ b/XCodeiPhoneOS/Demos/src/rectangles.c	Tue Mar 17 03:56:21 2009 +0000
     4.3 @@ -26,7 +26,8 @@
     4.4      b = randomInt(50, 255);
     4.5  
     4.6      /*  Fill the rectangle in the color */
     4.7 -    SDL_RenderFill(r, g, b, 255, &rect);
     4.8 +    SDL_SetRenderDrawColor(r, g, b, 255);
     4.9 +    SDL_RenderFill(&rect);
    4.10  
    4.11      /* update screen */
    4.12      SDL_RenderPresent();
    4.13 @@ -61,7 +62,8 @@
    4.14      }
    4.15  
    4.16      /* Fill screen with black */
    4.17 -    SDL_RenderFill(0, 0, 0, 0, NULL);
    4.18 +    SDL_SetRenderDrawColor(0, 0, 0, 255);
    4.19 +    SDL_RenderFill(NULL);
    4.20  
    4.21      /* Enter render loop, waiting for user to quit */
    4.22      done = 0;
     5.1 --- a/XCodeiPhoneOS/Demos/src/touch.c	Tue Mar 17 03:24:22 2009 +0000
     5.2 +++ b/XCodeiPhoneOS/Demos/src/touch.c	Tue Mar 17 03:56:21 2009 +0000
     5.3 @@ -95,7 +95,8 @@
     5.4      initializeTexture();
     5.5  
     5.6      /* fill canvass initially with all black */
     5.7 -    SDL_RenderFill(0, 0, 0, 255, NULL);
     5.8 +    SDL_SetRenderDrawColor(0, 0, 0, 255);
     5.9 +    SDL_RenderFill(NULL);
    5.10      SDL_RenderPresent();
    5.11  
    5.12      done = 0;