reduce power usage when window is defocused
This commit is contained in:
parent
de9b8d99e8
commit
7412eb082f
|
@ -115,6 +115,14 @@ fn main() {
|
||||||
mode: bevy_embedded_assets::PluginMode::ReplaceDefault,
|
mode: bevy_embedded_assets::PluginMode::ReplaceDefault,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Reduce power usage when unfocused
|
||||||
|
app.insert_resource(bevy::winit::WinitSettings {
|
||||||
|
focused_mode: bevy::winit::UpdateMode::Continuous,
|
||||||
|
unfocused_mode: bevy::winit::UpdateMode::reactive_low_power(
|
||||||
|
bevy::utils::Duration::from_secs(10),
|
||||||
|
),
|
||||||
|
});
|
||||||
|
|
||||||
app.add_plugins(OutFlyPlugin);
|
app.add_plugins(OutFlyPlugin);
|
||||||
app.insert_resource(prefs);
|
app.insert_resource(prefs);
|
||||||
app.run();
|
app.run();
|
||||||
|
|
Loading…
Reference in a new issue