changeset 202:401f0134f4f9

Fixed crash when using double-buffering with DGA
author Sam Lantinga <slouken@libsdl.org>
date Sun, 30 Sep 2001 20:19:20 +0000
parents ddee60057806
children c6a0a7fe9a21
files src/video/dga/SDL_dgavideo.c
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/video/dga/SDL_dgavideo.c	Sun Sep 30 19:07:56 2001 +0000
+++ b/src/video/dga/SDL_dgavideo.c	Sun Sep 30 20:19:20 2001 +0000
@@ -531,7 +531,6 @@
 			flip_address[1] = memory_base+screen_len;
 			surfaces_mem += screen_len;
 			surfaces_len -= screen_len;
-			DGA_FlipHWSurface(this, current);
 		}
 	}
 
@@ -542,6 +541,13 @@
 	}
 	DGA_InitHWSurfaces(this, current, surfaces_mem, surfaces_len);
 
+	/* Expose the back buffer as surface memory */
+	if ( current->flags & SDL_DOUBLEBUF ) {
+		this->screen = current;
+		DGA_FlipHWSurface(this, current);
+		this->screen = NULL;
+	}
+
 	/* Set the update rectangle function */
 	this->UpdateRects = DGA_DirectUpdate;