mirror of
https://github.com/sotrh/learn-wgpu.git
synced 2024-11-04 06:00:47 +00:00
Removed unnecessary mut
This commit is contained in:
parent
c55ea96d0d
commit
ed34bbfbce
@ -199,7 +199,7 @@ pub async fn run<D: Demo>() -> Result<(), Error> {
|
|||||||
.with_title(env!("CARGO_PKG_NAME"))
|
.with_title(env!("CARGO_PKG_NAME"))
|
||||||
.build(&event_loop)?;
|
.build(&event_loop)?;
|
||||||
let mut display = Display::new(window).await?;
|
let mut display = Display::new(window).await?;
|
||||||
let mut demo = D::init(&mut display)?;
|
let mut demo = D::init(&display)?;
|
||||||
let mut last_update = Instant::now();
|
let mut last_update = Instant::now();
|
||||||
let mut is_resumed = true;
|
let mut is_resumed = true;
|
||||||
let mut is_focused = true;
|
let mut is_focused = true;
|
||||||
@ -221,7 +221,7 @@ pub async fn run<D: Demo>() -> Result<(), Error> {
|
|||||||
let dt = now - last_update;
|
let dt = now - last_update;
|
||||||
last_update = now;
|
last_update = now;
|
||||||
|
|
||||||
demo.update(&mut display, dt);
|
demo.update(&display, dt);
|
||||||
demo.render(&mut display);
|
demo.render(&mut display);
|
||||||
is_redraw_requested = false;
|
is_redraw_requested = false;
|
||||||
}
|
}
|
||||||
@ -244,11 +244,11 @@ pub async fn run<D: Demo>() -> Result<(), Error> {
|
|||||||
WindowEvent::Focused(f) => is_focused = f,
|
WindowEvent::Focused(f) => is_focused = f,
|
||||||
WindowEvent::ScaleFactorChanged { new_inner_size, .. } => {
|
WindowEvent::ScaleFactorChanged { new_inner_size, .. } => {
|
||||||
display.resize(new_inner_size.width, new_inner_size.height);
|
display.resize(new_inner_size.width, new_inner_size.height);
|
||||||
demo.resize(&mut display);
|
demo.resize(&display);
|
||||||
}
|
}
|
||||||
WindowEvent::Resized(new_inner_size) => {
|
WindowEvent::Resized(new_inner_size) => {
|
||||||
display.resize(new_inner_size.width, new_inner_size.height);
|
display.resize(new_inner_size.width, new_inner_size.height);
|
||||||
demo.resize(&mut display);
|
demo.resize(&display);
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user