Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

The logical size set for a render target is temporary and shouldn't c…

…onflict with the logical size set for a window.
  • Loading branch information
slouken committed Oct 12, 2012
1 parent fdbb570 commit 0306a6731cf535ecd0b25d986aab5877302716a8

File 1 of 2 in 0306a67

@@ -926,6 +926,8 @@ SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture)
/* 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 @@ SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture)
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;

0 comments on commit 0306a67

Please sign in to comment.