diff --git a/comfy-wgpu/src/device.rs b/comfy-wgpu/src/device.rs index d64ed2a..6367c87 100644 --- a/comfy-wgpu/src/device.rs +++ b/comfy-wgpu/src/device.rs @@ -56,11 +56,11 @@ pub async fn create_graphics_context(window: &Window) -> GraphicsContext { .await .expect("failed to create wgpu adapter"); - // device.on_uncaptured_error(Box::new(|err| { - // error!("WGPU ERROR: {:?}", err); - // #[cfg(fature = "ci-release")] - // panic!("Exiting due to wgpu error: {:?}", err); - // })); + #[cfg(fature = "ci-release")] + device.on_uncaptured_error(Box::new(|err| { + error!("WGPU ERROR: {:?}", err); + panic!("Exiting due to wgpu error: {:?}", err); + })); let caps = surface.get_capabilities(&adapter); let supported_formats = caps.formats; diff --git a/comfy/src/engine.rs b/comfy/src/engine.rs index c3819b2..0c45acd 100644 --- a/comfy/src/engine.rs +++ b/comfy/src/engine.rs @@ -141,19 +141,11 @@ impl EngineState { // .secondary_frame_mark(tracy_client::frame_name!("update")); - // TODO: this really needs a cleanup - pub fn renderer(&mut self) -> &mut WgpuRenderer { - self.renderer.as_mut().expect("renderer must be initialized") - } - - // TODO: this really needs a cleanup pub fn resize(&mut self, new_size: UVec2) { - self.renderer.as_mut().unwrap().resize(new_size); - } - - // TODO: this really needs a cleanup - pub fn quit_flag(&mut self) -> bool { - self.quit_flag + self.renderer + .as_mut() + .expect("renderer must be initialized") + .resize(new_size); } pub fn title(&self) -> String { diff --git a/comfy/src/game_loop.rs b/comfy/src/game_loop.rs index a94f0a4..562a675 100644 --- a/comfy/src/game_loop.rs +++ b/comfy/src/game_loop.rs @@ -92,7 +92,7 @@ pub async fn run_comfy_main_async( set_time(get_time() + delta as f64); use_default_shader(); - if engine.quit_flag() { + if engine.quit_flag { *control_flow = ControlFlow::Exit; }