Misc Go interop fixes

This commit is contained in:
2024-04-27 12:16:04 -07:00
parent 042f2dca79
commit c124e60168
13 changed files with 77 additions and 58 deletions

View File

@ -3,6 +3,7 @@ use std::rc::Rc;
use error_iter::ErrorIter as _;
use log::error;
use pixels::{Pixels, SurfaceTexture};
use player::HOSTED_DEVICE;
use viperid::{Device, VResult, SCREEN_H, SCREEN_W};
// https://github.com/parasyte/pixels/blob/main/examples/minimal-web/src/main.rs
use winit::{dpi::LogicalSize, event::Event, event_loop::{ControlFlow, EventLoop}, window::WindowBuilder};
@ -15,12 +16,11 @@ fn main() {
async fn run() {
let wasm = include_bytes!("../../../example_project/build/game.wasm");
let device = Device::new();
let mut executor =
player::Executor::new(device.share(), wasm)
player::Executor::new(wasm)
.expect("should have been able to create executor");
host(device, move || {
host(HOSTED_DEVICE.with(|d| d.share()), move || {
executor.update();
executor.get_error()?;
Ok(())