Loading...
Searching...
No Matches
Monitor.h
Go to the documentation of this file.
1/**************************************************************************************************
2 * This file is a part of Ultralight. *
3 * *
4 * See <https://ultralig.ht> for licensing and more. *
5 * *
6 * (C) 2024 Ultralight, Inc. *
7 **************************************************************************************************/
8#pragma once
9#include "Defines.h"
10
11namespace ultralight {
12
13///
14/// A platform-specific monitor.
15///
17public:
18 virtual ~Monitor() {}
19
20 ///
21 /// Get the unique display ID of the monitor.
22 ///
23 /// The renderer uses this ID to identify which monitor a View is on (ViewConfig::display_id).
24 ///
25 /// AppCore internally tracks the display's hardware refresh event and automatically calls
26 /// Renderer::RefreshDisplay(id) to drive animation in all corresponding Views.
27 ///
28 virtual uint32_t display_id() const = 0;
29
30 ///
31 /// Get the DPI scale (1.0 = 100%)
32 ///
33 virtual double scale() const = 0;
34
35 ///
36 /// Get the width of the monitor (in pixels).
37 ///
38 virtual uint32_t width() const = 0;
39
40 ///
41 /// Get the height of the monitor (in pixels).
42 ///
43 virtual uint32_t height() const = 0;
44
45 ///
46 /// Get the refresh rate of the monitor (in Hz).
47 ///
48 virtual uint32_t refresh_rate() const = 0;
49};
50
51} // namespace ultralight
#define AExport
Definition Defines.h:42
A platform-specific monitor.
Definition Monitor.h:16
virtual ~Monitor()
Definition Monitor.h:18
virtual uint32_t height() const =0
Get the height of the monitor (in pixels).
virtual double scale() const =0
Get the DPI scale (1.0 = 100%)
virtual uint32_t width() const =0
Get the width of the monitor (in pixels).
virtual uint32_t refresh_rate() const =0
Get the refresh rate of the monitor (in Hz).
virtual uint32_t display_id() const =0
Get the unique display ID of the monitor.
Definition App.h:14