src/video/windowsrt/SDL_winrtvideo.cpp
changeset 8424 3cf9501008f1
parent 8417 43f837ba544b
child 8433 3017f87e4479
equal deleted inserted replaced
8423:61f9a3eb6bc8 8424:3cf9501008f1
   220 void
   220 void
   221 WINRT_DestroyWindow(_THIS, SDL_Window * window)
   221 WINRT_DestroyWindow(_THIS, SDL_Window * window)
   222 {
   222 {
   223     SDL_WindowData * data = (SDL_WindowData *) window->driverdata;
   223     SDL_WindowData * data = (SDL_WindowData *) window->driverdata;
   224 
   224 
       
   225     if (SDL_WinRTGlobalApp->HasSDLWindowData() &&
       
   226         SDL_WinRTGlobalApp->GetSDLWindowData()->sdlWindow == window)
       
   227     {
       
   228         SDL_WinRTGlobalApp->SetSDLWindowData(NULL);
       
   229     }
       
   230 
   225     if (data) {
   231     if (data) {
   226         // Delete the reference to the WinRT CoreWindow:
   232         // Delete the reference to the WinRT CoreWindow:
   227         CoreWindow ^* windowPointer = ((SDL_WindowData *) window->driverdata)->coreWindow;
   233         CoreWindow ^* windowPointer = ((SDL_WindowData *) window->driverdata)->coreWindow;
   228         if (windowPointer) {
   234         if (windowPointer) {
   229             *windowPointer = nullptr;   // Clear the C++/CX reference to the CoreWindow
   235             *windowPointer = nullptr;   // Clear the C++/CX reference to the CoreWindow
   231         }
   237         }
   232 
   238 
   233         // Delete the internal window data:
   239         // Delete the internal window data:
   234         delete data;
   240         delete data;
   235         data = NULL;
   241         data = NULL;
   236     }
       
   237 
       
   238     if (SDL_WinRTGlobalApp->HasSDLWindowData() &&
       
   239         SDL_WinRTGlobalApp->GetSDLWindowData()->sdlWindow == window)
       
   240     {
       
   241         SDL_WinRTGlobalApp->SetSDLWindowData(NULL);
       
   242     }
   242     }
   243 }
   243 }
   244 
   244 
   245 SDL_bool
   245 SDL_bool
   246 WINRT_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
   246 WINRT_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)