comparison src/video/gem/SDL_gemvideo.c @ 964:d9209754ebee

Prevent redraws till internal buffers are correctly setup
author Patrice Mandin <patmandin@gmail.com>
date Sat, 06 Nov 2004 08:56:23 +0000
parents 51ec8fc8bedb
children 44fd54a0ae5f
comparison
equal deleted inserted replaced
963:92c247cec42d 964:d9209754ebee
399 399
400 GEM_handle = -1; 400 GEM_handle = -1;
401 GEM_locked = SDL_FALSE; 401 GEM_locked = SDL_FALSE;
402 GEM_win_fulled = SDL_FALSE; 402 GEM_win_fulled = SDL_FALSE;
403 GEM_fullscreen = SDL_FALSE; 403 GEM_fullscreen = SDL_FALSE;
404 GEM_lock_redraw = SDL_TRUE; /* Prevent redraw till buffers are setup */
404 405
405 VDI_screen = NULL; 406 VDI_screen = NULL;
406 VDI_pitch = VDI_w * VDI_pixelsize; 407 VDI_pitch = VDI_w * VDI_pixelsize;
407 VDI_format = ( (VDI_bpp <= 8) ? VDI_FORMAT_INTER : VDI_FORMAT_PACK); 408 VDI_format = ( (VDI_bpp <= 8) ? VDI_FORMAT_INTER : VDI_FORMAT_PACK);
408 VDI_redmask = VDI_greenmask = VDI_bluemask = VDI_alphamask = 0; 409 VDI_redmask = VDI_greenmask = VDI_bluemask = VDI_alphamask = 0;
718 #ifdef DEBUG_VIDEO_GEM 719 #ifdef DEBUG_VIDEO_GEM
719 printf("sdl:video:gem: surface: %dx%d\n", current->w, current->h); 720 printf("sdl:video:gem: surface: %dx%d\n", current->w, current->h);
720 #endif 721 #endif
721 722
722 this->UpdateRects = GEM_UpdateRects; 723 this->UpdateRects = GEM_UpdateRects;
724 GEM_lock_redraw = SDL_FALSE; /* Enable redraw */
723 725
724 /* We're done */ 726 /* We're done */
725 return(current); 727 return(current);
726 } 728 }
727 729
855 } 857 }
856 858
857 static void GEM_UpdateRects(_THIS, int numrects, SDL_Rect *rects) 859 static void GEM_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
858 { 860 {
859 SDL_Surface *surface; 861 SDL_Surface *surface;
862
863 if (GEM_lock_redraw) {
864 return;
865 }
860 866
861 surface = this->screen; 867 surface = this->screen;
862 868
863 if (surface->flags & SDL_FULLSCREEN) { 869 if (surface->flags & SDL_FULLSCREEN) {
864 GEM_UpdateRectsFullscreen(this, numrects, rects); 870 GEM_UpdateRectsFullscreen(this, numrects, rects);
949 return(0); 955 return(0);
950 } 956 }
951 957
952 static int GEM_FlipHWSurface(_THIS, SDL_Surface *surface) 958 static int GEM_FlipHWSurface(_THIS, SDL_Surface *surface)
953 { 959 {
960 if (GEM_lock_redraw) {
961 return(0);
962 }
963
954 if (surface->flags & SDL_FULLSCREEN) { 964 if (surface->flags & SDL_FULLSCREEN) {
955 return GEM_FlipHWSurfaceFullscreen(this, surface); 965 return GEM_FlipHWSurfaceFullscreen(this, surface);
956 } else { 966 } else {
957 return GEM_FlipHWSurfaceWindowed(this, surface); 967 return GEM_FlipHWSurfaceWindowed(this, surface);
958 } 968 }