test/testalpha.c
changeset 886 05c551e5bc64
parent 691 609543e2b3a1
child 1151 be9c9c8f6d53
equal deleted inserted replaced
885:9f6ad2286011 886:05c551e5bc64
   378 	if ( LoadSprite(screen, "icon.bmp") < 0 ) {
   378 	if ( LoadSprite(screen, "icon.bmp") < 0 ) {
   379 		SDL_FreeSurface(light);
   379 		SDL_FreeSurface(light);
   380 		exit(1);
   380 		exit(1);
   381 	}
   381 	}
   382 
   382 
       
   383 	/* Print out information about our surfaces */
       
   384 	printf("Screen is at %d bits per pixel\n",screen->format->BitsPerPixel);
       
   385 	if ( (screen->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
       
   386 		printf("Screen is in video memory\n");
       
   387 	} else {
       
   388 		printf("Screen is in system memory\n");
       
   389 	}
       
   390 	if ( (screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
       
   391 		printf("Screen has double-buffering enabled\n");
       
   392 	}
       
   393 	if ( (sprite->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
       
   394 		printf("Sprite is in video memory\n");
       
   395 	} else {
       
   396 		printf("Sprite is in system memory\n");
       
   397 	}
       
   398 
       
   399 	/* Run a sample blit to trigger blit acceleration */
       
   400 	{ SDL_Rect dst;
       
   401 		dst.x = 0;
       
   402 		dst.y = 0;
       
   403 		dst.w = sprite->w;
       
   404 		dst.h = sprite->h;
       
   405 		SDL_BlitSurface(sprite, NULL, screen, &dst);
       
   406 		SDL_FillRect(screen, &dst, 0);
       
   407 	}
       
   408 	if ( (sprite->flags & SDL_HWACCEL) == SDL_HWACCEL ) {
       
   409 		printf("Sprite blit uses hardware alpha acceleration\n");
       
   410 	} else {
       
   411 		printf("Sprite blit dosn't uses hardware alpha acceleration\n");
       
   412 	}
       
   413 
   383 	/* Set a clipping rectangle to clip the outside edge of the screen */
   414 	/* Set a clipping rectangle to clip the outside edge of the screen */
   384 	{ SDL_Rect clip;
   415 	{ SDL_Rect clip;
   385 		clip.x = 32;
   416 		clip.x = 32;
   386 		clip.y = 32;
   417 		clip.y = 32;
   387 		clip.w = screen->w-(2*32);
   418 		clip.w = screen->w-(2*32);