Skip to content
Permalink
Browse files

Prevent redraws till internal buffers are correctly setup

  • Loading branch information
pmandin committed Nov 6, 2004
1 parent 9d76ae5 commit 3ea68bfa32fdbf95799df5f82dda6db6981038ba
Showing with 18 additions and 2 deletions.
  1. +6 −2 src/video/gem/SDL_gemevents.c
  2. +10 −0 src/video/gem/SDL_gemvideo.c
  3. +2 −0 src/video/gem/SDL_gemvideo.h
@@ -210,7 +210,9 @@ static int do_messages(_THIS, short *message)
SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
break;
case WM_REDRAW:
GEM_wind_redraw(this, message[3],&message[4]);
if (!GEM_lock_redraw) {
GEM_wind_redraw(this, message[3],&message[4]);
}
break;
case WM_ICONIFY:
case WM_ALLICONIFY:
@@ -240,8 +242,9 @@ static int do_messages(_THIS, short *message)
break;
case WM_SIZED:
wind_set (message[3], WF_CURRXYWH, message[4], message[5], message[6], message[7]);
GEM_win_fulled = SDL_FALSE; /* Cancel maximized flag */
wind_get (message[3], WF_WORKXYWH, &x2, &y2, &w2, &h2);
GEM_win_fulled = SDL_FALSE; /* Cancel maximized flag */
GEM_lock_redraw = SDL_TRUE; /* Prevent redraw till buffers resized */
SDL_PrivateResize(w2, h2);
break;
case WM_FULLED:
@@ -260,6 +263,7 @@ static int do_messages(_THIS, short *message)
}
wind_set (message[3], WF_CURRXYWH, x, y, w, h);
wind_get (message[3], WF_WORKXYWH, &x2, &y2, &w2, &h2);
GEM_lock_redraw = SDL_TRUE; /* Prevent redraw till buffers resized */
SDL_PrivateResize(w2, h2);
}
break;
@@ -401,6 +401,7 @@ int GEM_VideoInit(_THIS, SDL_PixelFormat *vformat)
GEM_locked = SDL_FALSE;
GEM_win_fulled = SDL_FALSE;
GEM_fullscreen = SDL_FALSE;
GEM_lock_redraw = SDL_TRUE; /* Prevent redraw till buffers are setup */

VDI_screen = NULL;
VDI_pitch = VDI_w * VDI_pixelsize;
@@ -720,6 +721,7 @@ SDL_Surface *GEM_SetVideoMode(_THIS, SDL_Surface *current,
#endif

this->UpdateRects = GEM_UpdateRects;
GEM_lock_redraw = SDL_FALSE; /* Enable redraw */

/* We're done */
return(current);
@@ -858,6 +860,10 @@ static void GEM_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
{
SDL_Surface *surface;

if (GEM_lock_redraw) {
return;
}

surface = this->screen;

if (surface->flags & SDL_FULLSCREEN) {
@@ -951,6 +957,10 @@ static int GEM_FlipHWSurfaceWindowed(_THIS, SDL_Surface *surface)

static int GEM_FlipHWSurface(_THIS, SDL_Surface *surface)
{
if (GEM_lock_redraw) {
return(0);
}

if (surface->flags & SDL_FULLSCREEN) {
return GEM_FlipHWSurfaceFullscreen(this, surface);
} else {
@@ -79,6 +79,7 @@ struct SDL_PrivateVideoData {
SDL_bool window_fulled; /* Window maximized ? */
SDL_bool mouse_relative; /* Report relative mouse movement */
SDL_bool locked; /* AES locked for fullscreen ? */
SDL_bool lock_redraw; /* Prevent redraw till buffers are setup */
short message[8]; /* To self-send an AES message */

SDL_bool fullscreen; /* Fullscreen or windowed mode ? */
@@ -120,6 +121,7 @@ struct SDL_PrivateVideoData {
#define GEM_win_fulled (this->hidden->window_fulled)
#define GEM_mouse_relative (this->hidden->mouse_relative)
#define GEM_locked (this->hidden->locked)
#define GEM_lock_redraw (this->hidden->lock_redraw)
#define GEM_message (this->hidden->message)
#define SDL_modelist (this->hidden->SDL_modelist)
#define GEM_icon (this->hidden->icon)

0 comments on commit 3ea68bf

Please sign in to comment.