1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! The options of the DRM output (the port of `DrmOutputOptions.cs`).
use crate::DrmConnectorType;
use ferroui_base::media::Color;
use ferroui_base::platform::SurfaceOrientation;
use ferroui_base::PixelSize;
/// DRM Output Options
#[derive(Clone, Debug, PartialEq)]
pub struct DrmOutputOptions {
/// Scaling factor.
/// Default: 1.0
pub scaling: f64,
/// The orientation of the screen relative to the frame buffer memory orientation
/// Default: Normal
pub orientation: SurfaceOrientation,
/// If true an two cycle buffer swapping is processed at init.
/// Default: True
pub enable_initial_buffer_swapping: bool,
/// Color for [`enable_initial_buffer_swapping`](Self::enable_initial_buffer_swapping)
/// Default: R0 G0 B0 A0
pub initial_buffer_swapping_color: Color,
/// Specifies the video mode with which the DrmOutput should be created, if it is not found it will fallback to the preferred mode.
/// If null, the preferred mode will be used.
pub video_mode: Option<PixelSize>,
/// Specifies whether our connector is HDMI-A, DVI, DisplayPort, etc.
/// If null, the preferred connector will be used.
pub connector_type: Option<DrmConnectorType>,
/// Specifies the connector type ID used with [`connector_type`](Self::connector_type).
/// If null, the preferred connector type ID will be used.
pub connector_type_id: Option<u32>,
}
impl Default for DrmOutputOptions {
fn default() -> Self {
Self {
scaling: 1.0,
orientation: SurfaceOrientation::Rotation0,
enable_initial_buffer_swapping: true,
initial_buffer_swapping_color: Color::new(0, 0, 0, 0),
video_mode: None,
connector_type: None,
connector_type_id: None,
}
}
}