seizer , a library to acquire a rendering context on any platform, so long as the platform is a browser or Linux! I’ve been refining this library for a while, but just today took the time to split it out from the other projects I used it in.
Something I just recently figured out was loading assets in a browser context, where Zig’s
async was invaluable. Browser’s don’t like it when you block the main thread, so things like
fetch return a Promise. This means that programs that use
File.open can’t be converted to run in a browser unless you introduce hacks, like a list of files to preload.
seizer handles this by making the
init function async. When a game fetches a file in the browser,
wasm_finalize_fetch , which will resume the frame. This means that you don’t need to create manifest file or anything like that – just make sure the file is in your server’s
public folder (or its equivalent folder), and everything will be loaded properly.
If you want to see an example of
seizer in use, you can check my 7 day roguelike project: