Add framerate logging

This commit is contained in:
Jarrod Doyle 2024-01-26 17:47:16 +00:00
parent 9e103c0c05
commit 19671b8f28
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
1 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,10 @@
mod falling_sand; mod falling_sand;
use bevy::{prelude::*, window::PresentMode}; use bevy::{
diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin},
prelude::*,
window::PresentMode,
};
fn main() { fn main() {
let window_plugin = WindowPlugin { let window_plugin = WindowPlugin {
@ -19,6 +23,8 @@ fn main() {
.set(window_plugin) .set(window_plugin)
.set(ImagePlugin::default_nearest()), .set(ImagePlugin::default_nearest()),
) )
.add_plugins(FrameTimeDiagnosticsPlugin)
.add_plugins(LogDiagnosticsPlugin::default())
.add_plugins(falling_sand::FallingSandPlugin) .add_plugins(falling_sand::FallingSandPlugin)
.add_systems(Startup, setup) .add_systems(Startup, setup)
.insert_resource(ClearColor(Color::rgb_u8(45, 42, 46))) .insert_resource(ClearColor(Color::rgb_u8(45, 42, 46)))