src/video/winrt/SDL_winrtvideo.cpp
changeset 9951 839a45509496
parent 9950 6cc7e0682758
child 9952 54b2eeb48c7d
equal deleted inserted replaced
9950:6cc7e0682758 9951:839a45509496
   328                the Windows App Certification Kit, or possibly in SDL/WinRT's
   328                the Windows App Certification Kit, or possibly in SDL/WinRT's
   329                display detection code.  Either way, try to detect when this
   329                display detection code.  Either way, try to detect when this
   330                happens, and use a hackish means to create a reasonable-as-possible
   330                happens, and use a hackish means to create a reasonable-as-possible
   331                'display mode'.  -- DavidL
   331                'display mode'.  -- DavidL
   332             */
   332             */
   333 #if SDL_WINRT_USE_APPLICATIONVIEW
       
   334             if (adapterIndex == 0 && outputIndex == 0) {
   333             if (adapterIndex == 0 && outputIndex == 0) {
   335                 SDL_VideoDisplay display;
   334                 SDL_VideoDisplay display;
   336                 SDL_DisplayMode mode;
   335                 SDL_DisplayMode mode;
       
   336 #if (NTDDI_VERSION >= NTDDI_WIN10) || (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
   337                 ApplicationView ^ appView = ApplicationView::GetForCurrentView();
   337                 ApplicationView ^ appView = ApplicationView::GetForCurrentView();
       
   338 #else
   338                 CoreWindow ^ coreWin = CoreWindow::GetForCurrentThread();
   339                 CoreWindow ^ coreWin = CoreWindow::GetForCurrentThread();
       
   340 #endif
   339                 SDL_zero(display);
   341                 SDL_zero(display);
   340                 SDL_zero(mode);
   342                 SDL_zero(mode);
   341                 display.name = "DXGI Display-detection Workaround";
   343                 display.name = "DXGI Display-detection Workaround";
   342 
   344 
   343                 /* HACK: ApplicationView's VisibleBounds property, appeared, via testing, to
   345                 /* HACK: ApplicationView's VisibleBounds property, appeared, via testing, to
   366                     (SDL_AddVideoDisplay(&display) < 0))
   368                     (SDL_AddVideoDisplay(&display) < 0))
   367                 {
   369                 {
   368                     return SDL_SetError("Failed to apply DXGI Display-detection workaround");
   370                     return SDL_SetError("Failed to apply DXGI Display-detection workaround");
   369                 }
   371                 }
   370             }
   372             }
   371 #endif  // SDL_WINRT_USE_APPLICATIONVIEW
       
   372 
   373 
   373             break;
   374             break;
   374         }
   375         }
   375     }
   376     }
   376 
   377