Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
If a test program window resizes, resize its viewport, too.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Mar 29, 2011
1 parent acb9f67 commit 1946616
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/common.c
Expand Up @@ -1040,6 +1040,24 @@ CommonEvent(CommonState * state, SDL_Event * event, int *done)
}
}
break;

case SDL_WINDOWEVENT_RESIZED:
{
SDL_Window *window = SDL_GetWindowFromID(event->window.windowID);
if (!window) {
break;
}

for (i = 0; i < state->num_windows; ++i) {
if (state->windows[i] == window) {
if (state->renderers[i]) {
SDL_RenderSetViewport(state->renderers[i], NULL);
}
break;
}
}
}
break;
}
break;
case SDL_KEYDOWN:
Expand Down

0 comments on commit 1946616

Please sign in to comment.