Open chances opened 4 years ago
I think a better alternative would be hooking rust's own bindgen functionality to generate d bindings.
Perhaps an abstraction of cbindgen that transforms its Intermediate Representation into a D module with the necessary extern
s and whatnot?
Actually, upon thinking about the matter a bit more, I think even better would be for cbindgen to dump its internal representation into some common format—json or similar—which can be consumed by any language. (Like how bindings are automatically generated for xcb and opengl based on xml specs.) I'll file a ticket on cbindgen later.
I just updated the bindings manually for #12 (ugh, 😝️).
@moon-chilled Have you made any progress experimenting with cbindgen?
Finally available with ImportC? https://github.com/chances/wgpu-d
@cyrusmsk Exactly, though wgpu-d is still quite verbose in its "idiomatic" wrapping.
ImportC is magic. 😄
D support (WiP) - w/cpp_compat
I'm still tweaking functors support and some fixes to the order of opaque structure templates.
@gecko0307 From your comment in #7, the wgpu function declarations are being hand-written?
Alternatives
https://wiki.dlang.org/Bindings#Binding_generators
wgpu.h
Con: It generates a bloated D file.htodUnmaintained and doesn't work withwgpu.h