Have testspriteminimal use the new simple API
authorSam Lantinga <slouken@libsdl.org>
Sun, 22 Jan 2012 19:47:33 -0500
changeset 6259 4aef5b792087
parent 6258 fce7ce72677b
child 6260 fd494c5f305b
Have testspriteminimal use the new simple API
test/testspriteminimal.c
--- a/test/testspriteminimal.c	Sun Jan 22 19:22:53 2012 -0500
+++ b/test/testspriteminimal.c	Sun Jan 22 19:47:33 2012 -0500
@@ -47,7 +47,7 @@
     /* Load the sprite image */
     temp = SDL_LoadBMP(file);
     if (temp == NULL) {
-        fprintf(stderr, "Couldn't load %s: %s", file, SDL_GetError());
+        fprintf(stderr, "Couldn't load %s: %s\n", file, SDL_GetError());
         return (-1);
     }
     sprite_w = temp->w;
@@ -131,17 +131,7 @@
     int i, done;
     SDL_Event event;
 
-    window = SDL_CreateWindow("Happy Smileys",
-                              SDL_WINDOWPOS_UNDEFINED,
-                              SDL_WINDOWPOS_UNDEFINED,
-                              WINDOW_WIDTH, WINDOW_HEIGHT,
-                              SDL_WINDOW_SHOWN);
-    if (!window) {
-        quit(2);
-    }
-
-    renderer = SDL_CreateRenderer(window, -1, 0);
-    if (!renderer) {
+    if (SDL_CreateWindowAndRenderer(WINDOW_WIDTH, WINDOW_HEIGHT, 0, &window, &renderer) < 0) {
         quit(2);
     }