2014-09-11 18:13:50 +02:00
|
|
|
#[cfg(target_os = "android")]
|
2015-01-08 09:28:22 +01:00
|
|
|
#[macro_use]
|
2014-09-11 18:13:50 +02:00
|
|
|
extern crate android_glue;
|
|
|
|
|
2016-03-26 18:07:52 +01:00
|
|
|
extern crate winit;
|
2014-09-12 08:50:54 +02:00
|
|
|
|
2015-04-02 22:04:17 +02:00
|
|
|
use std::thread;
|
2014-12-23 17:12:29 +01:00
|
|
|
|
2014-09-11 18:13:50 +02:00
|
|
|
#[cfg(target_os = "android")]
|
2014-12-19 21:34:20 -08:00
|
|
|
android_start!(main);
|
2014-09-11 18:13:50 +02:00
|
|
|
|
2014-08-03 17:23:08 +02:00
|
|
|
fn main() {
|
2016-03-26 18:07:52 +01:00
|
|
|
let window1 = winit::WindowBuilder::new().build().unwrap();
|
|
|
|
let window2 = winit::WindowBuilder::new().build().unwrap();
|
|
|
|
let window3 = winit::WindowBuilder::new().build().unwrap();
|
2014-08-03 17:23:08 +02:00
|
|
|
|
2015-04-17 15:23:13 +02:00
|
|
|
let t1 = thread::spawn(move || {
|
2016-03-26 18:07:52 +01:00
|
|
|
run(window1);
|
2014-08-03 17:23:08 +02:00
|
|
|
});
|
|
|
|
|
2015-04-17 15:23:13 +02:00
|
|
|
let t2 = thread::spawn(move || {
|
2016-03-26 18:07:52 +01:00
|
|
|
run(window2);
|
2014-08-03 17:23:08 +02:00
|
|
|
});
|
2014-08-07 18:15:09 +02:00
|
|
|
|
2015-04-17 15:23:13 +02:00
|
|
|
let t3 = thread::spawn(move || {
|
2016-03-26 18:07:52 +01:00
|
|
|
run(window3);
|
2014-08-07 18:15:09 +02:00
|
|
|
});
|
2014-12-23 17:12:29 +01:00
|
|
|
|
2015-01-18 19:51:23 +11:00
|
|
|
let _ = t1.join();
|
|
|
|
let _ = t2.join();
|
|
|
|
let _ = t3.join();
|
2014-08-03 17:23:08 +02:00
|
|
|
}
|
|
|
|
|
2016-03-26 18:07:52 +01:00
|
|
|
fn run(window: winit::Window) {
|
2015-06-16 13:48:08 +02:00
|
|
|
for event in window.wait_events() {
|
|
|
|
match event {
|
2016-03-26 18:07:52 +01:00
|
|
|
winit::Event::Closed => break,
|
2015-06-16 13:48:08 +02:00
|
|
|
_ => ()
|
|
|
|
}
|
2014-08-03 17:23:08 +02:00
|
|
|
}
|
|
|
|
}
|