Skip to content

Commit 71dfd5a

Browse files
aevyriearendjr
andauthored
Bevy 0.13 (#52)
* Updates for Bevy main (will become 0.13) * bump to bevy 0.13 * bump version * update readme * fix docs --------- Co-authored-by: Arend van Beelen jr <arend@arendjr.nl>
1 parent 6479002 commit 71dfd5a

File tree

4 files changed

+16
-21
lines changed

4 files changed

+16
-21
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bevy_framepace"
3-
version = "0.14.1"
3+
version = "0.15.0"
44
edition = "2021"
55
resolver = "2"
66
description = "Frame pacing and frame limiting for Bevy"
@@ -11,7 +11,7 @@ documentation = "https://docs.rs/bevy_framepace"
1111
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1212

1313
[dependencies]
14-
bevy = { version = "0.12", default-features = false, features = [
14+
bevy = { version = "0.13", default-features = false, features = [
1515
"bevy_render",
1616
"bevy_winit",
1717
] }
@@ -22,7 +22,7 @@ default = ["framepace_debug", "bevy/x11"]
2222
framepace_debug = []
2323

2424
[dev-dependencies]
25-
bevy = { version = "0.12", default-features = false, features = [
25+
bevy = { version = "0.13", default-features = false, features = [
2626
"bevy_gizmos",
2727
"bevy_text",
2828
"bevy_ui",

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ I intend to track the `main` branch of Bevy. PRs supporting this are welcome!
5353

5454
| bevy | bevy_framepace |
5555
| ---- | ------------------- |
56+
| 0.13 | 0.15 |
5657
| 0.12 | 0.14 |
5758
| 0.11 | 0.13 |
5859
| 0.10 | 0.12 |

examples/demo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct EnableText;
1818

1919
fn toggle_plugin(
2020
mut settings: ResMut<bevy_framepace::FramepaceSettings>,
21-
input: Res<Input<KeyCode>>,
21+
input: Res<ButtonInput<KeyCode>>,
2222
) {
2323
if input.just_pressed(KeyCode::Space) {
2424
use bevy_framepace::Limiter;

src/debug.rs

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Adds diagnostic logging and a cursor for debugging.
22
33
use bevy::{
4-
diagnostic::{Diagnostic, DiagnosticId, Diagnostics, RegisterDiagnostic},
4+
diagnostic::{Diagnostic, DiagnosticPath, Diagnostics, RegisterDiagnostic},
55
prelude::*,
66
};
77

@@ -12,24 +12,18 @@ impl Plugin for DiagnosticsPlugin {
1212
fn build(&self, app: &mut App) {
1313
app.add_systems(Update, Self::diagnostic_system);
1414

15-
app.register_diagnostic(
16-
Diagnostic::new(Self::FRAMEPACE_FRAMETIME, "framepace::frametime", 128)
17-
.with_suffix("ms"),
18-
);
19-
app.register_diagnostic(
20-
Diagnostic::new(Self::FRAMEPACE_OVERSLEEP, "framepace::oversleep", 128)
21-
.with_suffix("µs"),
22-
);
15+
app.register_diagnostic(Diagnostic::new(Self::FRAMEPACE_FRAMETIME).with_suffix("ms"));
16+
app.register_diagnostic(Diagnostic::new(Self::FRAMEPACE_OVERSLEEP).with_suffix("µs"));
2317
}
2418
}
2519

2620
impl DiagnosticsPlugin {
27-
/// [`DiagnosticId`] for the frametime
28-
pub const FRAMEPACE_FRAMETIME: DiagnosticId =
29-
DiagnosticId::from_u128(8021378406439507683279787892187089153);
30-
/// [`DiagnosticId`] for failures to meet frame time target
31-
pub const FRAMEPACE_OVERSLEEP: DiagnosticId =
32-
DiagnosticId::from_u128(978023490268634078905367093342937);
21+
/// [`DiagnosticPath`] for the frametime
22+
pub const FRAMEPACE_FRAMETIME: DiagnosticPath =
23+
DiagnosticPath::const_new("framepace/frametime");
24+
/// [`DiagnosticPath`] for failures to meet frame time target
25+
pub const FRAMEPACE_OVERSLEEP: DiagnosticPath =
26+
DiagnosticPath::const_new("framepace/oversleep");
3327

3428
/// Updates diagnostic data from measurements
3529
pub fn diagnostic_system(
@@ -44,7 +38,7 @@ impl DiagnosticsPlugin {
4438
let frametime_millis = stats.frametime.try_lock().unwrap().as_secs_f64() * 1_000_f64;
4539
let error_micros = stats.oversleep.try_lock().unwrap().as_secs_f64() * 1_000_000_f64;
4640

47-
diagnostics.add_measurement(Self::FRAMEPACE_FRAMETIME, || frametime_millis);
48-
diagnostics.add_measurement(Self::FRAMEPACE_OVERSLEEP, || error_micros);
41+
diagnostics.add_measurement(&Self::FRAMEPACE_FRAMETIME, || frametime_millis);
42+
diagnostics.add_measurement(&Self::FRAMEPACE_OVERSLEEP, || error_micros);
4943
}
5044
}

0 commit comments

Comments
 (0)