|
@@ -478,13 +478,13 @@ bool Window::setWindow(int width, int height, WindowSettings *settings)
|
|
f.minwidth = std::max(f.minwidth, 1);
|
|
f.minwidth = std::max(f.minwidth, 1);
|
|
f.minheight = std::max(f.minheight, 1);
|
|
f.minheight = std::max(f.minheight, 1);
|
|
|
|
|
|
- f.display = std::min(std::max(f.display, 0), getDisplayCount() - 1);
|
|
|
|
|
|
+ f.displayindex = std::min(std::max(f.displayindex, 0), getDisplayCount() - 1);
|
|
|
|
|
|
// Use the desktop resolution if a width or height of 0 is specified.
|
|
// Use the desktop resolution if a width or height of 0 is specified.
|
|
if (width == 0 || height == 0)
|
|
if (width == 0 || height == 0)
|
|
{
|
|
{
|
|
SDL_DisplayMode mode = {};
|
|
SDL_DisplayMode mode = {};
|
|
- SDL_GetDesktopDisplayMode(f.display, &mode);
|
|
|
|
|
|
+ SDL_GetDesktopDisplayMode(f.displayindex, &mode);
|
|
width = mode.w;
|
|
width = mode.w;
|
|
height = mode.h;
|
|
height = mode.h;
|
|
}
|
|
}
|
|
@@ -509,16 +509,16 @@ bool Window::setWindow(int width, int height, WindowSettings *settings)
|
|
{
|
|
{
|
|
// The position needs to be in the global coordinate space.
|
|
// The position needs to be in the global coordinate space.
|
|
SDL_Rect displaybounds = {};
|
|
SDL_Rect displaybounds = {};
|
|
- SDL_GetDisplayBounds(f.display, &displaybounds);
|
|
|
|
|
|
+ SDL_GetDisplayBounds(f.displayindex, &displaybounds);
|
|
x += displaybounds.x;
|
|
x += displaybounds.x;
|
|
y += displaybounds.y;
|
|
y += displaybounds.y;
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
if (f.centered)
|
|
if (f.centered)
|
|
- x = y = SDL_WINDOWPOS_CENTERED_DISPLAY(f.display);
|
|
|
|
|
|
+ x = y = SDL_WINDOWPOS_CENTERED_DISPLAY(f.displayindex);
|
|
else
|
|
else
|
|
- x = y = SDL_WINDOWPOS_UNDEFINED_DISPLAY(f.display);
|
|
|
|
|
|
+ x = y = SDL_WINDOWPOS_UNDEFINED_DISPLAY(f.displayindex);
|
|
}
|
|
}
|
|
|
|
|
|
SDL_DisplayMode fsmode = {0, width, height, 0, nullptr};
|
|
SDL_DisplayMode fsmode = {0, width, height, 0, nullptr};
|
|
@@ -526,12 +526,12 @@ bool Window::setWindow(int width, int height, WindowSettings *settings)
|
|
if (f.fullscreen && f.fstype == FULLSCREEN_EXCLUSIVE)
|
|
if (f.fullscreen && f.fstype == FULLSCREEN_EXCLUSIVE)
|
|
{
|
|
{
|
|
// Fullscreen window creation will bug out if no mode can be used.
|
|
// Fullscreen window creation will bug out if no mode can be used.
|
|
- if (SDL_GetClosestDisplayMode(f.display, &fsmode, &fsmode) == nullptr)
|
|
|
|
|
|
+ if (SDL_GetClosestDisplayMode(f.displayindex, &fsmode, &fsmode) == nullptr)
|
|
{
|
|
{
|
|
// GetClosestDisplayMode will fail if we request a size larger
|
|
// GetClosestDisplayMode will fail if we request a size larger
|
|
// than the largest available display mode, so we'll try to use
|
|
// than the largest available display mode, so we'll try to use
|
|
// the largest (first) mode in that case.
|
|
// the largest (first) mode in that case.
|
|
- if (SDL_GetDisplayMode(f.display, 0, &fsmode) < 0)
|
|
|
|
|
|
+ if (SDL_GetDisplayMode(f.displayindex, 0, &fsmode) < 0)
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -607,7 +607,7 @@ bool Window::setWindow(int width, int height, WindowSettings *settings)
|
|
// Enforce minimum window dimensions.
|
|
// Enforce minimum window dimensions.
|
|
SDL_SetWindowMinimumSize(window, f.minwidth, f.minheight);
|
|
SDL_SetWindowMinimumSize(window, f.minwidth, f.minheight);
|
|
|
|
|
|
- if (this->settings.display != f.display || f.useposition || f.centered)
|
|
|
|
|
|
+ if (this->settings.displayindex != f.displayindex || f.useposition || f.centered)
|
|
SDL_SetWindowPosition(window, x, y);
|
|
SDL_SetWindowPosition(window, x, y);
|
|
|
|
|
|
SDL_RaiseWindow(window);
|
|
SDL_RaiseWindow(window);
|
|
@@ -727,7 +727,7 @@ void Window::updateSettings(const WindowSettings &newsettings, bool updateGraphi
|
|
settings.borderless = (wflags & SDL_WINDOW_BORDERLESS) != 0;
|
|
settings.borderless = (wflags & SDL_WINDOW_BORDERLESS) != 0;
|
|
settings.centered = newsettings.centered;
|
|
settings.centered = newsettings.centered;
|
|
|
|
|
|
- getPosition(settings.x, settings.y, settings.display);
|
|
|
|
|
|
+ getPosition(settings.x, settings.y, settings.displayindex);
|
|
|
|
|
|
setHighDPIAllowed((wflags & SDL_WINDOW_ALLOW_HIGHDPI) != 0);
|
|
setHighDPIAllowed((wflags & SDL_WINDOW_ALLOW_HIGHDPI) != 0);
|
|
|
|
|
|
@@ -745,7 +745,7 @@ void Window::updateSettings(const WindowSettings &newsettings, bool updateGraphi
|
|
settings.depth = newsettings.depth;
|
|
settings.depth = newsettings.depth;
|
|
|
|
|
|
SDL_DisplayMode dmode = {};
|
|
SDL_DisplayMode dmode = {};
|
|
- SDL_GetCurrentDisplayMode(settings.display, &dmode);
|
|
|
|
|
|
+ SDL_GetCurrentDisplayMode(settings.displayindex, &dmode);
|
|
|
|
|
|
// May be 0 if the refresh rate can't be determined.
|
|
// May be 0 if the refresh rate can't be determined.
|
|
settings.refreshrate = (double) dmode.refresh_rate;
|
|
settings.refreshrate = (double) dmode.refresh_rate;
|