bevy/examples/diagnostics/log_diagnostics.rs

24 lines
1,001 B
Rust
Raw Normal View History

//! Shows different built-in plugins that logs diagnostics, like frames per second (FPS), to the console.
2020-05-04 21:14:49 +00:00
use bevy::{
diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin},
2020-05-04 21:14:49 +00:00
prelude::*,
};
fn main() {
App::new()
.add_plugins(DefaultPlugins)
// Adds frame time diagnostics
2020-05-04 21:14:49 +00:00
.add_plugin(FrameTimeDiagnosticsPlugin::default())
// Adds a system that prints diagnostics to the console
.add_plugin(LogDiagnosticsPlugin::default())
// Any plugin can register diagnostics
// Uncomment this to add an entity count diagnostics:
// .add_plugin(bevy::diagnostic::EntityCountDiagnosticsPlugin::default())
// Uncomment this to add an asset count diagnostics:
// .add_plugin(bevy::asset::diagnostic::AssetCountDiagnosticsPlugin::<Texture>::default())
// Uncomment this to add system info diagnostics:
// .add_plugin(bevy::diagnostic::SystemInformationDiagnosticsPlugin::default())
2020-05-04 21:14:49 +00:00
.run();
}