pub struct EngineConfig {
pub window_title: String,
pub window_width: u32,
pub window_height: u32,
pub target_fps: u32,
pub vsync: bool,
pub audio: AudioConfig,
pub render: RenderConfig,
pub physics: PhysicsConfig,
pub input: InputConfig,
pub debug: DebugConfig,
pub gameplay: GameplayConfig,
pub accessibility: AccessibilityConfig,
}Expand description
Top-level engine configuration, loadable from a TOML file.
Fields§
§window_title: String§window_width: u32§window_height: u32§target_fps: u32§vsync: bool§audio: AudioConfig§render: RenderConfig§physics: PhysicsConfig§input: InputConfig§debug: DebugConfig§gameplay: GameplayConfig§accessibility: AccessibilityConfigImplementations§
Source§impl EngineConfig
impl EngineConfig
Sourcepub fn profile_low_end() -> Self
pub fn profile_low_end() -> Self
Low-end PC profile: reduced resolution, no post-fx, minimal effects.
Sourcepub fn profile_steam_deck() -> Self
pub fn profile_steam_deck() -> Self
Steam Deck profile: 1280×800 locked 60, moderate effects.
Sourcepub fn profile_ultra() -> Self
pub fn profile_ultra() -> Self
Ultra profile: max everything.
Sourcepub fn profile_debug() -> Self
pub fn profile_debug() -> Self
Debug profile: all overlays on, no vsync, fast timestep.
Sourcepub fn apply_args(&mut self, args: &[String])
pub fn apply_args(&mut self, args: &[String])
Parse and apply command-line arguments as overrides.
Supported flags: --width N, --height N, --fps N, --no-audio,
--no-vsync, --no-bloom, --fullscreen, --windowed.
pub fn aspect_ratio(&self) -> f32
Sourcepub fn is_widescreen(&self) -> bool
pub fn is_widescreen(&self) -> bool
Check if resolution is standard 16:9.
Sourcepub fn diff(&self, other: &Self) -> ConfigDiff
pub fn diff(&self, other: &Self) -> ConfigDiff
Check if the config differs from another (for hot-reload diffs).
Trait Implementations§
Source§impl Clone for EngineConfig
impl Clone for EngineConfig
Source§fn clone(&self) -> EngineConfig
fn clone(&self) -> EngineConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EngineConfig
impl Debug for EngineConfig
Source§impl Default for EngineConfig
impl Default for EngineConfig
Source§impl<'de> Deserialize<'de> for EngineConfig
impl<'de> Deserialize<'de> for EngineConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for EngineConfig
impl RefUnwindSafe for EngineConfig
impl Send for EngineConfig
impl Sync for EngineConfig
impl Unpin for EngineConfig
impl UnsafeUnpin for EngineConfig
impl UnwindSafe for EngineConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.