summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorMicha White <botahamec@outlook.com>2023-05-08 18:23:55 -0400
committerMicha White <botahamec@outlook.com>2023-05-08 18:23:55 -0400
commit1ec2599c45a51dde87496edce7cd3ab301a18539 (patch)
tree0e33dc3ce23bdc643deeb4994296b30bd3c76c7a /render
parente2901288036cfb3557a6855f56998ce0881b2afc (diff)
Bunnymark update
Diffstat (limited to 'render')
-rw-r--r--render/examples/bunnymark.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/render/examples/bunnymark.rs b/render/examples/bunnymark.rs
index 1579cf0..1e171c1 100644
--- a/render/examples/bunnymark.rs
+++ b/render/examples/bunnymark.rs
@@ -24,6 +24,7 @@ struct State {
texture_id: TextureId,
bunnies: Vec<Bunny>,
previous_timestamp: Option<Instant>,
+ bad_frames: u8,
seed: [u64; 2],
stopped: bool,
}
@@ -35,6 +36,7 @@ impl State {
bunnies: Vec::with_capacity(10_000_000),
previous_timestamp: None,
seed: [0x0D15EA5E8BADF00D, 0xDECAFBADDEADBEAF],
+ bad_frames: 0,
stopped: false,
}
}
@@ -56,7 +58,12 @@ impl State {
));
if fps < 15.0 {
- self.stopped = true;
+ self.bad_frames += 1;
+ if self.bad_frames == 3 {
+ self.stopped = true;
+ }
+ } else {
+ self.bad_frames = 0;
}
self.previous_timestamp = Some(Instant::now());