Implement 'getFullscreenModes' more concisely

This commit is contained in:
vittorioromeo 2023-04-24 01:42:53 +02:00 committed by Vittorio Romeo
parent 2af0ba66f1
commit 973055c1f5
2 changed files with 4 additions and 10 deletions

View File

@ -37,13 +37,10 @@ namespace sf::priv
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
std::vector<VideoMode> VideoModeImpl::getFullscreenModes() std::vector<VideoMode> VideoModeImpl::getFullscreenModes()
{ {
VideoMode desktop = getDesktopMode(); const VideoMode desktop = getDesktopMode();
// Return both portrait and landscape resolutions // Return both portrait and landscape resolutions
std::vector<VideoMode> modes; return {desktop, VideoMode(Vector2u(desktop.size.y, desktop.size.x), desktop.bitsPerPixel)};
modes.push_back(desktop);
modes.emplace_back(Vector2u(desktop.size.y, desktop.size.x), desktop.bitsPerPixel);
return modes;
} }

View File

@ -35,13 +35,10 @@ namespace sf::priv
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
std::vector<VideoMode> VideoModeImpl::getFullscreenModes() std::vector<VideoMode> VideoModeImpl::getFullscreenModes()
{ {
VideoMode desktop = getDesktopMode(); const VideoMode desktop = getDesktopMode();
// Return both portrait and landscape resolutions // Return both portrait and landscape resolutions
std::vector<VideoMode> modes; return {desktop, VideoMode(Vector2u(desktop.size.y, desktop.size.x), desktop.bitsPerPixel)};
modes.push_back(desktop);
modes.emplace_back(Vector2u(desktop.size.y, desktop.size.x), desktop.bitsPerPixel);
return modes;
} }