From d70021fa68b556e20638f29e2e303f6d156afdb6 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 25 Nov 2019 14:17:13 +0100 Subject: Allow `Application` configuration with `Settings` --- winit/src/settings.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 winit/src/settings.rs (limited to 'winit/src/settings.rs') diff --git a/winit/src/settings.rs b/winit/src/settings.rs new file mode 100644 index 00000000..d257ecd8 --- /dev/null +++ b/winit/src/settings.rs @@ -0,0 +1,29 @@ +//! Configure your application. + +/// The settings of an application. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] +pub struct Settings { + /// The [`Window`] settings + /// + /// [`Window`]: struct.Window.html + pub window: Window, +} + +/// The window settings of an application. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct Window { + /// The size of the window. + pub size: (u32, u32), + + /// Whether the window should be resizable or not. + pub resizable: bool, +} + +impl Default for Window { + fn default() -> Window { + Window { + size: (1024, 768), + resizable: true, + } + } +} -- cgit