overscan (feature for SDL_RenderSetLogicalSize): Fix to ignore overscan hint when using the Direct3D 9 backend.
authorEric Wing <ewing . public |-at-| gmail . com>
Mon, 04 Apr 2016 19:25:24 -0700
changeset 11076d772a4dbeff5
parent 11075 6a683bf1446c
child 11077 8a29b371e2db
overscan (feature for SDL_RenderSetLogicalSize): Fix to ignore overscan hint when using the Direct3D 9 backend.
D39 does not support negative viewport values which the current implementation relies on.
D3D11 does support negative viewport values so that will continue working.
Refer to Bug 2799.
src/render/SDL_render.c
     1.1 --- a/src/render/SDL_render.c	Sun Jun 21 04:04:14 2015 -0700
     1.2 +++ b/src/render/SDL_render.c	Mon Apr 04 19:25:24 2016 -0700
     1.3 @@ -1153,7 +1153,16 @@
     1.4      if (!hint) {
     1.5          scale_policy = 0;
     1.6      } else if ( *hint == '1' || SDL_strcasecmp(hint, "overscan") == 0)  {
     1.7 -        scale_policy = 1;
     1.8 +        /* Unfortunately, Direct3D 9 does't support negative viewport numbers
     1.9 +        which the main overscan implementation relies on.
    1.10 +        D3D11 does support negative values and uses a different id string
    1.11 +        so overscan will work for D3D11.
    1.12 +        */
    1.13 +        if(SDL_strcasecmp("direct3d", SDL_GetCurrentVideoDriver())) {
    1.14 +            scale_policy = 0;
    1.15 +        } else {
    1.16 +            scale_policy = 1;
    1.17 +        }
    1.18      } else {
    1.19          scale_policy = 0;
    1.20      }