SDL: Fixed d3d11 renderer creation

From e77cfb9a110ab8ed0d18e0d12a6be7705ff448dc Mon Sep 17 00:00:00 2001
From: DarkContact <[EMAIL REDACTED]>
Date: Wed, 24 Nov 2021 00:29:45 +0300
Subject: [PATCH] Fixed d3d11 renderer creation

---
 src/render/direct3d11/SDL_render_d3d11.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c
index ad4e0fe2935..ffae92f5f68 100644
--- a/src/render/direct3d11/SDL_render_d3d11.c
+++ b/src/render/direct3d11/SDL_render_d3d11.c
@@ -770,7 +770,11 @@ D3D11_CreateSwapChain(SDL_Renderer * renderer, int w, int h)
     if (usingXAML) {
         swapChainDesc.Scaling = DXGI_SCALING_STRETCH;
     } else {
-        swapChainDesc.Scaling = DXGI_SCALING_NONE;
+        if (WIN_IsWindows8OrGreater()) {
+            swapChainDesc.Scaling = DXGI_SCALING_NONE;
+        } else {
+            swapChainDesc.Scaling = DXGI_SCALING_STRETCH;
+        }
     }
     swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; /* All Windows Store apps must use this SwapEffect. */
 #endif
@@ -953,11 +957,13 @@ D3D11_CreateWindowSizeDependentResources(SDL_Renderer * renderer)
      *
      * TODO, WinRT: reexamine the docs for IDXGISwapChain1::SetRotation, see if might be available, usable, and prudent-to-call on WinPhone 8.1
      */
-    if (data->swapEffect == DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL) {
-        result = IDXGISwapChain1_SetRotation(data->swapChain, data->rotation);
-        if (FAILED(result)) {
-            WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("IDXGISwapChain1::SetRotation"), result);
-            goto done;
+    if (WIN_IsWindows8OrGreater()) {
+        if (data->swapEffect == DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL) {
+            result = IDXGISwapChain1_SetRotation(data->swapChain, data->rotation);
+            if (FAILED(result)) {
+                WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("IDXGISwapChain1::SetRotation"), result);
+                goto done;
+            }
         }
     }
 #endif