game_screen.h¶
| File Path | engine/include/conjure/engine/game_screen.h |
| API ↗ | Engine: the application and the frame |
The screen a game draws to, as game_screen_of reports it.
Structs¶
| File | Description |
|---|---|
game_screen |
The screen a game draws to, as game_screen_of reports it. |
Functions¶
Public¶
game_screen_of¶
game_screen_of¶[[nodiscard]] inline game_screen game_screen_of(
const platform::window *window) noexcept;The screen of window: its framebuffer in pixels (0 x 0 while minimised), content_scale(), the UI scale of the monitor under the window centre (position() + window_size() / 2, see monitor_ui_scale) and the focus, minimised and fullscreen states. A null window gives a default game_screen (0 x 0, scales 1, every state false). On a backend that cannot learn the window position (glfw on Wayland), position() is the last one requested, so the UI scale can be another monitor's than the one showing the window. Main thread only, like every window call.
monitor_ui_scale¶
monitor_ui_scale¶[[nodiscard]] inline f32 monitor_ui_scale(
std::span<const platform::monitor_info> monitors,
math::ivec2 point) noexcept;The UI scale (contentScale.y) of the first monitor whose bounds contain point: the rectangle from monitor_info::position spanning currentMode's width and height, in the virtual desktop coordinates that window::position() uses (screen coordinates: pixels, points on macOS). The bounds are used, not the work area, because a backend clamps a negative work area origin to 0 (a monitor left of or above the primary would then cover the wrong place) and a point over a task bar still belongs to its monitor. A monitor whose current mode is 0 x 0 contains nothing. When no monitor contains the point, the primary monitor's scale (the first monitor's when none is marked primary); 1 when there are no monitors or the scale found is not a positive finite number.