src/render/SDL_render.c
changeset 6579 2390a7403b77
parent 6578 77d70ec131bc
child 6581 008057dcc079
equal deleted inserted replaced
6578:77d70ec131bc 6579:2390a7403b77
  1055         renderer->viewport.w = (int)SDL_ceil(rect->w * renderer->scale.x);
  1055         renderer->viewport.w = (int)SDL_ceil(rect->w * renderer->scale.x);
  1056         renderer->viewport.h = (int)SDL_ceil(rect->h * renderer->scale.y);
  1056         renderer->viewport.h = (int)SDL_ceil(rect->h * renderer->scale.y);
  1057     } else {
  1057     } else {
  1058         renderer->viewport.x = 0;
  1058         renderer->viewport.x = 0;
  1059         renderer->viewport.y = 0;
  1059         renderer->viewport.y = 0;
  1060         if (renderer->window) {
  1060         if (renderer->target) {
       
  1061             SDL_QueryTexture(renderer->target, NULL, NULL,
       
  1062                               &renderer->viewport.w, &renderer->viewport.h);
       
  1063         } else if (renderer->window) {
  1061             SDL_GetWindowSize(renderer->window,
  1064             SDL_GetWindowSize(renderer->window,
  1062                               &renderer->viewport.w, &renderer->viewport.h);
  1065                               &renderer->viewport.w, &renderer->viewport.h);
  1063         } else {
  1066         } else {
  1064             /* This will be filled in by UpdateViewport() */
  1067             /* This will be filled in by UpdateViewport() */
  1065             renderer->viewport.w = 0;
  1068             renderer->viewport.w = 0;