4 ms·
(disclaimer: shameless plug) Here's another cross-platform alternative, auto-generated Zig bindings to the Sokol headers: https://github.com/floooh/sokol-zig h
by flohofwoe 5y ago
(disclaimer: shameless plug) Here's another cross-platform alternative, auto-generated Zig bindings to the Sokol headers:
https://github.com/floooh/sokol-zig https://github.com/floooh/sokol-zig
This is quite a bit slimmer than using one of the WebGPU libraries like wgpu-rs or Dawn, because sokol-gfx doesn't need an integrated shader cross-compiler (instead translation from a common shader source to the backend-specific shader formats happens offline).
Eventually I'd also like to support the Android, iOS and WASM backends from Zig (currently this only works from C/C++, for instance here are the samples compiled to WASM: https://floooh.github.io/sokol-html5/ https://floooh.github.io/sokol-html5/)
And finally, I'd also like to become completely independent from system SDKs for easier cross-compilation, but with a different approach: by automatically extracting and directly including only the required declarations right into the source files instead of bundling them into separate git repositories (similar to how GL loaders for Windows work).
- slimsag 5y agovery cool work :) If you like, add a screenshot or two and I'll include this in the next zigmonthly.org article you might also be interested to know about stub dynamic libraries, e.g. `.tbd` files on MacOS. That's what is in the Mach SDK repos primarily[0], though I'm sure you could slim them down some more with a concrete list of symbols you depend on. [0] https://github.com/hexops/sdk-macos-11.3/blob/main/root/System/Library/Frameworks/Metal.framework/Metal.tbd https://github.com/hexops/sdk-macos-11.3/blob/main/root/Syst...
- politician 5y agoI love this codebase. I’ve been working with it on the side for a few weeks: it’s extremely well documented, supports Metal, has reasonable abstractions that don’t try to be the One True Way, and the Zig port looks really clean.