1
0
Fork 0
baseview/src/window_open_options.rs

30 lines
903 B
Rust
Raw Normal View History

use crate::Size;
2020-10-17 13:35:39 -05:00
/// The dpi scaling policy of the window
#[derive(Debug, Clone, Copy, PartialEq)]
2020-10-17 13:35:39 -05:00
pub enum WindowScalePolicy {
2020-10-20 19:02:45 -05:00
/// Use the system's dpi scale factor
SystemScaleFactor,
/// Use the given dpi scale factor (e.g. `1.0` = 96 dpi)
2020-10-20 19:11:47 -05:00
ScaleFactor(f64),
2020-10-17 13:35:39 -05:00
}
/// The options for opening a new window
pub struct WindowOpenOptions {
pub title: String,
2020-10-20 19:17:20 -05:00
/// The logical size of the window.
///
/// These dimensions will be scaled by the scaling policy specified in `scale`. Mouse
2020-10-20 19:18:42 -05:00
/// position will be passed back as logical coordinates.
2020-10-20 19:02:45 -05:00
pub size: Size,
2020-10-17 13:35:39 -05:00
2020-10-20 19:02:45 -05:00
/// The dpi scaling policy
2020-10-17 13:35:39 -05:00
pub scale: WindowScalePolicy,
/// If provided, then an OpenGL context will be created for this window. You'll be able to
/// access this context through [crate::Window::gl_context].
#[cfg(feature = "opengl")]
pub gl_config: Option<crate::gl::GlConfig>,
}