From 9f94e316d694196d2e70fcf02c02adf166193cd0 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 6 Jun 2023 11:33:33 +0200 Subject: [PATCH 1/4] Rename `window::run` to `display` I think the new name better describes what the function does. --- crates/fj-window/src/lib.rs | 2 +- crates/fj-window/src/run.rs | 2 +- crates/fj/src/handle_model.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/fj-window/src/lib.rs b/crates/fj-window/src/lib.rs index 1b0d14de4..16867d1d6 100644 --- a/crates/fj-window/src/lib.rs +++ b/crates/fj-window/src/lib.rs @@ -13,4 +13,4 @@ mod run; mod window; -pub use self::run::{run, Error}; +pub use self::run::{display, Error}; diff --git a/crates/fj-window/src/run.rs b/crates/fj-window/src/run.rs index d728a7bc5..6420eb2f8 100644 --- a/crates/fj-window/src/run.rs +++ b/crates/fj-window/src/run.rs @@ -19,7 +19,7 @@ use winit::{ use crate::window::{self, Window}; /// Initializes a model viewer for a given model and enters its process loop. -pub fn run(mesh: Mesh>, invert_zoom: bool) -> Result<(), Error> { +pub fn display(mesh: Mesh>, invert_zoom: bool) -> Result<(), Error> { let event_loop = EventLoop::new(); let window = Window::new(&event_loop)?; let mut viewer = block_on(Viewer::new(&window))?; diff --git a/crates/fj/src/handle_model.rs b/crates/fj/src/handle_model.rs index 5fca60f3e..93015a74c 100644 --- a/crates/fj/src/handle_model.rs +++ b/crates/fj/src/handle_model.rs @@ -25,7 +25,7 @@ where if let Some(path) = args.export { crate::export::export(&mesh, &path)?; } else { - crate::window::run(mesh, false)?; + crate::window::display(mesh, false)?; } Ok(()) From 88ff9f6c6e4df79f84a751e77bf690d43a18fb5e Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 6 Jun 2023 11:34:15 +0200 Subject: [PATCH 2/4] Update doc comment --- crates/fj-window/src/run.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/fj-window/src/run.rs b/crates/fj-window/src/run.rs index 6420eb2f8..f02f731f9 100644 --- a/crates/fj-window/src/run.rs +++ b/crates/fj-window/src/run.rs @@ -18,7 +18,7 @@ use winit::{ use crate::window::{self, Window}; -/// Initializes a model viewer for a given model and enters its process loop. +/// Display the provided mesh in a window that processes input pub fn display(mesh: Mesh>, invert_zoom: bool) -> Result<(), Error> { let event_loop = EventLoop::new(); let window = Window::new(&event_loop)?; From ca2f161683283d9c5489807f2e14e3801a9cc8cb Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 6 Jun 2023 11:34:38 +0200 Subject: [PATCH 3/4] Update module name --- crates/fj-window/src/{run.rs => display.rs} | 0 crates/fj-window/src/lib.rs | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename crates/fj-window/src/{run.rs => display.rs} (100%) diff --git a/crates/fj-window/src/run.rs b/crates/fj-window/src/display.rs similarity index 100% rename from crates/fj-window/src/run.rs rename to crates/fj-window/src/display.rs diff --git a/crates/fj-window/src/lib.rs b/crates/fj-window/src/lib.rs index 16867d1d6..88430ce9d 100644 --- a/crates/fj-window/src/lib.rs +++ b/crates/fj-window/src/lib.rs @@ -10,7 +10,7 @@ #![warn(missing_docs)] -mod run; +mod display; mod window; -pub use self::run::{display, Error}; +pub use self::display::{display, Error}; From 8a369f1fc6c9fb0028bf1deecde7fa7b60a9d1cb Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 6 Jun 2023 11:34:58 +0200 Subject: [PATCH 4/4] Fix doc comment --- crates/fj-window/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/fj-window/src/lib.rs b/crates/fj-window/src/lib.rs index 88430ce9d..5b9f8b7a1 100644 --- a/crates/fj-window/src/lib.rs +++ b/crates/fj-window/src/lib.rs @@ -1,4 +1,4 @@ -//! # Fornjot Model Viewer +//! # Fornjot Window Abstraction //! //! [Fornjot] is an early-stage b-rep CAD kernel written in Rust. The kernel is //! split into multiple libraries that can be used semi-independently, and this