diff --git a/Cargo.toml b/Cargo.toml index cb14720a69..aad213062d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3639,6 +3639,7 @@ hidden = true name = "desktop_request_redraw" path = "tests/window/desktop_request_redraw.rs" doc-scrape-examples = true +required-features = ["bevy_dev_tools"] [package.metadata.example.desktop_request_redraw] hidden = true diff --git a/tests/window/desktop_request_redraw.rs b/tests/window/desktop_request_redraw.rs index cb0ab38f1d..61c5ee5c66 100644 --- a/tests/window/desktop_request_redraw.rs +++ b/tests/window/desktop_request_redraw.rs @@ -1,10 +1,32 @@ //! Desktop request redraw -use bevy::{prelude::*, window::RequestRedraw, winit::WinitSettings}; +use bevy::{ + dev_tools::fps_overlay::{FpsOverlayConfig, FpsOverlayPlugin}, + prelude::*, + window::RequestRedraw, + winit::WinitSettings, +}; fn main() { App::new() .add_plugins(DefaultPlugins) .add_plugins(MeshPickingPlugin) + // Enable the FPS overlay with a high resolution refresh interval. This makes it + // easier to validate that UpdateMode is behaving correctly when desktop_app is used. + // The FPS counter should essentially pause when the cube is not rotating and should + // update rapidly when the cube is rotating or there is input (e.g. moving the mouse). + // + // Left and Right clicking the cube should roggle rotation on/off. + .add_plugins(FpsOverlayPlugin { + config: FpsOverlayConfig { + text_config: TextFont { + font_size: 12.0, + ..default() + }, + text_color: Color::srgb(0.0, 1.0, 0.0), + refresh_interval: core::time::Duration::from_millis(16), + ..default() + }, + }) .insert_resource(WinitSettings::desktop_app()) .add_systems(Startup, setup) .add_systems(Update, (update, redraw.after(update)))