Prevent redraws till internal buffers are correctly setup
authorPatrice Mandin
Sat, 06 Nov 2004 08:56:23 +0000
changeset 964d9209754ebee
parent 963 92c247cec42d
child 965 b68e551205e9
Prevent redraws till internal buffers are correctly setup
src/video/gem/SDL_gemevents.c
src/video/gem/SDL_gemvideo.c
src/video/gem/SDL_gemvideo.h
     1.1 --- a/src/video/gem/SDL_gemevents.c	Sun Oct 31 13:15:33 2004 +0000
     1.2 +++ b/src/video/gem/SDL_gemevents.c	Sat Nov 06 08:56:23 2004 +0000
     1.3 @@ -210,7 +210,9 @@
     1.4  			SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
     1.5  			break;
     1.6  		case WM_REDRAW:
     1.7 -			GEM_wind_redraw(this, message[3],&message[4]);
     1.8 +			if (!GEM_lock_redraw) {
     1.9 +				GEM_wind_redraw(this, message[3],&message[4]);
    1.10 +			}
    1.11  			break;
    1.12  		case WM_ICONIFY:
    1.13  		case WM_ALLICONIFY:
    1.14 @@ -240,8 +242,9 @@
    1.15  			break;
    1.16  		case WM_SIZED:
    1.17  			wind_set (message[3], WF_CURRXYWH, message[4], message[5], message[6], message[7]);
    1.18 +			wind_get (message[3], WF_WORKXYWH, &x2, &y2, &w2, &h2);
    1.19  			GEM_win_fulled = SDL_FALSE;		/* Cancel maximized flag */
    1.20 -			wind_get (message[3], WF_WORKXYWH, &x2, &y2, &w2, &h2);
    1.21 +			GEM_lock_redraw = SDL_TRUE;		/* Prevent redraw till buffers resized */
    1.22  			SDL_PrivateResize(w2, h2);
    1.23  			break;
    1.24  		case WM_FULLED:
    1.25 @@ -260,6 +263,7 @@
    1.26  				}
    1.27  				wind_set (message[3], WF_CURRXYWH, x, y, w, h);
    1.28  				wind_get (message[3], WF_WORKXYWH, &x2, &y2, &w2, &h2);
    1.29 +				GEM_lock_redraw = SDL_TRUE;		/* Prevent redraw till buffers resized */
    1.30  				SDL_PrivateResize(w2, h2);
    1.31  			}
    1.32  			break;
     2.1 --- a/src/video/gem/SDL_gemvideo.c	Sun Oct 31 13:15:33 2004 +0000
     2.2 +++ b/src/video/gem/SDL_gemvideo.c	Sat Nov 06 08:56:23 2004 +0000
     2.3 @@ -401,6 +401,7 @@
     2.4  	GEM_locked = SDL_FALSE;
     2.5  	GEM_win_fulled = SDL_FALSE;
     2.6  	GEM_fullscreen = SDL_FALSE;
     2.7 +	GEM_lock_redraw = SDL_TRUE;	/* Prevent redraw till buffers are setup */
     2.8  
     2.9  	VDI_screen = NULL;
    2.10  	VDI_pitch = VDI_w * VDI_pixelsize;
    2.11 @@ -720,6 +721,7 @@
    2.12  #endif
    2.13  
    2.14  	this->UpdateRects = GEM_UpdateRects;
    2.15 +	GEM_lock_redraw = SDL_FALSE;	/* Enable redraw */
    2.16  
    2.17  	/* We're done */
    2.18  	return(current);
    2.19 @@ -858,6 +860,10 @@
    2.20  {
    2.21  	SDL_Surface *surface;
    2.22  
    2.23 +	if (GEM_lock_redraw) {
    2.24 +		return;
    2.25 +	}
    2.26 +
    2.27  	surface = this->screen;
    2.28  
    2.29  	if (surface->flags & SDL_FULLSCREEN) {
    2.30 @@ -951,6 +957,10 @@
    2.31  
    2.32  static int GEM_FlipHWSurface(_THIS, SDL_Surface *surface)
    2.33  {
    2.34 +	if (GEM_lock_redraw) {
    2.35 +		return(0);
    2.36 +	}
    2.37 +
    2.38  	if (surface->flags & SDL_FULLSCREEN) {
    2.39  		return GEM_FlipHWSurfaceFullscreen(this, surface);
    2.40  	} else {
     3.1 --- a/src/video/gem/SDL_gemvideo.h	Sun Oct 31 13:15:33 2004 +0000
     3.2 +++ b/src/video/gem/SDL_gemvideo.h	Sat Nov 06 08:56:23 2004 +0000
     3.3 @@ -79,6 +79,7 @@
     3.4  	SDL_bool window_fulled;		/* Window maximized ? */
     3.5  	SDL_bool mouse_relative;	/* Report relative mouse movement */
     3.6  	SDL_bool locked;			/* AES locked for fullscreen ? */
     3.7 +	SDL_bool lock_redraw;		/* Prevent redraw till buffers are setup */
     3.8  	short message[8];			/* To self-send an AES message */
     3.9  
    3.10  	SDL_bool fullscreen;		/* Fullscreen or windowed mode ? */
    3.11 @@ -120,6 +121,7 @@
    3.12  #define GEM_win_fulled		(this->hidden->window_fulled)
    3.13  #define GEM_mouse_relative	(this->hidden->mouse_relative)
    3.14  #define GEM_locked			(this->hidden->locked)
    3.15 +#define GEM_lock_redraw		(this->hidden->lock_redraw)
    3.16  #define GEM_message			(this->hidden->message)
    3.17  #define SDL_modelist		(this->hidden->SDL_modelist)
    3.18  #define GEM_icon			(this->hidden->icon)