Skip to content

Commit

Permalink
print fps/frame time in rendering statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
mrDIMAS committed May 8, 2024
1 parent 14d9a49 commit 9e08271
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion editor/src/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,13 @@ impl StatisticsWindow {
pub fn update(&self, current_scene: Handle<Scene>, engine: &Engine) {
if let GraphicsContext::Initialized(ref graphics_context) = engine.graphics_context {
if let Some(stats) = graphics_context.renderer.scene_data_map.get(&current_scene) {
let statistics = stats.statistics.to_string();
let global_stats = graphics_context.renderer.get_statistics();
let statistics = format!(
"FPS: {}\nFrame Time:{}\n{}",
global_stats.frames_per_second,
global_stats.pure_frame_time,
stats.statistics.to_string()
);
engine
.user_interfaces
.first()
Expand Down

0 comments on commit 9e08271

Please sign in to comment.