src/video/winrt/SDL_winrtvideo.cpp
changeset 8498 333ae9a0f411
parent 8497 103bb054aa7d
child 8499 00e397f1b7a8
equal deleted inserted replaced
8497:103bb054aa7d 8498:333ae9a0f411
    77    WinRT.
    77    WinRT.
    78 */
    78 */
    79 SDL_Window * WINRT_GlobalSDLWindow = NULL;
    79 SDL_Window * WINRT_GlobalSDLWindow = NULL;
    80 
    80 
    81 
    81 
       
    82 /* The global, WinRT, video device.
       
    83 */
       
    84 SDL_VideoDevice * WINRT_GlobalSDLVideoDevice = NULL;
       
    85 
       
    86 
    82 /* WinRT driver bootstrap functions */
    87 /* WinRT driver bootstrap functions */
    83 
    88 
    84 static int
    89 static int
    85 WINRT_Available(void)
    90 WINRT_Available(void)
    86 {
    91 {
    88 }
    93 }
    89 
    94 
    90 static void
    95 static void
    91 WINRT_DeleteDevice(SDL_VideoDevice * device)
    96 WINRT_DeleteDevice(SDL_VideoDevice * device)
    92 {
    97 {
    93     SDL_WinRTGlobalApp->SetSDLVideoDevice(NULL);
    98     if (device == WINRT_GlobalSDLVideoDevice) {
       
    99         WINRT_GlobalSDLVideoDevice = NULL;
       
   100     }
    94     SDL_free(device);
   101     SDL_free(device);
    95 }
   102 }
    96 
   103 
    97 static SDL_VideoDevice *
   104 static SDL_VideoDevice *
    98 WINRT_CreateDevice(int devindex)
   105 WINRT_CreateDevice(int devindex)
   116     device->DestroyWindow = WINRT_DestroyWindow;
   123     device->DestroyWindow = WINRT_DestroyWindow;
   117     device->SetDisplayMode = WINRT_SetDisplayMode;
   124     device->SetDisplayMode = WINRT_SetDisplayMode;
   118     device->PumpEvents = WINRT_PumpEvents;
   125     device->PumpEvents = WINRT_PumpEvents;
   119     device->GetWindowWMInfo = WINRT_GetWindowWMInfo;
   126     device->GetWindowWMInfo = WINRT_GetWindowWMInfo;
   120     device->free = WINRT_DeleteDevice;
   127     device->free = WINRT_DeleteDevice;
   121     SDL_WinRTGlobalApp->SetSDLVideoDevice(device);
   128     WINRT_GlobalSDLVideoDevice = NULL;
   122 
   129 
   123     return device;
   130     return device;
   124 }
   131 }
   125 
   132 
   126 #define WINRTVID_DRIVER_NAME "winrt"
   133 #define WINRTVID_DRIVER_NAME "winrt"