test/common.c
changeset 6513 c781fb99ce39
parent 6509 e94d5a5376c1
child 6543 44a83e1a48f9
equal deleted inserted replaced
6512:4beb596ccfae 6513:c781fb99ce39
  1056     }
  1056     }
  1057 
  1057 
  1058     switch (event->type) {
  1058     switch (event->type) {
  1059     case SDL_WINDOWEVENT:
  1059     case SDL_WINDOWEVENT:
  1060         switch (event->window.event) {
  1060         switch (event->window.event) {
       
  1061         case SDL_WINDOWEVENT_SIZE_CHANGED:
       
  1062             {
       
  1063                 SDL_Window *window = SDL_GetWindowFromID(event->window.windowID);
       
  1064                 if (window) {
       
  1065                     for (i = 0; i < state->num_windows; ++i) {
       
  1066                         if (window == state->windows[i] &&
       
  1067                             (state->window_flags & SDL_WINDOW_RESIZABLE)) {
       
  1068                             SDL_Rect viewport;
       
  1069 
       
  1070                             viewport.x = 0;
       
  1071                             viewport.y = 0;
       
  1072                             SDL_GetWindowSize(window, &viewport.w, &viewport.h);
       
  1073                             SDL_RenderSetViewport(state->renderers[i], &viewport);
       
  1074                         }
       
  1075                     }
       
  1076                 }
       
  1077             }
       
  1078             break;
  1061         case SDL_WINDOWEVENT_CLOSE:
  1079         case SDL_WINDOWEVENT_CLOSE:
  1062 			{
  1080 			{
  1063                 SDL_Window *window = SDL_GetWindowFromID(event->window.windowID);
  1081                 SDL_Window *window = SDL_GetWindowFromID(event->window.windowID);
  1064                 if (window) {
  1082                 if (window) {
  1065 					SDL_DestroyWindow(window);
  1083 					SDL_DestroyWindow(window);