src/render/SDL_render.c
changeset 6578 77d70ec131bc
parent 6546 824535ce51b6
child 6579 2390a7403b77
equal deleted inserted replaced
6577:d38491853506 6578:77d70ec131bc
   950 
   950 
   951     /* All set! */
   951     /* All set! */
   952     return 0;
   952     return 0;
   953 }
   953 }
   954 
   954 
       
   955 SDL_Texture *
       
   956 SDL_GetRenderTarget(SDL_Renderer *renderer)
       
   957 {
       
   958     return renderer->target;
       
   959 }
       
   960 
   955 static int
   961 static int
   956 UpdateLogicalSize(SDL_Renderer *renderer)
   962 UpdateLogicalSize(SDL_Renderer *renderer)
   957 {
   963 {
   958     int w, h;
   964     int w, h;
   959     float want_aspect;
   965     float want_aspect;
   960     float real_aspect;
   966     float real_aspect;
   961     float scale;
   967     float scale;
   962     SDL_Rect viewport;
   968     SDL_Rect viewport;
   963 
   969 
   964     if (renderer->window) {
   970     if (renderer->target) {
       
   971         SDL_QueryTexture(renderer->target, NULL, NULL, &w, &h);
       
   972     } else if (renderer->window) {
   965         SDL_GetWindowSize(renderer->window, &w, &h);
   973         SDL_GetWindowSize(renderer->window, &w, &h);
   966     } else {
   974     } else {
   967         /* FIXME */
   975         /* FIXME */
   968         SDL_SetError("Internal error: No way to get output resolution");
   976         SDL_SetError("Internal error: No way to get output resolution");
   969         return -1;
   977         return -1;