#[derive(Debug, Clone)]
pub struct EngineConfig {
pub window_title: String,
pub window_width: u32,
pub window_height: u32,
pub target_fps: u32,
pub gravity: f32,
pub clear_color: [u8; 4],
}
impl EngineConfig {
pub fn new() -> Self {
Self {
window_title: "SevenX Engine".to_string(),
window_width: 800,
window_height: 600,
target_fps: 60,
gravity: 980.0, clear_color: [0x10, 0x10, 0x10, 0xFF],
}
}
pub fn with_title(mut self, title: &str) -> Self {
self.window_title = title.to_string();
self
}
pub fn with_size(mut self, width: u32, height: u32) -> Self {
self.window_width = width;
self.window_height = height;
self
}
pub fn with_gravity(mut self, gravity: f32) -> Self {
self.gravity = gravity;
self
}
pub fn with_clear_color(mut self, r: u8, g: u8, b: u8, a: u8) -> Self {
self.clear_color = [r, g, b, a];
self
}
}
impl Default for EngineConfig {
fn default() -> Self {
Self::new()
}
}