From c69ce9105c7b2ec4f558cfe698dd45691afa31e5 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Tue, 21 Nov 2023 17:24:37 +0100 Subject: [PATCH] fix the rest of stuff now i need to fix mouse buttons and add init code back --- kubi/src/cursor_lock.rs | 13 ++++++------- kubi/src/events.rs | 13 ++++++------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/kubi/src/cursor_lock.rs b/kubi/src/cursor_lock.rs index 97b0ce0..05cf581 100644 --- a/kubi/src/cursor_lock.rs +++ b/kubi/src/cursor_lock.rs @@ -14,13 +14,12 @@ pub fn update_cursor_lock_state( } if lock.is_inserted_or_modified() { //TODO MIGRATION - // let gl_window = display.display.gl_window(); - // let window = gl_window.window(); - // window.set_cursor_grab(match lock.0 { - // true => CursorGrabMode::Confined, - // false => CursorGrabMode::None, - // }).expect("Failed to change cursor grab state"); - // window.set_cursor_visible(!lock.0); + let window = &display.window; + window.set_cursor_grab(match lock.0 { + true => CursorGrabMode::Confined, + false => CursorGrabMode::None, + }).expect("Failed to change cursor grab state"); + window.set_cursor_visible(!lock.0); } } diff --git a/kubi/src/events.rs b/kubi/src/events.rs index 855ed3d..162a6f9 100644 --- a/kubi/src/events.rs +++ b/kubi/src/events.rs @@ -67,13 +67,12 @@ pub fn process_glutin_events(world: &mut World, event: &Event<()>) { )); }, - //TODO MIGRATION - // Event::LoopDestroyed => { - // world.add_entity(( - // EventComponent, - // OnBeforeExitEvent - // )); - // }, + Event::LoopExiting => { + world.add_entity(( + EventComponent, + OnBeforeExitEvent + )); + }, _ => (), }