pub struct EngineConfig { /* private fields */ }Expand description
Unified engine configuration combining window settings and provider selection.
EngineConfig delegates window/display settings to GameConfig and
provider selection to ProviderRegistryBuilder. Call build()
to consume the builder and obtain both parts.
Implementations§
Source§impl EngineConfig
impl EngineConfig
Sourcepub fn new() -> EngineConfig
pub fn new() -> EngineConfig
Creates a new EngineConfig with default settings and null providers.
Sourcepub fn with_title(self, title: impl Into<String>) -> EngineConfig
pub fn with_title(self, title: impl Into<String>) -> EngineConfig
Sets the window title.
Sourcepub fn with_size(self, width: u32, height: u32) -> EngineConfig
pub fn with_size(self, width: u32, height: u32) -> EngineConfig
Sets the window dimensions.
Sourcepub fn with_vsync(self, enabled: bool) -> EngineConfig
pub fn with_vsync(self, enabled: bool) -> EngineConfig
Enables or disables vertical sync.
Sourcepub fn with_fullscreen(self, enabled: bool) -> EngineConfig
pub fn with_fullscreen(self, enabled: bool) -> EngineConfig
Enables or disables fullscreen mode.
Sourcepub fn with_target_fps(self, fps: u32) -> EngineConfig
pub fn with_target_fps(self, fps: u32) -> EngineConfig
Sets the target frames per second (0 = unlimited).
Sourcepub fn with_fps_overlay(self, enabled: bool) -> EngineConfig
pub fn with_fps_overlay(self, enabled: bool) -> EngineConfig
Enables or disables the FPS stats overlay.
Sourcepub fn with_game_config(self, config: GameConfig) -> EngineConfig
pub fn with_game_config(self, config: GameConfig) -> EngineConfig
Replaces the entire GameConfig with the provided one.
Sourcepub fn with_render_provider(
self,
provider: impl RenderProvider + 'static,
) -> EngineConfig
pub fn with_render_provider( self, provider: impl RenderProvider + 'static, ) -> EngineConfig
Sets the render provider.
Sourcepub fn with_physics_provider(
self,
provider: impl PhysicsProvider + 'static,
) -> EngineConfig
pub fn with_physics_provider( self, provider: impl PhysicsProvider + 'static, ) -> EngineConfig
Sets the physics provider.
Sourcepub fn with_audio_provider(
self,
provider: impl AudioProvider + 'static,
) -> EngineConfig
pub fn with_audio_provider( self, provider: impl AudioProvider + 'static, ) -> EngineConfig
Sets the audio provider.
Sourcepub fn with_input_provider(
self,
provider: impl InputProvider + 'static,
) -> EngineConfig
pub fn with_input_provider( self, provider: impl InputProvider + 'static, ) -> EngineConfig
Sets the input provider.
Sourcepub fn build(self) -> (GameConfig, ProviderRegistry)
pub fn build(self) -> (GameConfig, ProviderRegistry)
Consumes the builder and returns the GameConfig and ProviderRegistry.
Sourcepub fn game_config(&self) -> &GameConfig
pub fn game_config(&self) -> &GameConfig
Returns a reference to the current game configuration.
Trait Implementations§
Source§impl Default for EngineConfig
impl Default for EngineConfig
Source§fn default() -> EngineConfig
fn default() -> EngineConfig
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
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().