Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed resetting the Direc3D renderer on mode change
  • Loading branch information
slouken committed Feb 16, 2011
1 parent 96f392a commit ea3372b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/video/SDL_sysvideo.h
Expand Up @@ -180,7 +180,6 @@ struct SDL_VideoDevice
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);
Expand Down
24 changes: 14 additions & 10 deletions src/video/SDL_video.c
Expand Up @@ -1025,36 +1025,40 @@ SDL_UpdateFullscreenMode(SDL_Window * window)
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 *
Expand Down

0 comments on commit ea3372b

Please sign in to comment.