pico_engine_shell/
lib.rs

1#![cfg_attr(not(target_arch = "wasm32"), no_std)]
2
3#[cfg(target_os = "none")]
4pub mod pico;
5
6#[cfg(target_arch = "wasm32")]
7pub mod web;
8
9// Re-export common types
10pub use pico_engine_core::{Game, Engine};
11pub use pico_engine_hardware::Hardware;
12
13// Platform-specific re-exports for Pico
14#[cfg(target_os = "none")]
15pub use pico::{run as run_pico, entry};
16
17// Platform-specific re-exports for Web
18#[cfg(target_arch = "wasm32")]
19pub use web::run as run_web;
20
21// Dummy re-exports for IDE when analyzing without target
22// These won't be used at runtime, just help IDE understand the API
23#[cfg(not(any(target_os = "none", target_arch = "wasm32")))]
24pub use pico_engine_core::Engine as entry;
25
26#[cfg(not(any(target_os = "none", target_arch = "wasm32")))]
27pub fn run_pico<G: Game>(_game: G) -> ! {
28    panic!("run_pico only available on embedded targets")
29}
30
31#[cfg(not(any(target_os = "none", target_arch = "wasm32")))]
32pub fn run_web<G: Game>(_game: G, _canvas_id: &str) {
33    panic!("run_web only available on wasm32 targets")
34}