test/testgl.c
changeset 320 66f815c147ed
parent 243 cf4944faad96
child 363 ca0b4ba5313e
equal deleted inserted replaced
319:189a6a3416c7 320:66f815c147ed
   391 	/* Show the image on the screen */
   391 	/* Show the image on the screen */
   392 	SDL_UpdateRects(screen, 1, &dst);
   392 	SDL_UpdateRects(screen, 1, &dst);
   393 }
   393 }
   394 
   394 
   395 int RunGLTest( int argc, char* argv[],
   395 int RunGLTest( int argc, char* argv[],
   396                int logo, int slowly, int bpp, float gamma )
   396                int logo, int slowly, int bpp, float gamma, int noframe )
   397 {
   397 {
   398 	int i;
   398 	int i;
   399 	int rgb_size[3];
   399 	int rgb_size[3];
   400 	int w = 640;
   400 	int w = 640;
   401 	int h = 480;
   401 	int h = 480;
   444 	for ( i=1; argv[i]; ++i ) {
   444 	for ( i=1; argv[i]; ++i ) {
   445 		if ( strcmp(argv[1], "-fullscreen") == 0 ) {
   445 		if ( strcmp(argv[1], "-fullscreen") == 0 ) {
   446 			video_flags |= SDL_FULLSCREEN;
   446 			video_flags |= SDL_FULLSCREEN;
   447 		}
   447 		}
   448 	}
   448 	}
       
   449 
       
   450         if (noframe) {
       
   451            video_flags |= SDL_NOFRAME;
       
   452         }
   449 
   453 
   450 	/* Initialize the display */
   454 	/* Initialize the display */
   451 	switch (bpp) {
   455 	switch (bpp) {
   452 	    case 8:
   456 	    case 8:
   453 		rgb_size[0] = 2;
   457 		rgb_size[0] = 2;
   684 	int i, logo;
   688 	int i, logo;
   685 	int numtests;
   689 	int numtests;
   686 	int bpp = 0;
   690 	int bpp = 0;
   687 	int slowly;
   691 	int slowly;
   688 	float gamma = 0.0;
   692 	float gamma = 0.0;
       
   693         int noframe = 0;
   689 
   694 
   690 	logo = 0;
   695 	logo = 0;
   691 	slowly = 0;
   696 	slowly = 0;
   692 	numtests = 1;
   697 	numtests = 1;
   693 	for ( i=1; argv[i]; ++i ) {
   698 	for ( i=1; argv[i]; ++i ) {
   709  		       bpp = atoi(argv[++i]);
   714  		       bpp = atoi(argv[++i]);
   710 		}
   715 		}
   711 		if ( strcmp(argv[i], "-gamma") == 0 ) {
   716 		if ( strcmp(argv[i], "-gamma") == 0 ) {
   712  		       gamma = (float)atof(argv[++i]);
   717  		       gamma = (float)atof(argv[++i]);
   713 		}
   718 		}
       
   719 		if ( strcmp(argv[i], "-noframe") == 0 ) {
       
   720  		       noframe = 1;
       
   721 		}
   714 		if ( strncmp(argv[i], "-h", 2) == 0 ) {
   722 		if ( strncmp(argv[i], "-h", 2) == 0 ) {
   715  		       printf(
   723  		       printf(
   716 "Usage: %s [-twice] [-logo] [-slow] [-bpp n] [-gamma n]\n",
   724 "Usage: %s [-twice] [-logo] [-slow] [-bpp n] [-gamma n] [-noframe]\n",
   717  			      argv[0]);
   725  			      argv[0]);
   718 			exit(0);
   726 			exit(0);
   719 		}
   727 		}
   720 	}
   728 	}
   721 	for ( i=0; i<numtests; ++i ) {
   729 	for ( i=0; i<numtests; ++i ) {
   722  	       RunGLTest(argc, argv, logo, slowly, bpp, gamma);
   730  	       RunGLTest(argc, argv, logo, slowly, bpp, gamma, noframe);
   723 	}
   731 	}
   724 	return 0;
   732 	return 0;
   725 }
   733 }
   726 
   734 
   727 #else /* HAVE_OPENGL */
   735 #else /* HAVE_OPENGL */