src/render/direct3d11/SDL_render_d3d11.c
changeset 8611 a762dfc67e1a
parent 8608 c5d603f7094e
child 8612 24d36bb9c7af
equal deleted inserted replaced
8608:c5d603f7094e 8611:a762dfc67e1a
   959 
   959 
   960     D3D11_BUFFER_DESC constantBufferDesc;
   960     D3D11_BUFFER_DESC constantBufferDesc;
   961     D3D11_SAMPLER_DESC samplerDesc;
   961     D3D11_SAMPLER_DESC samplerDesc;
   962     D3D11_RASTERIZER_DESC rasterDesc;
   962     D3D11_RASTERIZER_DESC rasterDesc;
   963 
   963 
   964     // 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.)
   964 #ifdef __WINRT__
   965 //#ifdef __WINRT__
   965     CreateDXGIFactoryFunc = CreateDXGIFactory1;
   966 //    CreateDXGIFactoryFunc = CreateDXGIFactory;
   966     D3D11CreateDeviceFunc = D3D11CreateDevice;
   967 //    D3D11CreateDeviceFunc = D3D11CreateDevice;
   967 #else
   968 //#else
       
   969     data->hDXGIMod = SDL_LoadObject("dxgi.dll");
   968     data->hDXGIMod = SDL_LoadObject("dxgi.dll");
   970     if (!data->hDXGIMod) {
   969     if (!data->hDXGIMod) {
   971         result = E_FAIL;
   970         result = E_FAIL;
   972         goto done;
   971         goto done;
   973     }
   972     }
   987     D3D11CreateDeviceFunc = (PFN_D3D11_CREATE_DEVICE)SDL_LoadFunction(data->hD3D11Mod, "D3D11CreateDevice");
   986     D3D11CreateDeviceFunc = (PFN_D3D11_CREATE_DEVICE)SDL_LoadFunction(data->hD3D11Mod, "D3D11CreateDevice");
   988     if (!D3D11CreateDeviceFunc) {
   987     if (!D3D11CreateDeviceFunc) {
   989         result = E_FAIL;
   988         result = E_FAIL;
   990         goto done;
   989         goto done;
   991     }
   990     }
   992 //#endif /* __WINRT__ */
   991 #endif /* __WINRT__ */
   993 
   992 
   994     result = CreateDXGIFactoryFunc(&IID_IDXGIFactory2, &data->dxgiFactory);
   993     result = CreateDXGIFactoryFunc(&IID_IDXGIFactory2, &data->dxgiFactory);
   995     if (FAILED(result)) {
   994     if (FAILED(result)) {
   996         WIN_SetErrorFromHRESULT(__FUNCTION__ ", CreateDXGIFactory", result);
   995         WIN_SetErrorFromHRESULT(__FUNCTION__ ", CreateDXGIFactory", result);
   997         goto done;
   996         goto done;
  2831     UINT syncInterval;
  2830     UINT syncInterval;
  2832     UINT presentFlags;
  2831     UINT presentFlags;
  2833     HRESULT result;
  2832     HRESULT result;
  2834     DXGI_PRESENT_PARAMETERS parameters;
  2833     DXGI_PRESENT_PARAMETERS parameters;
  2835 
  2834 
       
  2835 #if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
       
  2836     syncInterval = 1;
       
  2837     presentFlags = 0;
       
  2838     result = IDXGISwapChain_Present(data->swapChain, syncInterval, presentFlags);
       
  2839 #else
  2836     if (renderer->info.flags & SDL_RENDERER_PRESENTVSYNC) {
  2840     if (renderer->info.flags & SDL_RENDERER_PRESENTVSYNC) {
  2837         syncInterval = 1;
  2841         syncInterval = 1;
  2838         presentFlags = 0;
  2842         presentFlags = 0;
  2839     } else {
  2843     } else {
  2840         syncInterval = 0;
  2844         syncInterval = 0;
  2841         presentFlags = DXGI_PRESENT_DO_NOT_WAIT;
  2845         presentFlags = DXGI_PRESENT_DO_NOT_WAIT;
  2842     }
  2846     }
  2843 
  2847 
  2844 #if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
       
  2845     result = IDXGISwapChain_Present(data->swapChain, syncInterval, presentFlags);
       
  2846 #else
       
  2847     /* The application may optionally specify "dirty" or "scroll"
  2848     /* The application may optionally specify "dirty" or "scroll"
  2848      * rects to improve efficiency in certain scenarios.
  2849      * rects to improve efficiency in certain scenarios.
  2849      * This option is not available on Windows Phone 8, to note.
  2850      * This option is not available on Windows Phone 8, to note.
  2850      */
  2851      */
  2851     SDL_zero(parameters);
  2852     SDL_zero(parameters);