From cb73c8a2e9e8fa5aa5904f0664cef054a9852c00 Mon Sep 17 00:00:00 2001 From: AlephCubed Date: Wed, 8 Jan 2025 10:24:28 -0800 Subject: [PATCH 1/5] Added to `MinimalPlugins` documentation. --- crates/bevy_internal/src/default_plugins.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/crates/bevy_internal/src/default_plugins.rs b/crates/bevy_internal/src/default_plugins.rs index 950f984a64011..a6265a2ba08fe 100644 --- a/crates/bevy_internal/src/default_plugins.rs +++ b/crates/bevy_internal/src/default_plugins.rs @@ -119,4 +119,17 @@ plugin_group! { /// It includes a [schedule runner (`ScheduleRunnerPlugin`)](crate::app::ScheduleRunnerPlugin) /// to provide functionality that would otherwise be driven by a windowed application's /// *event loop* or *message loop*. + /// Note that this loop will run as fast as possible by default, + /// which can result in high CPU usage. + /// You can add a delay using [`run_loop`](crate::app::ScheduleRunnerPlugin::run_loop), + /// or remove the loop using [`run_once`](crate::app::ScheduleRunnerPlugin::run_once). + /// # Example: + /// ```rust + /// # use std::time::Duration; + /// # use bevy_app::{App, PluginGroup, ScheduleRunnerPlugin}; + /// # use bevy_internal::MinimalPlugins; + /// App::new().add_plugins(MinimalPlugins.set(ScheduleRunnerPlugin::run_loop( + /// // Run 60 times per second. + /// Duration::from_secs_f64(1.0 / 60.0), + /// ))).run(); } From 51ca8b55faec777985b88b7294b331644b0d5b1e Mon Sep 17 00:00:00 2001 From: AlephCubed Date: Wed, 8 Jan 2025 10:55:22 -0800 Subject: [PATCH 2/5] Simplified `MinimalPlugins` docs. --- crates/bevy_internal/src/default_plugins.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/bevy_internal/src/default_plugins.rs b/crates/bevy_internal/src/default_plugins.rs index a6265a2ba08fe..4f2d2c113e219 100644 --- a/crates/bevy_internal/src/default_plugins.rs +++ b/crates/bevy_internal/src/default_plugins.rs @@ -119,8 +119,7 @@ plugin_group! { /// It includes a [schedule runner (`ScheduleRunnerPlugin`)](crate::app::ScheduleRunnerPlugin) /// to provide functionality that would otherwise be driven by a windowed application's /// *event loop* or *message loop*. - /// Note that this loop will run as fast as possible by default, - /// which can result in high CPU usage. + /// By default, this loop will run as fast as possible, which can result in high CPU usage. /// You can add a delay using [`run_loop`](crate::app::ScheduleRunnerPlugin::run_loop), /// or remove the loop using [`run_once`](crate::app::ScheduleRunnerPlugin::run_once). /// # Example: From b28c2e950e4295410e2c27286124c38b18dd32bb Mon Sep 17 00:00:00 2001 From: AlephCubed <76791009+AlephCubed@users.noreply.github.com> Date: Wed, 8 Jan 2025 11:35:17 -0800 Subject: [PATCH 3/5] Updated formatting for `MinimalPlugins` docs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: François Mockers --- crates/bevy_internal/src/default_plugins.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/bevy_internal/src/default_plugins.rs b/crates/bevy_internal/src/default_plugins.rs index 4f2d2c113e219..54ddc237238cd 100644 --- a/crates/bevy_internal/src/default_plugins.rs +++ b/crates/bevy_internal/src/default_plugins.rs @@ -119,6 +119,7 @@ plugin_group! { /// It includes a [schedule runner (`ScheduleRunnerPlugin`)](crate::app::ScheduleRunnerPlugin) /// to provide functionality that would otherwise be driven by a windowed application's /// *event loop* or *message loop*. + /// /// By default, this loop will run as fast as possible, which can result in high CPU usage. /// You can add a delay using [`run_loop`](crate::app::ScheduleRunnerPlugin::run_loop), /// or remove the loop using [`run_once`](crate::app::ScheduleRunnerPlugin::run_once). From 37bd92b19dc91a817ca42a3fa9d22510fdca7b69 Mon Sep 17 00:00:00 2001 From: AlephCubed Date: Wed, 8 Jan 2025 12:22:31 -0800 Subject: [PATCH 4/5] Removed `run` from `MinimalPlugins` example. --- crates/bevy_internal/src/default_plugins.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_internal/src/default_plugins.rs b/crates/bevy_internal/src/default_plugins.rs index 54ddc237238cd..d944c435cb48c 100644 --- a/crates/bevy_internal/src/default_plugins.rs +++ b/crates/bevy_internal/src/default_plugins.rs @@ -131,5 +131,5 @@ plugin_group! { /// App::new().add_plugins(MinimalPlugins.set(ScheduleRunnerPlugin::run_loop( /// // Run 60 times per second. /// Duration::from_secs_f64(1.0 / 60.0), - /// ))).run(); + /// ))); } From cb5dc1964666f114a4ed79df03cd39836e50bfbc Mon Sep 17 00:00:00 2001 From: AlephCubed <76791009+AlephCubed@users.noreply.github.com> Date: Wed, 8 Jan 2025 12:42:40 -0800 Subject: [PATCH 5/5] Changed `MinimalPlugins` example to be `no_run`. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: François Mockers --- crates/bevy_internal/src/default_plugins.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bevy_internal/src/default_plugins.rs b/crates/bevy_internal/src/default_plugins.rs index d944c435cb48c..d6e588ede1491 100644 --- a/crates/bevy_internal/src/default_plugins.rs +++ b/crates/bevy_internal/src/default_plugins.rs @@ -124,12 +124,12 @@ plugin_group! { /// You can add a delay using [`run_loop`](crate::app::ScheduleRunnerPlugin::run_loop), /// or remove the loop using [`run_once`](crate::app::ScheduleRunnerPlugin::run_once). /// # Example: - /// ```rust + /// ```rust, no_run /// # use std::time::Duration; /// # use bevy_app::{App, PluginGroup, ScheduleRunnerPlugin}; /// # use bevy_internal::MinimalPlugins; /// App::new().add_plugins(MinimalPlugins.set(ScheduleRunnerPlugin::run_loop( /// // Run 60 times per second. /// Duration::from_secs_f64(1.0 / 60.0), - /// ))); + /// ))).run(); }