log only fps
This commit is contained in:
parent
3ea4fda9c5
commit
d1dbb78f07
11
src/lib.rs
11
src/lib.rs
@ -9,7 +9,7 @@ use log::debug;
|
|||||||
// use state::State;
|
// use state::State;
|
||||||
// use graphics::Graphics;
|
// use graphics::Graphics;
|
||||||
use winit::{application::ApplicationHandler, dpi::PhysicalSize, event::{Event, WindowEvent}, event_loop::EventLoop, window::{Window, WindowAttributes}};
|
use winit::{application::ApplicationHandler, dpi::PhysicalSize, event::{Event, WindowEvent}, event_loop::EventLoop, window::{Window, WindowAttributes}};
|
||||||
use bevy::app::App;
|
use bevy::{prelude::*, diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}};
|
||||||
|
|
||||||
pub fn dbg<V: Debug>(v: V) -> V {
|
pub fn dbg<V: Debug>(v: V) -> V {
|
||||||
debug!(target: "app", "{:?}", v);
|
debug!(target: "app", "{:?}", v);
|
||||||
@ -100,15 +100,16 @@ pub fn main() {
|
|||||||
// (event_loop, window)
|
// (event_loop, window)
|
||||||
// };
|
// };
|
||||||
|
|
||||||
use bevy::{diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}, DefaultPlugins};
|
|
||||||
|
|
||||||
App::new()
|
App::new()
|
||||||
.add_plugins(DefaultPlugins)
|
|
||||||
.add_plugins((
|
.add_plugins((
|
||||||
|
DefaultPlugins,
|
||||||
camera::Plugin,
|
camera::Plugin,
|
||||||
map::Plugin,
|
map::Plugin,
|
||||||
FrameTimeDiagnosticsPlugin,
|
FrameTimeDiagnosticsPlugin,
|
||||||
LogDiagnosticsPlugin::default()
|
LogDiagnosticsPlugin {
|
||||||
|
filter: Some(vec![FrameTimeDiagnosticsPlugin::FPS]),
|
||||||
|
..Default::default()
|
||||||
|
}
|
||||||
))
|
))
|
||||||
.run();
|
.run();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user