2016-03-27 04:07:52 +11:00
|
|
|
extern crate winit;
|
2014-09-12 16:50:54 +10:00
|
|
|
|
2015-04-03 07:04:17 +11:00
|
|
|
use std::thread;
|
2014-12-24 03:12:29 +11:00
|
|
|
|
2014-08-04 01:23:08 +10:00
|
|
|
fn main() {
|
2016-03-27 04:07:52 +11:00
|
|
|
let window1 = winit::WindowBuilder::new().build().unwrap();
|
|
|
|
let window2 = winit::WindowBuilder::new().build().unwrap();
|
|
|
|
let window3 = winit::WindowBuilder::new().build().unwrap();
|
2014-08-04 01:23:08 +10:00
|
|
|
|
2015-04-17 23:23:13 +10:00
|
|
|
let t1 = thread::spawn(move || {
|
2016-03-27 04:07:52 +11:00
|
|
|
run(window1);
|
2014-08-04 01:23:08 +10:00
|
|
|
});
|
|
|
|
|
2015-04-17 23:23:13 +10:00
|
|
|
let t2 = thread::spawn(move || {
|
2016-03-27 04:07:52 +11:00
|
|
|
run(window2);
|
2014-08-04 01:23:08 +10:00
|
|
|
});
|
2014-08-08 02:15:09 +10:00
|
|
|
|
2015-04-17 23:23:13 +10:00
|
|
|
let t3 = thread::spawn(move || {
|
2016-03-27 04:07:52 +11:00
|
|
|
run(window3);
|
2014-08-08 02:15:09 +10:00
|
|
|
});
|
2014-12-24 03:12:29 +11:00
|
|
|
|
2015-01-18 19:51:23 +11:00
|
|
|
let _ = t1.join();
|
|
|
|
let _ = t2.join();
|
|
|
|
let _ = t3.join();
|
2014-08-04 01:23:08 +10:00
|
|
|
}
|
|
|
|
|
2016-03-27 04:07:52 +11:00
|
|
|
fn run(window: winit::Window) {
|
2015-06-16 21:48:08 +10:00
|
|
|
for event in window.wait_events() {
|
|
|
|
match event {
|
2016-03-27 04:07:52 +11:00
|
|
|
winit::Event::Closed => break,
|
2015-06-16 21:48:08 +10:00
|
|
|
_ => ()
|
|
|
|
}
|
2014-08-04 01:23:08 +10:00
|
|
|
}
|
|
|
|
}
|