Fix the examples

This commit is contained in:
Ryan Goldstein 2019-09-24 19:44:43 -04:00
parent 86bafdc104
commit dcd9ddde50
3 changed files with 18 additions and 34 deletions

View file

@ -1,15 +1,16 @@
use winit::{
event::{Event, WindowEvent},
event_loop::{ControlFlow, EventLoop},
window::WindowBuilder,
};
#[derive(Debug, Clone, Copy)]
enum CustomEvent {
Timer,
}
#[cfg(not(target_arch = "wasm32"))]
fn main() {
use winit::{
event::{Event, WindowEvent},
event_loop::{ControlFlow, EventLoop},
window::WindowBuilder,
};
#[derive(Debug, Clone, Copy)]
enum CustomEvent {
Timer,
}
let event_loop = EventLoop::<CustomEvent>::with_user_event();
let _window = WindowBuilder::new()
@ -39,3 +40,8 @@ fn main() {
_ => *control_flow = ControlFlow::Wait,
});
}
#[cfg(target_arch = "wasm32")]
fn main() {
panic!("This example is not supported on web.");
}