mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-05 10:28:27 +00:00
Simplify API of Viewer
This commit is contained in:
parent
d19cd87020
commit
7b9613038c
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ impl Instance {
|
||||
}
|
||||
|
||||
make_viewer_and_spawn_thread(|viewer| {
|
||||
let _ = viewer.display(tri_mesh);
|
||||
viewer.display(tri_mesh);
|
||||
})?;
|
||||
|
||||
Ok(())
|
||||
|
Loading…
Reference in New Issue
Block a user