Added key bindings to resize the window (+/-)
authorSam Lantinga <slouken@libsdl.org>
Wed, 03 Oct 2012 13:38:22 -0700
changeset 654344a83e1a48f9
parent 6542 5c1b8ed19212
child 6544 c03db4864789
Added key bindings to resize the window (+/-)
test/common.c
     1.1 --- a/test/common.c	Wed Oct 03 13:37:44 2012 -0700
     1.2 +++ b/test/common.c	Wed Oct 03 13:38:22 2012 -0700
     1.3 @@ -1100,6 +1100,24 @@
     1.4                  }
     1.5              }
     1.6              break;
     1.7 +        case SDLK_EQUALS: {
     1.8 +                SDL_Window *window = SDL_GetWindowFromID(event->key.windowID);
     1.9 +                if (window) {
    1.10 +                    int w, h;
    1.11 +                    SDL_GetWindowSize(window, &w, &h);
    1.12 +                    SDL_SetWindowSize(window, w*2, h*2);
    1.13 +                }
    1.14 +            }
    1.15 +            break;
    1.16 +        case SDLK_MINUS: {
    1.17 +                SDL_Window *window = SDL_GetWindowFromID(event->key.windowID);
    1.18 +                if (window) {
    1.19 +                    int w, h;
    1.20 +                    SDL_GetWindowSize(window, &w, &h);
    1.21 +                    SDL_SetWindowSize(window, w/2, h/2);
    1.22 +                }
    1.23 +            }
    1.24 +            break;
    1.25          case SDLK_c:
    1.26              if (event->key.keysym.mod & KMOD_CTRL) {
    1.27                  /* Ctrl-C copy awesome text! */