Implemented fullscreen <-> windowed transition on Windows 8
authorSam Lantinga <slouken@libsdl.org>
Mon, 10 Mar 2014 15:00:59 -0700
changeset 85982e6b94600850
parent 8597 1479abb49773
child 8599 532cd234e923
Implemented fullscreen <-> windowed transition on Windows 8
src/render/direct3d11/SDL_render_d3d11.c
     1.1 --- a/src/render/direct3d11/SDL_render_d3d11.c	Mon Mar 10 14:35:37 2014 -0700
     1.2 +++ b/src/render/direct3d11/SDL_render_d3d11.c	Mon Mar 10 15:00:59 2014 -0700
     1.3 @@ -1732,7 +1732,6 @@
     1.4  D3D11_UpdateForWindowSizeChange(SDL_Renderer * renderer)
     1.5  {
     1.6      D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata;
     1.7 -    /* FIXME: Do we need to release render targets like we do in D3D9? */
     1.8      return D3D11_CreateWindowSizeDependentResources(renderer);
     1.9  }
    1.10  
    1.11 @@ -3004,8 +3003,11 @@
    1.12           *
    1.13           * TODO, WinRT: consider throwing an exception if D3D11_RenderPresent fails, especially if there is a way to salvage debug info from users' machines
    1.14           */
    1.15 -        if (result == DXGI_ERROR_DEVICE_REMOVED) {
    1.16 +        if ( result == DXGI_ERROR_DEVICE_REMOVED ) {
    1.17              D3D11_HandleDeviceLost(renderer);
    1.18 +        } else if (result == DXGI_ERROR_INVALID_CALL) {
    1.19 +            /* We probably went through a fullscreen <-> windowed transition */
    1.20 +            D3D11_CreateWindowSizeDependentResources(renderer);
    1.21          } else {
    1.22              WIN_SetErrorFromHRESULT(__FUNCTION__ ", IDXGISwapChain::Present", result);
    1.23          }