src/render/direct3d11/SDL_render_d3d11.c
changeset 8620 a27695b26b57
parent 8615 097646deaef2
child 8668 07dce0097f29
     1.1 --- a/src/render/direct3d11/SDL_render_d3d11.c	Sat Mar 15 10:37:40 2014 -0400
     1.2 +++ b/src/render/direct3d11/SDL_render_d3d11.c	Sat Mar 15 13:27:18 2014 -0400
     1.3 @@ -1438,30 +1438,24 @@
     1.4      ID3D11Texture2D *backBuffer = NULL;
     1.5      HRESULT result = S_OK;
     1.6      int w, h;
     1.7 -    BOOL swapDimensions;
     1.8  
     1.9      /* Release the previous render target view */
    1.10      D3D11_ReleaseMainRenderTargetView(renderer);
    1.11  
    1.12 -    /* The width and height of the swap chain must be based on the window's
    1.13 -     * landscape-oriented width and height. If the window is in a portrait
    1.14 -     * rotation, the dimensions must be reversed.
    1.15 +    /* The width and height of the swap chain must be based on the display's
    1.16 +     * non-rotated size.
    1.17       */
    1.18      SDL_GetWindowSize(renderer->window, &w, &h);
    1.19      data->rotation = D3D11_GetCurrentRotation();
    1.20 -
    1.21 -#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
    1.22 -    swapDimensions = FALSE;
    1.23 -#else
    1.24 -    swapDimensions = D3D11_IsDisplayRotated90Degrees(data->rotation);
    1.25 -#endif
    1.26 -    if (swapDimensions) {
    1.27 +    if (D3D11_IsDisplayRotated90Degrees(data->rotation)) {
    1.28          int tmp = w;
    1.29          w = h;
    1.30          h = tmp;
    1.31      }
    1.32  
    1.33      if (data->swapChain) {
    1.34 +        /* IDXGISwapChain::ResizeBuffers is not available on Windows Phone 8. */
    1.35 +#if !defined(__WINRT__) || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
    1.36          /* If the swap chain already exists, resize it. */
    1.37          result = IDXGISwapChain_ResizeBuffers(data->swapChain,
    1.38              0,
    1.39 @@ -1473,6 +1467,7 @@
    1.40              WIN_SetErrorFromHRESULT(__FUNCTION__ ", IDXGISwapChain::ResizeBuffers", result);
    1.41              goto done;
    1.42          }
    1.43 +#endif
    1.44      } else {
    1.45          result = D3D11_CreateSwapChain(renderer, w, h);
    1.46          if (FAILED(result)) {