From bb3cb4f42ae7870dcee2df4e0c50b59e178d244a Mon Sep 17 00:00:00 2001 From: Eric Wing Date: Mon, 4 Apr 2016 19:25:24 -0700 Subject: [PATCH] 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 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 254e1f89f..3cefa8044 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -1153,7 +1153,16 @@ UpdateLogicalSize(SDL_Renderer *renderer) if (!hint) { scale_policy = 0; } else if ( *hint == '1' || SDL_strcasecmp(hint, "overscan") == 0) { - scale_policy = 1; + /* Unfortunately, Direct3D 9 does't support negative viewport numbers + which the main overscan implementation relies on. + D3D11 does support negative values and uses a different id string + so overscan will work for D3D11. + */ + if(SDL_strcasecmp("direct3d", SDL_GetCurrentVideoDriver())) { + scale_policy = 0; + } else { + scale_policy = 1; + } } else { scale_policy = 0; }