MCPcopy Create free account
hub / github.com/explodingcamera/tinywasm / main

Function main

examples/doom/src/main.rs:20–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18const DEFAULT_TITLE: &str = "tinywasm doom";
19
20fn main() -> Result<()> {
21 pretty_env_logger::init();
22
23 let wad_path = std::env::args().nth(1).map(PathBuf::from).context("usage: cargo run -p tinywasm-doom -- <wad>")?;
24 if !wad_path.exists() {
25 bail!("WAD not found: {}", wad_path.display());
26 }
27
28 let guest_path = Path::new(GUEST_MODULE);
29 if !guest_path.exists() {
30 bail!("guest module missing: {}. Run ./examples/doom/build.sh first", guest_path.display());
31 }
32
33 let event_loop = EventLoop::new()?;
34 let mut app = DoomApp::new(wad_path, guest_path.to_path_buf())?;
35 event_loop.run_app(&mut app)?;
36 Ok(())
37}
38
39struct DoomApp {
40 runtime: Runtime,

Callers

nothing calls this directly

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected