Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
WinRT: explicitly allowed only one window at a time, pending multimon…
…itor support (in SDL/WinRT)
- Loading branch information
|
@@ -198,6 +198,11 @@ SDL_DisplayMode SDL_WinRTApp::GetMainDisplayMode() |
|
|
return mode; |
|
|
} |
|
|
|
|
|
bool SDL_WinRTApp::HasSDLWindowData() const |
|
|
{ |
|
|
return (m_sdlWindowData != NULL); |
|
|
} |
|
|
|
|
|
void SDL_WinRTApp::SetSDLWindowData(const SDL_WindowData* windowData) |
|
|
{ |
|
|
m_sdlWindowData = windowData; |
|
|
|
@@ -23,6 +23,7 @@ ref class SDL_WinRTApp sealed : public Windows::ApplicationModel::Core::IFramewo |
|
|
// SDL-specific methods |
|
|
SDL_DisplayMode GetMainDisplayMode(); |
|
|
void PumpEvents(); |
|
|
bool HasSDLWindowData() const; |
|
|
void SetSDLWindowData(const SDL_WindowData* windowData); |
|
|
|
|
|
protected: |
|
|
|
@@ -137,8 +137,13 @@ WINRT_VideoQuit(_THIS) |
|
|
int |
|
|
WINRT_CreateWindow(_THIS, SDL_Window * window) |
|
|
{ |
|
|
// TODO, WinRT: modify WINRT_Createwindow to ensure that, for now, only one window gets created |
|
|
// (until multimonitor support is added to the WinRT port). |
|
|
// Make sure that only one window gets created, at least until multimonitor |
|
|
// support is added. |
|
|
if (SDL_WinRTGlobalApp->HasSDLWindowData()) |
|
|
{ |
|
|
SDL_SetError("WinRT only supports one window"); |
|
|
return -1; |
|
|
} |
|
|
|
|
|
SDL_WindowData *data; |
|
|
data = (SDL_WindowData *) SDL_calloc(1, sizeof(*data)); |
|
@@ -163,7 +168,10 @@ WINRT_CreateWindow(_THIS, SDL_Window * window) |
|
|
void |
|
|
WINRT_DestroyWindow(_THIS, SDL_Window * window) |
|
|
{ |
|
|
SDL_WinRTGlobalApp->SetSDLWindowData(NULL); |
|
|
if (SDL_WinRTGlobalApp->HasSDLWindowData()) |
|
|
{ |
|
|
SDL_WinRTGlobalApp->SetSDLWindowData(NULL); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|