You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if the TypeAlias wrapper could be eliminated and the function pointer struct were named using its declared name. Additionally, it should provide a constructor and explicit conversion operator for ease of use.
Like this:
I was experimenting with this before. The main problem was that wrapping a function pointer in a struct is useful for the case when using delegates for backwards compatibility before .NET 5. I was lazy so I left it wrapped.
You can take a look at the generator class with uses Roslyn to create the struct:
I've switched to ImGui for now so I can make progress faster, so I'm not using this tool for now, but when I inevitably need bindings for another library I'll make a fork of this to make improvements on.
I've searched around a lot and this is so far the best/easiest option for generating bindings that I've found! If I need to pick it back up I'm happy to contribute.
I'm trying to generate bindings for Nuklear.
It declares the following function pointer:
https://github.com/Immediate-Mode-UI/Nuklear/blob/a14e55f536e0d582930b68b2d3cac7296bae3a25/nuklear.h#L504
This generates the following C#:
It would be nice if the TypeAlias wrapper could be eliminated and the function pointer struct were named using its declared name. Additionally, it should provide a constructor and explicit conversion operator for ease of use.
Like this:
The text was updated successfully, but these errors were encountered: