src/render/direct3d11/SDL_render_d3d11.c
changeset 8611 a762dfc67e1a
parent 8608 c5d603f7094e
child 8612 24d36bb9c7af
     1.1 --- a/src/render/direct3d11/SDL_render_d3d11.c	Tue Mar 11 12:40:31 2014 -0400
     1.2 +++ b/src/render/direct3d11/SDL_render_d3d11.c	Wed Mar 12 11:57:15 2014 -0400
     1.3 @@ -961,11 +961,10 @@
     1.4      D3D11_SAMPLER_DESC samplerDesc;
     1.5      D3D11_RASTERIZER_DESC rasterDesc;
     1.6  
     1.7 -    // TODO, WinRT, Mar 11, 2014: once SDL/WinRT is back up and running, see if D3D11 init functions are loadable (via LoadPackagedLibrary/SDL_LoadObject, etc.)
     1.8 -//#ifdef __WINRT__
     1.9 -//    CreateDXGIFactoryFunc = CreateDXGIFactory;
    1.10 -//    D3D11CreateDeviceFunc = D3D11CreateDevice;
    1.11 -//#else
    1.12 +#ifdef __WINRT__
    1.13 +    CreateDXGIFactoryFunc = CreateDXGIFactory1;
    1.14 +    D3D11CreateDeviceFunc = D3D11CreateDevice;
    1.15 +#else
    1.16      data->hDXGIMod = SDL_LoadObject("dxgi.dll");
    1.17      if (!data->hDXGIMod) {
    1.18          result = E_FAIL;
    1.19 @@ -989,7 +988,7 @@
    1.20          result = E_FAIL;
    1.21          goto done;
    1.22      }
    1.23 -//#endif /* __WINRT__ */
    1.24 +#endif /* __WINRT__ */
    1.25  
    1.26      result = CreateDXGIFactoryFunc(&IID_IDXGIFactory2, &data->dxgiFactory);
    1.27      if (FAILED(result)) {
    1.28 @@ -2833,6 +2832,11 @@
    1.29      HRESULT result;
    1.30      DXGI_PRESENT_PARAMETERS parameters;
    1.31  
    1.32 +#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
    1.33 +    syncInterval = 1;
    1.34 +    presentFlags = 0;
    1.35 +    result = IDXGISwapChain_Present(data->swapChain, syncInterval, presentFlags);
    1.36 +#else
    1.37      if (renderer->info.flags & SDL_RENDERER_PRESENTVSYNC) {
    1.38          syncInterval = 1;
    1.39          presentFlags = 0;
    1.40 @@ -2841,9 +2845,6 @@
    1.41          presentFlags = DXGI_PRESENT_DO_NOT_WAIT;
    1.42      }
    1.43  
    1.44 -#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
    1.45 -    result = IDXGISwapChain_Present(data->swapChain, syncInterval, presentFlags);
    1.46 -#else
    1.47      /* The application may optionally specify "dirty" or "scroll"
    1.48       * rects to improve efficiency in certain scenarios.
    1.49       * This option is not available on Windows Phone 8, to note.