src/video/windowsrt/SDL_winrtvideo.cpp
changeset 8334 09b0670fece4
parent 8333 49973bfb8d23
child 8335 4f41add2ff00
     1.1 --- a/src/video/windowsrt/SDL_winrtvideo.cpp	Sun Oct 28 23:01:31 2012 -0400
     1.2 +++ b/src/video/windowsrt/SDL_winrtvideo.cpp	Sun Oct 28 23:20:18 2012 -0400
     1.3 @@ -137,8 +137,13 @@
     1.4  int
     1.5  WINRT_CreateWindow(_THIS, SDL_Window * window)
     1.6  {
     1.7 -    // TODO, WinRT: modify WINRT_Createwindow to ensure that, for now, only one window gets created
     1.8 -    // (until multimonitor support is added to the WinRT port).
     1.9 +    // Make sure that only one window gets created, at least until multimonitor
    1.10 +    // support is added.
    1.11 +    if (SDL_WinRTGlobalApp->HasSDLWindowData())
    1.12 +    {
    1.13 +        SDL_SetError("WinRT only supports one window");
    1.14 +        return -1;
    1.15 +    }
    1.16  
    1.17      SDL_WindowData *data;
    1.18      data = (SDL_WindowData *) SDL_calloc(1, sizeof(*data));
    1.19 @@ -163,7 +168,10 @@
    1.20  void
    1.21  WINRT_DestroyWindow(_THIS, SDL_Window * window)
    1.22  {
    1.23 -    SDL_WinRTGlobalApp->SetSDLWindowData(NULL);
    1.24 +    if (SDL_WinRTGlobalApp->HasSDLWindowData())
    1.25 +    {
    1.26 +        SDL_WinRTGlobalApp->SetSDLWindowData(NULL);
    1.27 +    }
    1.28  }
    1.29  
    1.30