1
0
Fork 0

Display/DisplayMode: adding empty()

This commit is contained in:
Henrik Hautakoski 2020-11-05 17:01:25 +01:00
parent c2b0d73888
commit b43f2fcca8
2 changed files with 14 additions and 0 deletions

View file

@ -16,6 +16,15 @@ public :
static DisplayMode getDesktopMode();
// Returns true if width hight and bpp are not set (eg. zero)
// useful to determine if a DisplayMode object is set or not.
// this is equal to:
// DisplayMode a;
// if (a == DisplayMode()) {
// // empty
// }
bool empty() const;
inline bool operator==(const DisplayMode& other)
{
return width == other.width

View file

@ -55,4 +55,9 @@ DisplayMode DisplayMode::getDesktopMode()
return PlatformMisc::GetDesktopMode();
}
bool DisplayMode::empty() const
{
return (width + height + bpp) == 0;
}
} // namespace sp