src/render/SDL_render.c
changeset 7240 39eb4958950a
parent 7239 04dda95ba22c
child 7318 46a5a6b8678e
     1.1 --- a/src/render/SDL_render.c	Wed May 29 03:07:55 2013 -0700
     1.2 +++ b/src/render/SDL_render.c	Wed May 29 03:22:19 2013 -0700
     1.3 @@ -110,29 +110,11 @@
     1.4                  renderer->WindowEvent(renderer, &event->window);
     1.5              }
     1.6  
     1.7 -            if (event->window.event == SDL_WINDOWEVENT_RESIZED) {
     1.8 -                if (renderer->logical_w) {
     1.9 -                    /* We'll update the renderer in the SIZE_CHANGED event */
    1.10 -                } else {
    1.11 -                    /* Try to keep the previous viewport centered */
    1.12 -                    int w, h;
    1.13 -
    1.14 -                    SDL_GetWindowSize(window, &w, &h);
    1.15 -                    if (renderer->target) {
    1.16 -                        renderer->viewport_backup.x = (w - renderer->viewport_backup.w) / 2;
    1.17 -                        renderer->viewport_backup.y = (h - renderer->viewport_backup.h) / 2;
    1.18 -                    } else {
    1.19 -                        renderer->viewport.x = (w - renderer->viewport.w) / 2;
    1.20 -                        renderer->viewport.y = (h - renderer->viewport.h) / 2;
    1.21 -                        renderer->UpdateViewport(renderer);
    1.22 -                    }
    1.23 -                }
    1.24 -                renderer->resized = SDL_TRUE;
    1.25 -            } else if (event->window.event == SDL_WINDOWEVENT_SIZE_CHANGED) {
    1.26 +            if (event->window.event == SDL_WINDOWEVENT_SIZE_CHANGED) {
    1.27                  if (renderer->logical_w) {
    1.28                      UpdateLogicalSize(renderer);
    1.29 -                } else if (!renderer->resized) {
    1.30 -                    /* Window was programmatically resized, reset viewport */
    1.31 +                } else {
    1.32 +                    /* Window was resized, reset viewport */
    1.33                      int w, h;
    1.34  
    1.35                      SDL_GetWindowSize(window, &w, &h);
    1.36 @@ -149,7 +131,6 @@
    1.37                          renderer->UpdateViewport(renderer);
    1.38                      }
    1.39                  }
    1.40 -                renderer->resized = SDL_FALSE;
    1.41              } else if (event->window.event == SDL_WINDOWEVENT_HIDDEN) {
    1.42                  renderer->hidden = SDL_TRUE;
    1.43              } else if (event->window.event == SDL_WINDOWEVENT_SHOWN) {