From f9125ec1a45789ea95fa8f083338759091650086 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 17 Mar 2009 03:56:21 +0000 Subject: [PATCH] Fixed iPhone demos --- XCodeiPhoneOS/Demos/src/happy.c | 3 ++- XCodeiPhoneOS/Demos/src/keyboard.c | 7 ++++--- XCodeiPhoneOS/Demos/src/mixer.c | 7 ++++--- XCodeiPhoneOS/Demos/src/rectangles.c | 6 ++++-- XCodeiPhoneOS/Demos/src/touch.c | 3 ++- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/XCodeiPhoneOS/Demos/src/happy.c b/XCodeiPhoneOS/Demos/src/happy.c index 6bd4ba28a..a77629147 100644 --- a/XCodeiPhoneOS/Demos/src/happy.c +++ b/XCodeiPhoneOS/Demos/src/happy.c @@ -58,7 +58,8 @@ render(void) dstRect.h = HAPPY_FACE_SIZE; /* fill background in with black */ - SDL_RenderFill(0, 0, 0, 255, NULL); + SDL_SetRenderDrawColor(0, 0, 0, 255); + SDL_RenderFill(NULL); /* loop through all the happy faces: diff --git a/XCodeiPhoneOS/Demos/src/keyboard.c b/XCodeiPhoneOS/Demos/src/keyboard.c index 017485d99..3faf7cb59 100644 --- a/XCodeiPhoneOS/Demos/src/keyboard.c +++ b/XCodeiPhoneOS/Demos/src/keyboard.c @@ -174,8 +174,8 @@ void drawBlank(int x, int y) { SDL_Rect rect = { x, y, GLYPH_SIZE_SCREEN, GLYPH_SIZE_SCREEN }; - SDL_RenderFill(bg_color.r, bg_color.g, bg_color.b, bg_color.unused, - &rect); + SDL_SetRenderDrawColor(bg_color.r, bg_color.g, bg_color.b, bg_color.unused); + SDL_RenderFill(&rect); } /* moves backwards one character, erasing the last one put down */ @@ -254,7 +254,8 @@ main(int argc, char *argv[]) loadFont(); /* draw the background, we'll just paint over it */ - SDL_RenderFill(bg_color.r, bg_color.g, bg_color.b, bg_color.unused, NULL); + SDL_SetRenderDrawColor(bg_color.r, bg_color.g, bg_color.b, bg_color.unused); + SDL_RenderFill(NULL); SDL_RenderPresent(); int done = 0; diff --git a/XCodeiPhoneOS/Demos/src/mixer.c b/XCodeiPhoneOS/Demos/src/mixer.c index 13946bc22..c150da93f 100644 --- a/XCodeiPhoneOS/Demos/src/mixer.c +++ b/XCodeiPhoneOS/Demos/src/mixer.c @@ -167,13 +167,14 @@ void render(void) { int i; - SDL_RenderFill(50, 50, 50, 255, NULL); /* draw background (gray) */ + SDL_SetRenderDrawColor(50, 50, 50, 255); + SDL_RenderFill(NULL); /* draw background (gray) */ /* draw the drum buttons */ for (i = 0; i < NUM_DRUMS; i++) { SDL_Color color = buttons[i].isPressed ? buttons[i].downColor : buttons[i].upColor; - SDL_RenderFill(color.r, color.g, color.b, color.unused, - &buttons[i].rect); + SDL_SetRenderDrawColor(color.r, color.g, color.b, color.unused); + SDL_RenderFill(&buttons[i].rect); } /* update the screen */ SDL_RenderPresent(); diff --git a/XCodeiPhoneOS/Demos/src/rectangles.c b/XCodeiPhoneOS/Demos/src/rectangles.c index cec3bc15c..8ded25294 100644 --- a/XCodeiPhoneOS/Demos/src/rectangles.c +++ b/XCodeiPhoneOS/Demos/src/rectangles.c @@ -26,7 +26,8 @@ render(void) b = randomInt(50, 255); /* Fill the rectangle in the color */ - SDL_RenderFill(r, g, b, 255, &rect); + SDL_SetRenderDrawColor(r, g, b, 255); + SDL_RenderFill(&rect); /* update screen */ SDL_RenderPresent(); @@ -61,7 +62,8 @@ main(int argc, char *argv[]) } /* Fill screen with black */ - SDL_RenderFill(0, 0, 0, 0, NULL); + SDL_SetRenderDrawColor(0, 0, 0, 255); + SDL_RenderFill(NULL); /* Enter render loop, waiting for user to quit */ done = 0; diff --git a/XCodeiPhoneOS/Demos/src/touch.c b/XCodeiPhoneOS/Demos/src/touch.c index ab8ffa200..1103b84f9 100644 --- a/XCodeiPhoneOS/Demos/src/touch.c +++ b/XCodeiPhoneOS/Demos/src/touch.c @@ -95,7 +95,8 @@ main(int argc, char *argv[]) initializeTexture(); /* fill canvass initially with all black */ - SDL_RenderFill(0, 0, 0, 255, NULL); + SDL_SetRenderDrawColor(0, 0, 0, 255); + SDL_RenderFill(NULL); SDL_RenderPresent(); done = 0;