I didn’t found any projects for OBS on zig, so I must do it myself. The idea now is to create bindings, so they’re will be used in my multichat plugin.
Dependencies can be found there https://github.com/obsproject/obs-plugintemplate.
Docs for Plugin API: https://docs.obsproject.com/plugins.
While I’ve tried translate-c, it returned lots of @compileError
P.S.: I didn’t have a deal with integration of Clang code into Zig myself, so any guides will be very helpful
Most of the time, there is no problem with them. If you ever use anything from the problematic definitions you get the compile time error, until then you can ignore them.
A hint: find a very simple example and try to convert it in zig and build it, first without a build file.
e.g. zig build-lib myplugin.zig -lobs
Thanks a lot! I’ve tried a few things. As I found in case of OBS plugin API, @cImport/@cInclude perfectly do their job, except few macros.
For other who’ll want to repeat this, I’ll recommend to go in libobs sources and re-write some macros to Zig, especially OBS_DECLARE_MODULE().
Simple example on Zig: