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: StringText shown in the window title bar.
window_width: u32Window width in pixels.
window_height: u32Window height in pixels.
target_fps: u32Frame-rate cap in frames per second; 0 means uncapped, otherwise clamped to 15 to 360 by validate.
vsync: boolWait for the display refresh before presenting each frame.
audio: AudioConfigSound settings.
render: RenderConfigRendering and post-processing settings.
physics: PhysicsConfigPhysics simulation settings.
input: InputConfigMouse, keyboard and gamepad settings.
debug: DebugConfigDebug overlays and logging settings.
gameplay: GameplayConfigGame rules such as seed, difficulty and autosave.
accessibility: AccessibilityConfigAccessibility options such as colourblind mode and reduced motion.
Implementations§
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.
Sourcepub fn aspect_ratio(&self) -> f32
pub fn aspect_ratio(&self) -> f32
Window width divided by height.
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§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>,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more