A simple game lib for mac, windows, linux and web with support for crosscompilation to the mentioned platforms.
Purpose: For me to learn graphics programming.
- glfw
- wgpu-native
- emscripten(web)
- crosscompilation
- a high level api
- only zig as dependencie
fn drawFram() {
var scene = zgl.Scene.init(allocator);
defer scene.deinit();
try scene.drawRectanle(.{ .x, .y, ...});
try scene.drawCircle(...);
}
See examples directory.
wgpu-native and emscripten both differ from webgpu-native header. Webgpu isn't completed yet but creating bindings proves tiresome.
One option is to use zig translate-c option but I quite like doing the bindings manually for learning purposes.
- wgpuSurfaceCapabilities in emscripten doesn't have field usages.
- wgpuFrontFace enum values differs
- wgpuPrimitiveTopology enum values differs
zig build docs -p ./