test/testgl.c
branchSDL-1.3
changeset 1654 0a53c90a37f9
parent 1439 4d3bb026cd16
child 1656 96c2f89cc7e1
     1.1 --- a/test/testgl.c	Thu Apr 27 05:19:10 2006 +0000
     1.2 +++ b/test/testgl.c	Thu Apr 27 05:30:05 2006 +0000
     1.3 @@ -15,12 +15,6 @@
     1.4  /* Define this to be the name of the logo image to use with -logo */
     1.5  #define LOGO_FILE	"icon.bmp"
     1.6  
     1.7 -/* The SDL_OPENGLBLIT interface is deprecated.
     1.8 -   The code is still available for benchmark purposes though.
     1.9 -*/
    1.10 -
    1.11 -static SDL_bool USE_DEPRECATED_OPENGLBLIT = SDL_FALSE;
    1.12 -
    1.13  static SDL_Surface *global_image = NULL;
    1.14  static GLuint global_texture = 0;
    1.15  static GLuint cursor_texture = 0;
    1.16 @@ -366,84 +360,6 @@
    1.17  	SDL_GL_Leave2DMode();
    1.18  }
    1.19  
    1.20 -/* This code is deprecated, but available for speed comparisons */
    1.21 -void DrawLogoBlit(void)
    1.22 -{
    1.23 -	static int x = 0;
    1.24 -	static int y = 0;
    1.25 -	static int w, h;
    1.26 -	static int delta_x = 1;
    1.27 -	static int delta_y = 1;
    1.28 -
    1.29 -	SDL_Rect dst;
    1.30 -	SDL_Surface *screen = SDL_GetVideoSurface();
    1.31 -
    1.32 -	if ( global_image == NULL ) {
    1.33 -		SDL_Surface *temp;
    1.34 -
    1.35 -		/* Load the image (could use SDL_image library here) */
    1.36 -		temp = SDL_LoadBMP(LOGO_FILE);
    1.37 -		if ( temp == NULL ) {
    1.38 -			return;
    1.39 -		}
    1.40 -		w = temp->w;
    1.41 -		h = temp->h;
    1.42 -
    1.43 -		/* Convert the image into the screen format */
    1.44 -		global_image = SDL_CreateRGBSurface(
    1.45 -				SDL_SWSURFACE,
    1.46 -				w, h,
    1.47 -				screen->format->BitsPerPixel,
    1.48 -				screen->format->Rmask,
    1.49 -				screen->format->Gmask,
    1.50 -				screen->format->Bmask,
    1.51 -				screen->format->Amask);
    1.52 -		if ( global_image ) {
    1.53 -			SDL_BlitSurface(temp, NULL, global_image, NULL);
    1.54 -		}
    1.55 -		SDL_FreeSurface(temp);
    1.56 -
    1.57 -		/* Make sure that the texture conversion is okay */
    1.58 -		if ( ! global_image ) {
    1.59 -			return;
    1.60 -		}
    1.61 -	}
    1.62 -
    1.63 -	/* Move the image around
    1.64 -           Note that we do not clear the old position.  This is because we
    1.65 -           perform a glClear() which clears the framebuffer and then only
    1.66 -           update the new area.
    1.67 -           Note that you can also achieve interesting effects by modifying
    1.68 -           the screen surface alpha channel.  It's set to 255 by default..
    1.69 -         */
    1.70 -	x += delta_x;
    1.71 -	if ( x < 0 ) {
    1.72 -		x = 0;
    1.73 -		delta_x = -delta_x;
    1.74 -	} else
    1.75 -	if ( (x+w) > screen->w ) {
    1.76 -		x = screen->w-w;
    1.77 -		delta_x = -delta_x;
    1.78 -	}
    1.79 -	y += delta_y;
    1.80 -	if ( y < 0 ) {
    1.81 -		y = 0;
    1.82 -		delta_y = -delta_y;
    1.83 -	} else
    1.84 -	if ( (y+h) > screen->h ) {
    1.85 -		y = screen->h-h;
    1.86 -		delta_y = -delta_y;
    1.87 -	}
    1.88 -	dst.x = x;
    1.89 -	dst.y = y;
    1.90 -	dst.w = w;
    1.91 -	dst.h = h;
    1.92 -	SDL_BlitSurface(global_image, NULL, screen, &dst);
    1.93 -
    1.94 -	/* Show the image on the screen */
    1.95 -	SDL_UpdateRects(screen, 1, &dst);
    1.96 -}
    1.97 -
    1.98  int RunGLTest( int argc, char* argv[],
    1.99                 int logo, int logocursor, int slowly, int bpp, float gamma, int noframe, int fsaa )
   1.100  {
   1.101 @@ -488,11 +404,7 @@
   1.102  	}
   1.103  
   1.104  	/* Set the flags we want to use for setting the video mode */
   1.105 -	if ( logo && USE_DEPRECATED_OPENGLBLIT ) {
   1.106 -		video_flags = SDL_OPENGLBLIT;
   1.107 -	} else {
   1.108 -		video_flags = SDL_OPENGL;
   1.109 -	}
   1.110 +	video_flags = SDL_OPENGL;
   1.111  	for ( i=1; argv[i]; ++i ) {
   1.112  		if ( strcmp(argv[i], "-fullscreen") == 0 ) {
   1.113  			video_flags |= SDL_FULLSCREEN;
   1.114 @@ -698,11 +610,7 @@
   1.115  
   1.116  		/* Draw 2D logo onto the 3D display */
   1.117  		if ( logo ) {
   1.118 -			if ( USE_DEPRECATED_OPENGLBLIT ) {
   1.119 -				DrawLogoBlit();
   1.120 -			} else {
   1.121 -				DrawLogoTexture();
   1.122 -			}
   1.123 +			DrawLogoTexture();
   1.124  		}
   1.125  		if ( logocursor ) {
   1.126  			DrawLogoCursor();
   1.127 @@ -780,11 +688,6 @@
   1.128  		}
   1.129  		if ( strcmp(argv[i], "-logo") == 0 ) {
   1.130  			logo = 1;
   1.131 -			USE_DEPRECATED_OPENGLBLIT = SDL_FALSE;
   1.132 -		}
   1.133 -		if ( strcmp(argv[i], "-logoblit") == 0 ) {
   1.134 -			logo = 1;
   1.135 -			USE_DEPRECATED_OPENGLBLIT = SDL_TRUE;
   1.136  		}
   1.137  		if ( strcmp(argv[i], "-logocursor") == 0 ) {
   1.138  			logocursor = 1;