28 #include <SFML/Window/VideoMode.hpp> 29 #include <SFML/Window/VideoModeSupport.hpp> 40 std::vector<sf::VideoMode> SupportedModes;
94 return priv::VideoModeSupport::GetDesktopVideoMode();
104 if (SupportedModes.empty())
108 return SupportedModes[Index];
119 if (SupportedModes.empty())
122 return SupportedModes.size();
131 if (SupportedModes.empty())
134 return std::find(SupportedModes.begin(), SupportedModes.end(), *
this) != SupportedModes.end();
154 return !(*
this == Other);
161 void VideoMode::InitializeModes()
164 priv::VideoModeSupport::GetSupportedVideoModes(SupportedModes);
167 std::sort(SupportedModes.begin(), SupportedModes.end(), CompareModes());
static VideoMode GetDesktopMode()
Get the current desktop video mode.
bool operator!=(const VideoMode &Other) const
Comparison operator overload – tell if two video modes are different.
static VideoMode GetMode(std::size_t Index)
Get a valid video mode Index must be in range [0, GetModesCount()[ Modes are sorted from best to wors...
VideoMode defines a video mode (width, height, bpp, frequency) and provides static functions for gett...
VideoMode()
Default constructor.
unsigned int Width
Video mode width, in pixels.
bool operator==(const VideoMode &Other) const
Comparison operator overload – tell if two video modes are equal.
unsigned int Height
Video mode height, in pixels.
unsigned int BitsPerPixel
Video mode pixel depth, in bits per pixels.
static std::size_t GetModesCount()
Get valid video modes count.
bool IsValid() const
Tell whether or not the video mode is supported.