pub fn new(
        window: minifb::Window,
        adapter: A,
        key_events: Rc<RefCell<Vec<KeyEvent>>>,
    ) -> WindowShell<A> {
        let size = window.get_size();
        let render_context_2_d = RenderContext2D::new(size.0 as f64, size.1 as f64);

        WindowShell {
            window,
            // window_size: window_size,
            // mouse_buttons: (false, false, false),
            // mouse_position: Point::default(),
            render_context_2_d,
            adapter,
            mouse_pos: (0.0, 0.0),
            window_size: size,
            button_down: (false, false, false),
            key_events,
            key_backspace: KeyHelper(false, minifb::Key::Backspace, Key::Backspace),
            key_left: KeyHelper(false, minifb::Key::Left, Key::Left),
            key_right: KeyHelper(false, minifb::Key::Right, Key::Right),
            key_up: KeyHelper(false, minifb::Key::Up, Key::Up),
            key_down: KeyHelper(false, minifb::Key::Down, Key::Down),
            key_delete: KeyHelper(false, minifb::Key::Delete, Key::Delete),
            key_enter: KeyHelper(false, minifb::Key::Enter, Key::Enter),
            key_control: KeyHelper(false, minifb::Key::LeftCtrl, Key::Control),
            key_control_right: KeyHelper(false, minifb::Key::RightCtrl, Key::Control),
            key_shift_l: KeyHelper(false, minifb::Key::LeftShift, Key::ShiftL),
            key_shift_r: KeyHelper(false, minifb::Key::RightShift, Key::ShiftR),
            key_alt: KeyHelper(false, minifb::Key::LeftAlt, Key::Alt),
            key_alt_r: KeyHelper(false, minifb::Key::RightAlt, Key::Alt),
            key_escape: KeyHelper(false, minifb::Key::Escape, Key::Escape),
            key_home: KeyHelper(false, minifb::Key::Home, Key::Home),
            running: true,
            update: true,
            active: false,
        }
    }
/// Creates a new window shell with an adapter.
Creates a new window shell with an adapter.
Creates a new window shell with an adapter .
pub fn new(
        window: minifb::Window,
        adapter: A,
        key_events: Rc<RefCell<Vec<KeyEvent>>>,
    ) -> WindowShell<A> {
        let size = window.get_size();
        let render_context_2_d = RenderContext2D::new(size.0 as f64, size.1 as f64);
        WindowShell {
            window,
            // window_size: window_size,
            // mouse_buttons: (false, false, false),
            // mouse_position: Point::default(),
            render_context_2_d,
            adapter,
            mouse_pos: (0.0, 0.0),
            window_size: size,
            button_down: (false, false, false),
            key_events,
            key_backspace: KeyHelper(false, minifb::Key::Backspace, Key::Backspace),
            key_left: KeyHelper(false, minifb::Key::Left, Key::Left),
            key_right: KeyHelper(false, minifb::Key::Right, Key::Right),
            key_up: KeyHelper(false, minifb::Key::Up, Key::Up),
            key_down: KeyHelper(false, minifb::Key::Down, Key::Down),
            key_delete: KeyHelper(false, minifb::Key::Delete, Key::Delete),
            key_enter: KeyHelper(false, minifb::Key::Enter, Key::Enter),
            key_control: KeyHelper(false, minifb::Key::LeftCtrl, Key::Control),
            key_control_right: KeyHelper(false, minifb::Key::RightCtrl, Key::Control),
            key_shift_l: KeyHelper(false, minifb::Key::LeftShift, Key::ShiftL),
            key_shift_r: KeyHelper(false, minifb::Key::RightShift, Key::ShiftR),
            key_alt: KeyHelper(false, minifb::Key::LeftAlt, Key::Alt),
            key_alt_r: KeyHelper(false, minifb::Key::RightAlt, Key::Alt),
            key_escape: KeyHelper(false, minifb::Key::Escape, Key::Escape),
            key_home: KeyHelper(false, minifb::Key::Home, Key::Home),
            running: true,
            update: true,
            active: false,
        }
    }
pub fn new ( window : minifb :: Window , adapter : A , key_events : Rc < RefCell < Vec < KeyEvent > > > , ) -> WindowShell < A > { let size = window . get_size ( ) ; let render_context_2_d = RenderContext2D :: new ( size . 0 as f64 , size . 1 as f64 ) ; WindowShell { window , // window_size: window_size, // mouse_buttons: (false, false, false), // mouse_position: Point::default(), render_context_2_d , adapter , mouse_pos : ( 0.0 , 0.0 ) , window_size : size , button_down : ( false , false , false ) , key_events , key_backspace : KeyHelper ( false , minifb :: Key :: Backspace , Key :: Backspace ) , key_left : KeyHelper ( false , minifb :: Key :: Left , Key :: Left ) , key_right : KeyHelper ( false , minifb :: Key :: Right , Key :: Right ) , key_up : KeyHelper ( false , minifb :: Key :: Up , Key :: Up ) , key_down : KeyHelper ( false , minifb :: Key :: Down , Key :: Down ) , key_delete : KeyHelper ( false , minifb :: Key :: Delete , Key :: Delete ) , key_enter : KeyHelper ( false , minifb :: Key :: Enter , Key :: Enter ) , key_control : KeyHelper ( false , minifb :: Key :: LeftCtrl , Key :: Control ) , key_control_right : KeyHelper ( false , minifb :: Key :: RightCtrl , Key :: Control ) , key_shift_l : KeyHelper ( false , minifb :: Key :: LeftShift , Key :: ShiftL ) , key_shift_r : KeyHelper ( false , minifb :: Key :: RightShift , Key :: ShiftR ) , key_alt : KeyHelper ( false , minifb :: Key :: LeftAlt , Key :: Alt ) , key_alt_r : KeyHelper ( false , minifb :: Key :: RightAlt , Key :: Alt ) , key_escape : KeyHelper ( false , minifb :: Key :: Escape , Key :: Escape ) , key_home : KeyHelper ( false , minifb :: Key :: Home , Key :: Home ) , running : true , update : true , active : false , } }
Creates a new window shell with an adapter.
Creates a new window shell with an adapter .
window
minifb::Window
adapter
A
key_events
Rc<RefCell<Vec<KeyEvent>>>
window
minifb::Window
adapter
A
key_events
Rc<RefCell<Vec<KeyEvent>>>