If a test program window resizes, resize its viewport, too.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 28 Mar 2011 23:20:54 -0400
changeset 5521ef550bdb8c1b
parent 5520 09b500e0656d
child 5522 38bd9696f659
If a test program window resizes, resize its viewport, too.
test/common.c
     1.1 --- a/test/common.c	Mon Mar 28 23:21:22 2011 -0400
     1.2 +++ b/test/common.c	Mon Mar 28 23:20:54 2011 -0400
     1.3 @@ -1040,6 +1040,24 @@
     1.4  				}
     1.5  			}
     1.6              break;
     1.7 +
     1.8 +        case SDL_WINDOWEVENT_RESIZED:
     1.9 +            {
    1.10 +                SDL_Window *window = SDL_GetWindowFromID(event->window.windowID);
    1.11 +                if (!window) {
    1.12 +                    break;
    1.13 +                }
    1.14 +
    1.15 +                for (i = 0; i < state->num_windows; ++i) {
    1.16 +                    if (state->windows[i] == window) {
    1.17 +                        if (state->renderers[i]) {
    1.18 +                            SDL_RenderSetViewport(state->renderers[i], NULL);
    1.19 +                        }
    1.20 +                        break;
    1.21 +                    }
    1.22 +                }
    1.23 +            }
    1.24 +            break;
    1.25          }
    1.26          break;
    1.27      case SDL_KEYDOWN: