mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-11 13:31:29 +11:00
Fix the examples
This commit is contained in:
parent
86bafdc104
commit
dcd9ddde50
|
@ -1,3 +1,5 @@
|
||||||
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
|
fn main() {
|
||||||
use winit::{
|
use winit::{
|
||||||
event::{Event, WindowEvent},
|
event::{Event, WindowEvent},
|
||||||
event_loop::{ControlFlow, EventLoop},
|
event_loop::{ControlFlow, EventLoop},
|
||||||
|
@ -9,7 +11,6 @@ enum CustomEvent {
|
||||||
Timer,
|
Timer,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
|
||||||
let event_loop = EventLoop::<CustomEvent>::with_user_event();
|
let event_loop = EventLoop::<CustomEvent>::with_user_event();
|
||||||
|
|
||||||
let _window = WindowBuilder::new()
|
let _window = WindowBuilder::new()
|
||||||
|
@ -39,3 +40,8 @@ fn main() {
|
||||||
_ => *control_flow = ControlFlow::Wait,
|
_ => *control_flow = ControlFlow::Wait,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(target_arch = "wasm32")]
|
||||||
|
fn main() {
|
||||||
|
panic!("This example is not supported on web.");
|
||||||
|
}
|
||||||
|
|
|
@ -2,15 +2,7 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
extern crate env_logger;
|
extern crate env_logger;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
use std::{collections::HashMap, sync::mpsc, thread, time::Duration};
|
use std::{collections::HashMap, sync::mpsc, thread, time::Duration};
|
||||||
=======
|
|
||||||
use winit::{
|
|
||||||
event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent},
|
|
||||||
event_loop::{ControlFlow, EventLoop},
|
|
||||||
window::{CursorIcon, Fullscreen, WindowBuilder},
|
|
||||||
};
|
|
||||||
>>>>>>> master
|
|
||||||
|
|
||||||
use winit::{
|
use winit::{
|
||||||
event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent},
|
event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent},
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
<<<<<<< HEAD
|
|
||||||
#[cfg(not(target_arch = "wasm32"))]
|
|
||||||
=======
|
|
||||||
// Limit this example to only compatible platforms.
|
// Limit this example to only compatible platforms.
|
||||||
#[cfg(any(
|
#[cfg(any(
|
||||||
target_os = "windows",
|
target_os = "windows",
|
||||||
|
@ -11,7 +8,6 @@
|
||||||
target_os = "netbsd",
|
target_os = "netbsd",
|
||||||
target_os = "openbsd"
|
target_os = "openbsd"
|
||||||
))]
|
))]
|
||||||
>>>>>>> master
|
|
||||||
fn main() {
|
fn main() {
|
||||||
use winit::{
|
use winit::{
|
||||||
event::{Event, WindowEvent},
|
event::{Event, WindowEvent},
|
||||||
|
@ -19,10 +15,6 @@ fn main() {
|
||||||
platform::desktop::EventLoopExtDesktop,
|
platform::desktop::EventLoopExtDesktop,
|
||||||
window::WindowBuilder,
|
window::WindowBuilder,
|
||||||
};
|
};
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
|
|
||||||
>>>>>>> master
|
|
||||||
let mut event_loop = EventLoop::new();
|
let mut event_loop = EventLoop::new();
|
||||||
|
|
||||||
let window = WindowBuilder::new()
|
let window = WindowBuilder::new()
|
||||||
|
@ -57,13 +49,7 @@ fn main() {
|
||||||
println!("Okay we're done now for real.");
|
println!("Okay we're done now for real.");
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
#[cfg(any(target_os = "ios", target_os = "android", target_arch = "wasm32"))]
|
||||||
#[cfg(target_arch = "wasm32")]
|
|
||||||
fn main() {
|
|
||||||
panic!("Example not supported on Wasm");
|
|
||||||
=======
|
|
||||||
#[cfg(any(target_os = "ios", target_os = "android"))]
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("This platform doesn't support run_return.");
|
println!("This platform doesn't support run_return.");
|
||||||
>>>>>>> master
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue