mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 22:31:09 +08:00
Implement 'getFullscreenModes' more concisely
This commit is contained in:
parent
2af0ba66f1
commit
973055c1f5
@ -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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user