Add a toggle fullscreen button

Assigns F11 as the key for toggling fullscreen.
This commit is contained in:
SolidStateDj 2024-08-26 18:27:31 -04:00
parent af4356bfe1
commit 7ecc1d3be0
1 changed files with 9 additions and 0 deletions

View File

@ -273,6 +273,15 @@ void WindowSDL::onKeyPress(const SDL_Event* event) {
case SDLK_SPACE: case SDLK_SPACE:
button = OrbisPadButtonDataOffset::ORBIS_PAD_BUTTON_TOUCH_PAD; button = OrbisPadButtonDataOffset::ORBIS_PAD_BUTTON_TOUCH_PAD;
break; break;
case SDLK_F11:
if (event->type == SDL_EVENT_KEY_DOWN) {
{
SDL_WindowFlags flag = SDL_GetWindowFlags(window);
bool is_fullscreen = flag & SDL_WINDOW_FULLSCREEN;
SDL_SetWindowFullscreen(window, !is_fullscreen);
}
}
break;
default: default:
break; break;
} }