comparison src/video/windib/SDL_dibvideo.c @ 4099:822f9624f984 SDL-1.2

Brian Fisher fixed bug #513 If an app requests a 24-bit opengl mode on a machine with a 32-bit desktop with the windib video backend, then when exiting fullscreen the desktop resolution is not restored The reason this is, is because the windib backend restores the desktop resolution when exiting fullscreen in DIB_SetVideoMode when it finds that the last request was for fullscreen by checking the original flags on the video surface. However, if the bits per pixel requested is different than current surface, the video surface is recreated and the original video flags are lost. So the check to see if we were exiting fullscreen fails. below is a patch to SDL_dibvideo.c that solves the problem by using the original flags in all cases. thanks!
author Sam Lantinga <slouken@libsdl.org>
date Fri, 28 Dec 2007 08:00:30 +0000
parents 1859647893b8
children 31c7c57af8a4
comparison
equal deleted inserted replaced
4098:60fa95a89846 4099:822f9624f984
481 BITMAPINFO *binfo; 481 BITMAPINFO *binfo;
482 HDC hdc; 482 HDC hdc;
483 RECT bounds; 483 RECT bounds;
484 int x, y; 484 int x, y;
485 Uint32 Rmask, Gmask, Bmask; 485 Uint32 Rmask, Gmask, Bmask;
486
487 prev_flags = current->flags;
486 488
487 /* Clean up any GL context that may be hanging around */ 489 /* Clean up any GL context that may be hanging around */
488 if ( current->flags & SDL_OPENGL ) { 490 if ( current->flags & SDL_OPENGL ) {
489 WIN_GL_ShutDown(this); 491 WIN_GL_ShutDown(this);
490 } 492 }
529 return(NULL); 531 return(NULL);
530 } 532 }
531 } 533 }
532 534
533 /* Fill in part of the video surface */ 535 /* Fill in part of the video surface */
534 prev_flags = video->flags;
535 prev_w = video->w; 536 prev_w = video->w;
536 prev_h = video->h; 537 prev_h = video->h;
537 video->flags = 0; /* Clear flags */ 538 video->flags = 0; /* Clear flags */
538 video->w = width; 539 video->w = width;
539 video->h = height; 540 video->h = height;