fn run_glutin_thread(send_proxy: mpsc::Sender<EventLoopProxy<GlutinThreadEvent>>) {
    // Create the event loop
    let event_loop  = EventLoop::with_user_event();

    // We communicate with the event loop via the proxy
    let proxy       = event_loop.create_proxy();

    // Send the proxy back to the creating thread
    send_proxy.send(proxy).expect("Main thread is waiting to receive its proxy");

    // The runtime struct is used to maintain state when the event loop is running
    let mut runtime = GlutinRuntime { 
        window_events:              HashMap::new(),
        futures:                    HashMap::new(),
        will_stop_when_no_windows:  false,
        will_exit:                  false,
        pointer_id:                 HashMap::new(),
        pointer_state:              HashMap::new()
    };

    // Run the glutin event loop
    event_loop.run(move |event, window_target, control_flow| { 
        runtime.handle_event(event, window_target, control_flow);
    });
}
///
/// Runs a glutin thread, posting the proxy to the specified channel
///
Runs a glutin thread, posting the proxy to the specified channel
Runs a glutin thread posting the proxy to the specified channel
fn run_glutin_thread(send_proxy: mpsc::Sender<EventLoopProxy<GlutinThreadEvent>>) {
    // Create the event loop
    let event_loop  = EventLoop::with_user_event();
    // We communicate with the event loop via the proxy
    let proxy       = event_loop.create_proxy();
    // Send the proxy back to the creating thread
    send_proxy.send(proxy).expect("Main thread is waiting to receive its proxy");
    // The runtime struct is used to maintain state when the event loop is running
    let mut runtime = GlutinRuntime { 
        window_events:              HashMap::new(),
        futures:                    HashMap::new(),
        will_stop_when_no_windows:  false,
        will_exit:                  false,
        pointer_id:                 HashMap::new(),
        pointer_state:              HashMap::new()
    };
    // Run the glutin event loop
    event_loop.run(move |event, window_target, control_flow| { 
        runtime.handle_event(event, window_target, control_flow);
    });
}
fn run_glutin_thread ( send_proxy : mpsc :: Sender < EventLoopProxy < GlutinThreadEvent > > ) { // Create the event loop let event_loop = EventLoop :: with_user_event ( ) ; // We communicate with the event loop via the proxy let proxy = event_loop . create_proxy ( ) ; // Send the proxy back to the creating thread send_proxy . send ( proxy ) . expect ( " " ) ; // The runtime struct is used to maintain state when the event loop is running let mut runtime = GlutinRuntime { window_events : HashMap :: new ( ) , futures : HashMap :: new ( ) , will_stop_when_no_windows : false , will_exit : false , pointer_id : HashMap :: new ( ) , pointer_state : HashMap :: new ( ) } ; // Run the glutin event loop event_loop . run ( move | event , window_target , control_flow | { runtime . handle_event ( event , window_target , control_flow ) ; } ) ; }
Runs a glutin thread, posting the proxy to the specified channel
Runs a glutin thread posting the proxy to the specified channel
send_proxy
mpsc::Sender<EventLoopProxy<GlutinThreadEvent>>