Add shortcut to resize to ratio 1:1
Make Ctrl+g resize the window to the size of the video (pixel-perfect).
This commit is contained in:
parent
ab2c3de9f5
commit
2aa15db210
1 changed files with 6 additions and 0 deletions
|
@ -275,6 +275,12 @@ static void handle_key(const SDL_KeyboardEvent *event) {
|
|||
return;
|
||||
}
|
||||
|
||||
// Ctrl+g: pixel-perfect (ratio 1:1)
|
||||
if (keycode == SDLK_g && !shift) {
|
||||
SDL_SetWindowSize(window, frame_size.width, frame_size.height);
|
||||
return;
|
||||
}
|
||||
|
||||
// Ctrl+f: switch fullscreen
|
||||
if (keycode == SDLK_f && !shift) {
|
||||
Uint32 new_mode = fullscreen ? 0 : SDL_WINDOW_FULLSCREEN_DESKTOP;
|
||||
|
|
Loading…
Reference in a new issue