Basic output system

This commit is contained in:
2024-04-22 19:57:27 -07:00
parent 082fbf3e80
commit aae336ca66
13 changed files with 959 additions and 91 deletions

View File

@ -7,5 +7,6 @@ edition = "2021"
[dependencies]
anyhow = "1.0.82"
minifb_host = { path = "../minifb_host" }
player = { path = "../player" }
viperid = { path = "../.." }

View File

@ -1,6 +1,6 @@
use std::path::PathBuf;
use viperid::VResult;
use viperid::{Device, VResult};
use crate::go_builder::GoBuilder;
@ -10,14 +10,15 @@ fn main() -> VResult<()> {
let builder = GoBuilder::new(
&PathBuf::from("example_project"))?;
let wasm = builder.build()?;
let mut executor = player::Executor::new(&wasm)?;
let device = Device::new();
while executor.is_running() {
println!("update started");
let mut executor = player::Executor::new(device.share(), &wasm)?;
minifb_host::host(device, || {
executor.update();
println!("update completed");
executor.get_error()?;
}
Ok(())
})?;
Ok(())
}