#include <display.h>
Public Types | |
| enum | EOrientation : int8 { Unknown = 0, Landscape = 1, LandscapeFlipped = 2, Portrait = 3, PortraitFlipped = 4 } |
Public Member Functions | |
| Display ()=default | |
| Display (int index) | |
| bool | isValid () const |
| int | getIndex () const |
| const std::string & | getName () const |
| const glm::ivec2 & | getMin () const |
| const glm::ivec2 & | getMax () const |
| math::Rect | getBounds () const |
| float | getContentScale () const |
| float | getDPI () const |
| EOrientation | getOrientation () const |
| float | getDiagonalDPI () const |
| float | getHorizontalDPI () const |
| float | getVerticalDPI () const |
| std::string | toString () const |
| bool | operator== (const Display &rhs) const |
| bool | operator!= (const Display &rhs) const |
Display information.
The information provided by this interface isn't required to remain valid. When a display is re-connected, or even turned on/off, the index is re-assigned and this object becomes invalid.
|
strong |
Display orientation modes
| Enumerator | |
|---|---|
| Unknown | |
| Landscape | |
| LandscapeFlipped | |
| Portrait | |
| PortraitFlipped | |
|
default |
Construct a default, invalid display
| Display | ( | int | index | ) |
Construct display information, index must be >= 0.
| index | display index |
| math::Rect getBounds | ( | ) | const |
| float getContentScale | ( | ) | const |
Get the content scale of a display.
The content scale is the expected scale for content based on the DPI settings of the display. For example, a 4K display might have a 2.0 (200%) display scale, which means that the user expects UI elements to be twice as big on this display, to aid in readability.
| float getDiagonalDPI | ( | ) | const |
Deprecated: use Display::getDPI() instead.
| float getDPI | ( | ) | const |
Returns the approximated display DPI: 96 * 'display content scale'
| float getHorizontalDPI | ( | ) | const |
Deprecated: use Display::getDPI() instead.
| int getIndex | ( | ) | const |
Current display index, as given on construction. Note that his index becomes invalid when the display is re-connected.
| const glm::ivec2& getMax | ( | ) | const |
| const glm::ivec2& getMin | ( | ) | const |
| const std::string& getName | ( | ) | const |
Returns display name, empty if not available.
| EOrientation getOrientation | ( | ) | const |
| float getVerticalDPI | ( | ) | const |
Deprecated: use Display::getDPI() instead.
| bool isValid | ( | ) | const |
If information is available.
| bool operator!= | ( | const Display & | rhs | ) | const |
| bool operator== | ( | const Display & | rhs | ) | const |
| std::string toString | ( | ) | const |