docs
Loading...
Searching...
No Matches
Monitorabstract

#include <AppCore/Monitor.h>

Overview

A platform-specific monitor.

Coordinate Systems

A monitor may have a device scale applied by the OS (for example, a Retina display on macOS may have a 2x or 3x DPI scale).

Unadorned dimensions in this API are logical pixels (device-scale independent). The device_* accessors report physical device pixels. The two are related by scale():

device_pixels = round(logical_pixels * scale)
virtual double scale() const =0
Get the DPI scale (1.0 = 100%).

Public Member Functions

virtual ~Monitor ()
virtual uint32_t display_id () const =0
 Get the unique display ID of the monitor.
virtual double scale () const =0
 Get the DPI scale (1.0 = 100%).
virtual double width () const =0
 Get the width of the monitor (in logical pixels).
virtual double height () const =0
 Get the height of the monitor (in logical pixels).
virtual uint32_t device_width () const =0
 Get the width of the monitor (in device pixels).
virtual uint32_t device_height () const =0
 Get the height of the monitor (in device pixels).
virtual uint32_t refresh_rate () const =0
 Get the refresh rate of the monitor (in Hz).

Constructor & Destructor Documentation

◆ ~Monitor()

virtual ~Monitor ( )
inlinevirtual

Member Function Documentation

◆ device_height()

virtual uint32_t device_height ( ) const
pure virtual

Get the height of the monitor (in device pixels).

◆ device_width()

virtual uint32_t device_width ( ) const
pure virtual

Get the width of the monitor (in device pixels).

◆ display_id()

virtual uint32_t display_id ( ) const
pure virtual

Get the unique display ID of the monitor.

The renderer uses this ID to identify which monitor a View is on (ViewConfig::display_id).

The App tracks the refresh of each monitor it enumerates and automatically calls Renderer::RefreshDisplay() with this ID to drive animation in the corresponding Views.

See also
App::monitor()

◆ height()

virtual double height ( ) const
pure virtual

Get the height of the monitor (in logical pixels).

◆ refresh_rate()

virtual uint32_t refresh_rate ( ) const
pure virtual

Get the refresh rate of the monitor (in Hz).

This is the nominal rate of the monitor's current display mode (60 when the rate is unavailable). A variable-refresh display reports its maximum rate.

◆ scale()

virtual double scale ( ) const
pure virtual

Get the DPI scale (1.0 = 100%).

◆ width()

virtual double width ( ) const
pure virtual

Get the width of the monitor (in logical pixels).


The documentation for this class was generated from the following file: