Skip to content

Commit

Permalink
Change WinitPlugin defaults to limit game update rate when window …
Browse files Browse the repository at this point in the history
…is not visible (for real this time) (#11305)

# Objective

I goofed. #7611 forgot to change the default update modes set by the
`WinitPlugin`.


<https://github.com/bevyengine/bevy/blob/ce5bae55f64bb095e1516427a706a2622ccf2d23/crates/bevy_winit/src/winit_config.rs#L53-L60>


<https://github.com/bevyengine/bevy/blob/ce5bae55f64bb095e1516427a706a2622ccf2d23/crates/bevy_winit/src/lib.rs#L127>

## Solution

Change `Default` impl for `WinitSettings` to return the `game` settings
that limit FPS when the app runs in the background.
  • Loading branch information
maniwani authored Jan 15, 2024
1 parent 839d2f8 commit aeab690
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions crates/bevy_winit/src/winit_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ impl WinitSettings {

impl Default for WinitSettings {
fn default() -> Self {
WinitSettings {
focused_mode: UpdateMode::Continuous,
unfocused_mode: UpdateMode::Continuous,
}
WinitSettings::game()
}
}

Expand Down

0 comments on commit aeab690

Please sign in to comment.