diff --git a/crates/render/Cargo.toml b/crates/render/Cargo.toml index bc49a82..7ebcfdf 100644 --- a/crates/render/Cargo.toml +++ b/crates/render/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] -crate-type = ["cdylib", "rlib"] +crate_type = ["dylib"] [dependencies] winit = "0.26" diff --git a/src/lib.rs b/src/lib.rs index 048c267..16c99f0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -200,9 +200,7 @@ pub async fn run() { state.update(&renderer.queue, dt); match renderer.render_frame(|view, command| { - let mut renderable = Arc::clone(&default_state); - let state = Arc::get_mut(&mut renderable).unwrap(); - state.render(view, command) + default_state.render(view, command) }) { Ok(_) => {} Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => { diff --git a/src/render/renderer/default_state.rs b/src/render/renderer/default_state.rs index 3e9a6b7..4eabdbe 100644 --- a/src/render/renderer/default_state.rs +++ b/src/render/renderer/default_state.rs @@ -282,7 +282,7 @@ impl super::State for DefaultState { } fn render( - &mut self, + &self, view: &wgpu::TextureView, encoder: &mut wgpu::CommandEncoder, ) -> Result<(), wgpu::SurfaceError> { diff --git a/src/render/renderer/mod.rs b/src/render/renderer/mod.rs index b3bb9e2..6b9f363 100644 --- a/src/render/renderer/mod.rs +++ b/src/render/renderer/mod.rs @@ -14,7 +14,7 @@ pub trait State { fn input(&mut self, event: &Event<()>) -> bool; fn update(&mut self, queue: &Queue, dt: instant::Duration); fn render( - &mut self, + &self, view: &TextureView, encoder: &mut CommandEncoder, ) -> Result<(), wgpu::SurfaceError>;