Test: Add Shift-Enter to switch between FS and desktop FS.

This commit is contained in:
J?rgen P. Tjern? 2014-01-15 11:08:55 -08:00
parent a6a56af91b
commit a442f121e6
1 changed files with 12 additions and 0 deletions

View File

@ -1433,7 +1433,19 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done)
SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP); SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP);
} }
} }
} else if (withShift) {
/* Shift-Enter toggle fullscreen desktop / fullscreen */
SDL_Window *window = SDL_GetWindowFromID(event->key.windowID);
if (window) {
Uint32 flags = SDL_GetWindowFlags(window);
if ((flags & SDL_WINDOW_FULLSCREEN_DESKTOP) == SDL_WINDOW_FULLSCREEN_DESKTOP) {
SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN);
} else {
SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP);
}
}
} }
break; break;
case SDLK_b: case SDLK_b:
if (withControl) { if (withControl) {