#[derive(Debug, Clone)]
pub struct WindowSettings {
pub title: String,
pub size: (u32, u32),
pub resizable: bool,
pub vsync: bool,
pub maximized: bool,
pub fullscreen: bool,
}
impl Default for WindowSettings {
fn default() -> Self {
Self {
title: "rein".to_string(),
size: (1280, 720),
resizable: true,
vsync: true,
maximized: false,
fullscreen: false,
}
}
}
impl WindowSettings {
pub fn new() -> Self {
Self::default()
}
pub fn title(mut self, title: impl Into<String>) -> Self {
self.title = title.into();
self
}
pub fn size(mut self, width: u32, height: u32) -> Self {
self.size = (width, height);
self
}
pub fn resizable(mut self, resizable: bool) -> Self {
self.resizable = resizable;
self
}
pub fn vsync(mut self, vsync: bool) -> Self {
self.vsync = vsync;
self
}
pub fn maximized(mut self, maximized: bool) -> Self {
self.maximized = maximized;
self
}
pub fn fullscreen(mut self, fullscreen: bool) -> Self {
self.fullscreen = fullscreen;
self
}
}