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 6581 008057dcc079
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
--- a/src/render/SDL_render.c	Fri Oct 12 02:33:34 2012 -0700
+++ b/src/render/SDL_render.c	Fri Oct 12 02:56:41 2012 -0700
@@ -926,6 +926,8 @@
         /* Make a backup of the viewport */
         renderer->viewport_backup = renderer->viewport;
         renderer->scale_backup = renderer->scale;
+        renderer->logical_w_backup = renderer->logical_w;
+        renderer->logical_h_backup = renderer->logical_h;
     }
     renderer->target = texture;
 
@@ -940,9 +942,13 @@
         renderer->viewport.h = texture->h;
         renderer->scale.x = 1.0f;
         renderer->scale.y = 1.0f;
+        renderer->logical_w = 0;
+        renderer->logical_h = 0;
     } else {
         renderer->viewport = renderer->viewport_backup;
         renderer->scale = renderer->scale_backup;
+        renderer->logical_w = renderer->logical_w_backup;
+        renderer->logical_h = renderer->logical_h_backup;
     }
     if (renderer->UpdateViewport(renderer) < 0) {
         return -1;
--- a/src/render/SDL_sysrender.h	Fri Oct 12 02:33:34 2012 -0700
+++ b/src/render/SDL_sysrender.h	Fri Oct 12 02:56:41 2012 -0700
@@ -126,6 +126,8 @@
     /* The logical resolution for rendering */
     int logical_w;
     int logical_h;
+    int logical_w_backup;
+    int logical_h_backup;
 
     /* The drawable area within the window */
     SDL_Rect viewport;