[frame_stats] Show viewport resolution on the stats layer

Also set the stats layer toggle to be on by default until we add some UI
to toggle it on mobile.
This commit is contained in:
Arman Uguray 2023-03-05 14:39:02 -08:00 committed by Arman Uguray
parent d7bacbcc3f
commit bacaeebcb6
2 changed files with 9 additions and 1 deletions

View file

@ -99,7 +99,7 @@ fn run(
let mut simple_text = SimpleText::new(); let mut simple_text = SimpleText::new();
let mut images = ImageCache::new(); let mut images = ImageCache::new();
let mut stats = stats::Stats::new(); let mut stats = stats::Stats::new();
let mut stats_toggle = false; let mut stats_toggle = true;
let start = Instant::now(); let start = Instant::now();
let mut touch_state = multi_touch::TouchState::new(); let mut touch_state = multi_touch::TouchState::new();

View file

@ -79,6 +79,14 @@ impl Snapshot {
offset * Affine::translate((left_margin, 3. * text_height)), offset * Affine::translate((left_margin, 3. * text_height)),
&format!("Frame Time (max): {:.2} ms", self.frame_time_max_ms), &format!("Frame Time (max): {:.2} ms", self.frame_time_max_ms),
); );
text.add(
sb,
None,
text_size,
Some(&Brush::Solid(Color::WHITE)),
offset * Affine::translate((left_margin, 4. * text_height)),
&format!("Resolution: {viewport_width}x{viewport_height}"),
);
text.add( text.add(
sb, sb,
None, None,