Added key bindings to resize the window (+/-)
authorSam Lantinga <slouken@libsdl.org>
Wed, 03 Oct 2012 13:38:22 -0700
changeset 6543 44a83e1a48f9
parent 6542 5c1b8ed19212
child 6544 c03db4864789
Added key bindings to resize the window (+/-)
test/common.c
--- a/test/common.c	Wed Oct 03 13:37:44 2012 -0700
+++ b/test/common.c	Wed Oct 03 13:38:22 2012 -0700
@@ -1100,6 +1100,24 @@
                 }
             }
             break;
+        case SDLK_EQUALS: {
+                SDL_Window *window = SDL_GetWindowFromID(event->key.windowID);
+                if (window) {
+                    int w, h;
+                    SDL_GetWindowSize(window, &w, &h);
+                    SDL_SetWindowSize(window, w*2, h*2);
+                }
+            }
+            break;
+        case SDLK_MINUS: {
+                SDL_Window *window = SDL_GetWindowFromID(event->key.windowID);
+                if (window) {
+                    int w, h;
+                    SDL_GetWindowSize(window, &w, &h);
+                    SDL_SetWindowSize(window, w/2, h/2);
+                }
+            }
+            break;
         case SDLK_c:
             if (event->key.keysym.mod & KMOD_CTRL) {
                 /* Ctrl-C copy awesome text! */