# HG changeset patch # User Sam Lantinga # Date 1297843908 28800 # Node ID cf3cd833dcd3c319583efb4f7fc92c45a70112e3 # Parent 75f5ff92ad08bc3bc4140c29cf106ac859cfc6be Fixed resetting the Direc3D renderer on mode change diff -r 75f5ff92ad08 -r cf3cd833dcd3 src/video/SDL_sysvideo.h --- a/src/video/SDL_sysvideo.h Tue Feb 15 23:07:14 2011 -0800 +++ b/src/video/SDL_sysvideo.h Wed Feb 16 00:11:48 2011 -0800 @@ -180,7 +180,6 @@ void (*MaximizeWindow) (_THIS, SDL_Window * window); void (*MinimizeWindow) (_THIS, SDL_Window * window); void (*RestoreWindow) (_THIS, SDL_Window * window); - void (*PrepWindowFullscreen) (_THIS, SDL_Window * window); void (*SetWindowFullscreen) (_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen); void (*SetWindowGrab) (_THIS, SDL_Window * window); void (*DestroyWindow) (_THIS, SDL_Window * window); diff -r 75f5ff92ad08 -r cf3cd833dcd3 src/video/SDL_video.c --- a/src/video/SDL_video.c Tue Feb 15 23:07:14 2011 -0800 +++ b/src/video/SDL_video.c Wed Feb 16 00:11:48 2011 -0800 @@ -1025,36 +1025,40 @@ SDL_GetDisplayForWindow(other) == display) { SDL_DisplayMode fullscreen_mode; if (SDL_GetWindowDisplayMode(other, &fullscreen_mode) == 0) { - if (_this->PrepWindowFullscreen) { - _this->PrepWindowFullscreen(_this, other); + SDL_bool resized = SDL_TRUE; + + if (other->w == fullscreen_mode.w && other->h == fullscreen_mode.h) { + resized = SDL_FALSE; } SDL_SetDisplayModeForDisplay(display, &fullscreen_mode); - if (_this->SetWindowFullscreen) { _this->SetWindowFullscreen(_this, other, display, SDL_TRUE); } display->fullscreen_window = other; - /* Generate a mode change events here */ - SDL_SendWindowEvent(other, SDL_WINDOWEVENT_RESIZED, - fullscreen_mode.w, fullscreen_mode.h); + /* Generate a mode change event here */ + if (resized) { + SDL_SendWindowEvent(other, SDL_WINDOWEVENT_RESIZED, + fullscreen_mode.w, fullscreen_mode.h); + } else { + SDL_OnWindowResized(other); + } return; } } } /* Nope, restore the desktop mode */ - if (_this->PrepWindowFullscreen) { - _this->PrepWindowFullscreen(_this, window); - } - SDL_SetDisplayModeForDisplay(display, NULL); if (_this->SetWindowFullscreen) { _this->SetWindowFullscreen(_this, window, display, SDL_FALSE); } display->fullscreen_window = NULL; + + /* Generate a mode change event here */ + SDL_OnWindowResized(window); } SDL_Window *