diff --git a/Cargo.toml b/Cargo.toml index f09aa36..08ee68c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,5 +10,5 @@ license = "MIT OR Apache-2.0" categories = ["gui"] [dependencies] -imgui = { git = "https://github.com/imgui-rs/imgui-rs", version = "0.12" } +imgui = "0.12" winit = { version = "0.30", default-features = false } \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 6561047..b088917 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -157,7 +157,15 @@ impl WinitPlatform { _ => (), } } - fn handle_window_event(&mut self, io: &mut Io, window: &Window, event: &WindowEvent) { + + /// Handles a winit window event. + /// + /// This function performs the following actions (depends on the event): + /// + /// * window size / dpi factor changes are applied + /// * keyboard state is updated + /// * mouse state is updated + pub fn handle_window_event(&mut self, io: &mut Io, window: &Window, event: &WindowEvent) { match *event { WindowEvent::Resized(physical_size) => { let logical_size = physical_size.to_logical(window.scale_factor());