From 299790fe68d8f554bdb989e6b8627772ee055db2 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 30 Sep 2001 20:19:20 +0000 Subject: [PATCH] Fixed crash when using double-buffering with DGA --- src/video/dga/SDL_dgavideo.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/video/dga/SDL_dgavideo.c b/src/video/dga/SDL_dgavideo.c index e0bf4a364..b845871ba 100644 --- a/src/video/dga/SDL_dgavideo.c +++ b/src/video/dga/SDL_dgavideo.c @@ -531,7 +531,6 @@ SDL_Surface *DGA_SetVideoMode(_THIS, SDL_Surface *current, flip_address[1] = memory_base+screen_len; surfaces_mem += screen_len; surfaces_len -= screen_len; - DGA_FlipHWSurface(this, current); } } @@ -542,6 +541,13 @@ SDL_Surface *DGA_SetVideoMode(_THIS, SDL_Surface *current, } 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;