Simplify API of Viewer

This commit is contained in:
Hanno Braun 2025-03-28 19:58:33 +01:00
parent d19cd87020
commit 7b9613038c
2 changed files with 7 additions and 7 deletions

View File

@ -9,7 +9,7 @@ use winit::{
event::{
ElementState, KeyEvent, MouseButton, MouseScrollDelta, WindowEvent,
},
event_loop::{ActiveEventLoop, EventLoop, EventLoopClosed, EventLoopProxy},
event_loop::{ActiveEventLoop, EventLoop, EventLoopProxy},
keyboard::{Key, NamedKey},
window::WindowId,
};
@ -60,11 +60,11 @@ impl Viewer {
///
/// This can fail, if the viewer thread is no longer running. Returns the
/// triangle mesh, wrapped in an error, if that is the case.
pub fn display(
&self,
tri_mesh: TriMesh,
) -> Result<(), EventLoopClosed<TriMesh>> {
self.event_loop.send_event(tri_mesh)
pub fn display(&self, tri_mesh: TriMesh) {
// If there's an error, that means the display thread has closed down
// and we're on our way to shutting down as well. I don't think there's
// much we can do about that.
let _ = self.event_loop.send_event(tri_mesh);
}
}

View File

@ -89,7 +89,7 @@ impl Instance {
}
make_viewer_and_spawn_thread(|viewer| {
let _ = viewer.display(tri_mesh);
viewer.display(tri_mesh);
})?;
Ok(())