diff test/testoverlay2.c @ 886:05c551e5bc64

Date: Sat, 24 Apr 2004 15:13:32 +0300 From: "Mike Gorchak" Subject: SDL updates for the QNX6 1. Updated the README.QNX 2. Updated libtool scripts, which are shipped with SDL for QNX6 support. 3. Added some code to support the new QNX 6.3.0, which is in beta now. 4. Added code to detect the hw features, which driver supports. 5. Added hw alpha blits code. 6. Fixed bug when application switches to fullscreen more the 2 times. (afte\ r that window becames always stay on top). 7. Updated a bit README for the tests. 8. Added information about acceleration show in the testalpha.c test. 9. Added small fixes to the testoverlay2.c test. 10. Added alpha and cc+alpha blits benchmarks to the testvidinfo.c test.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 06 May 2004 15:55:06 +0000
parents b14fdadd8311
children 6b8f0543337c
line wrap: on
line diff
--- a/test/testoverlay2.c	Fri Apr 30 18:33:30 2004 +0000
+++ b/test/testoverlay2.c	Thu May 06 15:55:06 2004 +0000
@@ -254,13 +254,15 @@
 static void PrintUsage(char *argv0)
 {
     fprintf(stderr, "Usage: %s [arg] [arg] [arg] ...\n", argv0);
-    fprintf(stderr, "Where 'arg' is one of:\n");
+    fprintf(stderr, "\n");
+    fprintf(stderr, "Where 'arg' is any of the following options:\n");
+    fprintf(stderr, "\n");
     fprintf(stderr, "	-fps <frames per second>\n");
     fprintf(stderr, "	-format <fmt> (one of the: YV12, IYUV, YUY2, UYVY, YVYU)\n");
     fprintf(stderr, "	-scale <scale factor> (initial scale of the overlay)\n");
     fprintf(stderr, "	-help (shows this help)\n");
     fprintf(stderr, "\n");
-    fprintf(stderr, "	Press ESC to exit, or SPACE to freeze the movie while application running.\n");
+    fprintf(stderr, "Press ESC to exit, or SPACE to freeze the movie while application running.\n");
     fprintf(stderr, "\n");
 }
 
@@ -466,6 +468,11 @@
     free(RawMooseData);
 
     overlay=SDL_CreateYUVOverlay(MOOSEPIC_W, MOOSEPIC_H, overlay_format, screen);
+    if (!overlay)
+    {
+        fprintf(stderr, "Couldn't create overlay: %s\n", SDL_GetError());
+        return 7;
+    }
 
     printf("Created %dx%dx%d %s %s overlay\n",overlay->w,overlay->h,overlay->planes,
            overlay->hw_overlay?"hardware":"software",