Fixed crash when using double-buffering with DGA
authorSam Lantinga <slouken@libsdl.org>
Sun, 30 Sep 2001 20:19:20 +0000
changeset 202401f0134f4f9
parent 201 ddee60057806
child 203 c6a0a7fe9a21
Fixed crash when using double-buffering with DGA
src/video/dga/SDL_dgavideo.c
     1.1 --- a/src/video/dga/SDL_dgavideo.c	Sun Sep 30 19:07:56 2001 +0000
     1.2 +++ b/src/video/dga/SDL_dgavideo.c	Sun Sep 30 20:19:20 2001 +0000
     1.3 @@ -531,7 +531,6 @@
     1.4  			flip_address[1] = memory_base+screen_len;
     1.5  			surfaces_mem += screen_len;
     1.6  			surfaces_len -= screen_len;
     1.7 -			DGA_FlipHWSurface(this, current);
     1.8  		}
     1.9  	}
    1.10  
    1.11 @@ -542,6 +541,13 @@
    1.12  	}
    1.13  	DGA_InitHWSurfaces(this, current, surfaces_mem, surfaces_len);
    1.14  
    1.15 +	/* Expose the back buffer as surface memory */
    1.16 +	if ( current->flags & SDL_DOUBLEBUF ) {
    1.17 +		this->screen = current;
    1.18 +		DGA_FlipHWSurface(this, current);
    1.19 +		this->screen = NULL;
    1.20 +	}
    1.21 +
    1.22  	/* Set the update rectangle function */
    1.23  	this->UpdateRects = DGA_DirectUpdate;
    1.24