SHARE
TWEET

Untitled

a guest Mar 24th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. use winit::{EventsLoop, Event, WindowBuilder, WindowEvent};
  2. fn main() {
  3.     let mut events_loop = EventsLoop::new();
  4.         .with_title("Din")
  5.     let win = WindowBuilder::new() // THIS WILL OPEN A WINDOW BUT WE HAVE AN UNSED VARIABLE
  6.         .build(&events_loop)
  7.         .expect("Could not create window!");
  8.  
  9.     let mut running = true;
  10.  
  11.     while running {
  12.         events_loop.poll_events(|event| {
  13.             match event {
  14.                 Event::WindowEvent {
  15.                     event: WindowEvent::CloseRequested,
  16.                     ..
  17.                 } => running = false,
  18.                 _ => (),
  19.             }
  20.         });
  21.     }
  22. }
  23.  
  24.  
  25. // -------------------------------- //
  26.  
  27. use winit::{EventsLoop, Event, WindowBuilder, WindowEvent};
  28. fn main() {
  29.     let mut events_loop = EventsLoop::new();
  30.     WindowBuilder::new() // THIS WILL NOT OPEN A WINDOW WHY?????
  31.         .with_title("Din")
  32.         .build(&events_loop)
  33.         .expect("Could not create window!");
  34.  
  35.     let mut running = true;
  36.  
  37.     while running {
  38.         events_loop.poll_events(|event| {
  39.             match event {
  40.                 Event::WindowEvent {
  41.                     event: WindowEvent::CloseRequested,
  42.                     ..
  43.                 } => running = false,
  44.                 _ => (),
  45.             }
  46.         });
  47.     }
  48. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top