2020-12-12 16:21:33 -05:00
|
|
|
use crate::Size;
|
2020-10-17 13:35:39 -05:00
|
|
|
|
|
|
|
/// The dpi scaling policy of the window
|
2021-02-10 17:01:49 +01:00
|
|
|
#[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,
|
2022-02-07 19:00:03 +01:00
|
|
|
|
|
|
|
/// 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>,
|
2020-12-12 16:21:33 -05:00
|
|
|
}
|