Malcolm Still
Malcolm Still
@acodervic thank you for your intereset. Have a look at https://github.com/malcolmstill/zware-doom/blob/master/src/interface.zig. This repo is embedding Doom compiled to wasm (from https://github.com/malcolmstill/doom) in a zig program that provides graphics and input....
The previous reply covered calling WebAssembly code (from zig) via the `Api` struct and WebAssembly calling zig code (registered via `exposeHostFunction`). As to the issue title of compiling zig code...
Let me know if that helps (or indeed if it doesn't help!) and I can try to clarify. Feel free to share any code you have and I can try...
@acodervic right, so there was an issue with the `build.zig` in https://github.com/malcolmstill/doom. I've pushed a change that I think works for both zig master and zig 0.11 (the version of...
Okay, so let's do this from scratch. # Step 1. Our WebAssembly program We'll do this part in zig, but this could really be any language that emits wasm. We'll...
@acodervic let me know if that clarifies things, or if there's any more detail I can give (which I am more than happy to do!)
Right, let's try starting our WebAssembly program with `zig init-lib`: This gives us this `main.zig` (which we won't modify): ```zig const std = @import("std"); const testing = std.testing; export fn...
@acodervic so this library case is not ideal at the moment (having to manually define the memory). There are a couple of things to improve here: - Maybe I'm not...
@acodervic that looks like it should work. I pulled down your `.zip` and when I run `zware-gen` on the built `.wasm` I get: ```zig const std = @import("std"); const zware...
> Not quite sure how I feel about it. It suddenly becomes more of a "public API" Yeah, that's fair. It's not difficult for someone to implement whatever they need...