mirror of
https://github.com/yawut/SDL.git
synced 2026-04-16 05:45:52 -05:00
WinRT: explicitly allowed only one window at a time, pending multimonitor support (in SDL/WinRT)
This commit is contained in:
parent
62d66e244e
commit
63cedf50fe
|
|
@ -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 @@ internal:
|
|||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user