1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#![allow(clippy::module_name_repetitions)]
pub use px_draw::graphics;
pub use px_draw::vector2;
pub mod traits;
mod decals;
pub mod inputs;
mod logic;
mod screen;
pub use graphics::{Color, PixelMode, Sprite};
pub use logic::{Engine, EngineWrapper};
pub fn launch<F: 'static + std::future::Future<Output = ()>>(f: F) {
#[cfg(target_arch = "wasm32")]
{
use std::panic;
panic::set_hook(Box::new(crate::console_error_panic_hook::hook));
crate::wasm_bindgen_futures::spawn_local(f);
};
#[cfg(not(target_arch = "wasm32"))]
crate::futures::executor::block_on(f);
}