src/render/SDL_render.c
changeset 7746 6a05d7352575
parent 7719 31b5f9ff36ca
child 7759 869583422e5a
     1.1 --- a/src/render/SDL_render.c	Fri Sep 27 22:09:51 2013 -0700
     1.2 +++ b/src/render/SDL_render.c	Fri Sep 20 13:43:00 2013 -0400
     1.3 @@ -117,7 +117,12 @@
     1.4                      /* Window was resized, reset viewport */
     1.5                      int w, h;
     1.6  
     1.7 -                    SDL_GetWindowSize(window, &w, &h);
     1.8 +                    if (renderer->GetOutputSize) {
     1.9 +                        renderer->GetOutputSize(renderer, &w, &h);
    1.10 +                    } else {
    1.11 +                        SDL_GetWindowSize(renderer->window, &w, &h);
    1.12 +                    }
    1.13 +
    1.14                      if (renderer->target) {
    1.15                          renderer->viewport_backup.x = 0;
    1.16                          renderer->viewport_backup.y = 0;
    1.17 @@ -335,11 +340,11 @@
    1.18  
    1.19      if (renderer->target) {
    1.20          return SDL_QueryTexture(renderer->target, NULL, NULL, w, h);
    1.21 +    } else if (renderer->GetOutputSize) {
    1.22 +        return renderer->GetOutputSize(renderer, w, h);
    1.23      } else if (renderer->window) {
    1.24          SDL_GetWindowSize(renderer->window, w, h);
    1.25          return 0;
    1.26 -    } else if (renderer->GetOutputSize) {
    1.27 -        return renderer->GetOutputSize(renderer, w, h);
    1.28      } else {
    1.29          /* This should never happen */
    1.30          SDL_SetError("Renderer doesn't support querying output size");