viewbuilder/window/
builder.rs

1use crate::Window;
2use winit::window::WindowBuilder;
3
4pub struct Builder {
5    raw: Option<WindowBuilder>,
6}
7
8impl Default for Builder {
9    fn default() -> Self {
10        Self {
11            raw: Some(WindowBuilder::new()),
12        }
13    }
14}
15
16impl Builder {
17    pub fn active(&mut self, active: bool) -> &mut Self {
18        self.raw = Some(self.raw.take().unwrap().with_active(active));
19        self
20    }
21
22    pub fn build(&mut self) -> Window {
23        Window::from_builder(self.raw.take().unwrap())
24    }
25}