The logical size set for a render target is temporary and shouldn't conflict with the logical size set for a window.
authorSam Lantinga <slouken@libsdl.org>
Fri, 12 Oct 2012 02:56:41 -0700
changeset 6581008057dcc079
parent 6580 a7d6106f1715
child 6586 ab57cc69dcc0
The logical size set for a render target is temporary and shouldn't conflict with the logical size set for a window.
src/render/SDL_render.c
src/render/SDL_sysrender.h
     1.1 --- a/src/render/SDL_render.c	Fri Oct 12 02:33:34 2012 -0700
     1.2 +++ b/src/render/SDL_render.c	Fri Oct 12 02:56:41 2012 -0700
     1.3 @@ -926,6 +926,8 @@
     1.4          /* Make a backup of the viewport */
     1.5          renderer->viewport_backup = renderer->viewport;
     1.6          renderer->scale_backup = renderer->scale;
     1.7 +        renderer->logical_w_backup = renderer->logical_w;
     1.8 +        renderer->logical_h_backup = renderer->logical_h;
     1.9      }
    1.10      renderer->target = texture;
    1.11  
    1.12 @@ -940,9 +942,13 @@
    1.13          renderer->viewport.h = texture->h;
    1.14          renderer->scale.x = 1.0f;
    1.15          renderer->scale.y = 1.0f;
    1.16 +        renderer->logical_w = 0;
    1.17 +        renderer->logical_h = 0;
    1.18      } else {
    1.19          renderer->viewport = renderer->viewport_backup;
    1.20          renderer->scale = renderer->scale_backup;
    1.21 +        renderer->logical_w = renderer->logical_w_backup;
    1.22 +        renderer->logical_h = renderer->logical_h_backup;
    1.23      }
    1.24      if (renderer->UpdateViewport(renderer) < 0) {
    1.25          return -1;
     2.1 --- a/src/render/SDL_sysrender.h	Fri Oct 12 02:33:34 2012 -0700
     2.2 +++ b/src/render/SDL_sysrender.h	Fri Oct 12 02:56:41 2012 -0700
     2.3 @@ -126,6 +126,8 @@
     2.4      /* The logical resolution for rendering */
     2.5      int logical_w;
     2.6      int logical_h;
     2.7 +    int logical_w_backup;
     2.8 +    int logical_h_backup;
     2.9  
    2.10      /* The drawable area within the window */
    2.11      SDL_Rect viewport;