Fixed resetting the Direc3D renderer on mode change
This commit is contained in:
parent
6c726ca475
commit
d119c3824f
2 changed files with 14 additions and 11 deletions
|
@ -180,7 +180,6 @@ struct SDL_VideoDevice
|
||||||
void (*MaximizeWindow) (_THIS, SDL_Window * window);
|
void (*MaximizeWindow) (_THIS, SDL_Window * window);
|
||||||
void (*MinimizeWindow) (_THIS, SDL_Window * window);
|
void (*MinimizeWindow) (_THIS, SDL_Window * window);
|
||||||
void (*RestoreWindow) (_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 (*SetWindowFullscreen) (_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen);
|
||||||
void (*SetWindowGrab) (_THIS, SDL_Window * window);
|
void (*SetWindowGrab) (_THIS, SDL_Window * window);
|
||||||
void (*DestroyWindow) (_THIS, SDL_Window * window);
|
void (*DestroyWindow) (_THIS, SDL_Window * window);
|
||||||
|
|
|
@ -1025,36 +1025,40 @@ SDL_UpdateFullscreenMode(SDL_Window * window)
|
||||||
SDL_GetDisplayForWindow(other) == display) {
|
SDL_GetDisplayForWindow(other) == display) {
|
||||||
SDL_DisplayMode fullscreen_mode;
|
SDL_DisplayMode fullscreen_mode;
|
||||||
if (SDL_GetWindowDisplayMode(other, &fullscreen_mode) == 0) {
|
if (SDL_GetWindowDisplayMode(other, &fullscreen_mode) == 0) {
|
||||||
if (_this->PrepWindowFullscreen) {
|
SDL_bool resized = SDL_TRUE;
|
||||||
_this->PrepWindowFullscreen(_this, other);
|
|
||||||
|
if (other->w == fullscreen_mode.w && other->h == fullscreen_mode.h) {
|
||||||
|
resized = SDL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_SetDisplayModeForDisplay(display, &fullscreen_mode);
|
SDL_SetDisplayModeForDisplay(display, &fullscreen_mode);
|
||||||
|
|
||||||
if (_this->SetWindowFullscreen) {
|
if (_this->SetWindowFullscreen) {
|
||||||
_this->SetWindowFullscreen(_this, other, display, SDL_TRUE);
|
_this->SetWindowFullscreen(_this, other, display, SDL_TRUE);
|
||||||
}
|
}
|
||||||
display->fullscreen_window = other;
|
display->fullscreen_window = other;
|
||||||
|
|
||||||
/* Generate a mode change events here */
|
/* Generate a mode change event here */
|
||||||
SDL_SendWindowEvent(other, SDL_WINDOWEVENT_RESIZED,
|
if (resized) {
|
||||||
fullscreen_mode.w, fullscreen_mode.h);
|
SDL_SendWindowEvent(other, SDL_WINDOWEVENT_RESIZED,
|
||||||
|
fullscreen_mode.w, fullscreen_mode.h);
|
||||||
|
} else {
|
||||||
|
SDL_OnWindowResized(other);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Nope, restore the desktop mode */
|
/* Nope, restore the desktop mode */
|
||||||
if (_this->PrepWindowFullscreen) {
|
|
||||||
_this->PrepWindowFullscreen(_this, window);
|
|
||||||
}
|
|
||||||
|
|
||||||
SDL_SetDisplayModeForDisplay(display, NULL);
|
SDL_SetDisplayModeForDisplay(display, NULL);
|
||||||
|
|
||||||
if (_this->SetWindowFullscreen) {
|
if (_this->SetWindowFullscreen) {
|
||||||
_this->SetWindowFullscreen(_this, window, display, SDL_FALSE);
|
_this->SetWindowFullscreen(_this, window, display, SDL_FALSE);
|
||||||
}
|
}
|
||||||
display->fullscreen_window = NULL;
|
display->fullscreen_window = NULL;
|
||||||
|
|
||||||
|
/* Generate a mode change event here */
|
||||||
|
SDL_OnWindowResized(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_Window *
|
SDL_Window *
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue