diff test/testalpha.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 609543e2b3a1
children be9c9c8f6d53
line wrap: on
line diff
--- a/test/testalpha.c	Fri Apr 30 18:33:30 2004 +0000
+++ b/test/testalpha.c	Thu May 06 15:55:06 2004 +0000
@@ -380,6 +380,37 @@
 		exit(1);
 	}
 
+	/* Print out information about our surfaces */
+	printf("Screen is at %d bits per pixel\n",screen->format->BitsPerPixel);
+	if ( (screen->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
+		printf("Screen is in video memory\n");
+	} else {
+		printf("Screen is in system memory\n");
+	}
+	if ( (screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
+		printf("Screen has double-buffering enabled\n");
+	}
+	if ( (sprite->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
+		printf("Sprite is in video memory\n");
+	} else {
+		printf("Sprite is in system memory\n");
+	}
+
+	/* Run a sample blit to trigger blit acceleration */
+	{ SDL_Rect dst;
+		dst.x = 0;
+		dst.y = 0;
+		dst.w = sprite->w;
+		dst.h = sprite->h;
+		SDL_BlitSurface(sprite, NULL, screen, &dst);
+		SDL_FillRect(screen, &dst, 0);
+	}
+	if ( (sprite->flags & SDL_HWACCEL) == SDL_HWACCEL ) {
+		printf("Sprite blit uses hardware alpha acceleration\n");
+	} else {
+		printf("Sprite blit dosn't uses hardware alpha acceleration\n");
+	}
+
 	/* Set a clipping rectangle to clip the outside edge of the screen */
 	{ SDL_Rect clip;
 		clip.x = 32;