Search the Community
Showing results for tags 'toLua toLua++ binding C#'.
-
Hey all! So recently I've been using Josh's BlitzMax ToLua++ package generator but it just didn't quite do everything I needed, so based off his design I wrote my own C# version that supports a little more variety of situations. The usage is the same! just tag classes (or structs), and public members with the '//lua' comment in your C++ header files and follow the instructions provided on the BitBucket page. After you implement this into your project you will be-able to generator all your ToLua++ bindings with 1-click. The one thing you have to do manually is open the generated C++ files and add any required includes as I haven't made a clean way for this to be done automatically (yet). You can get ToLuaPkgGenerator here. (Windows Only) Just a simple tool I wrote to make my life easier, hope others find it useful as well! Here's an example of the pkg file generated for the Leadwerks namespace: https://pastebin.com/NjpE8L8d Edit: - ToLuaPkgGenerator no longer removes default arguments but now rather replaces unsupported types with the nearest supported one. (In the pkg files, your code is never modified by these programs!) - Todays update will also encase namespaced classes in modules to further prevent ambiguity issues. (i.e: System:Print() will now be Leadwerks.System:Print()) ** This doesn't overload the default bindings Leadwerks provides so the provided Lua files will still work. ** Edit #2: - A naive solution to a namespace issue can be found in my BB repositories called FixToLuaNamespaces. Edit the batch file provided in ToLuaPkgGenerator, uncommenting out the line that executes this application on each generated cpp gluecode file. You simply drop the compiled FixToLuaNamespaces.exe file in the same directory and the ToLuaPkgGenerator.exe file. - In this solution when ToLuaPkgGenerator generates a return type preceded by a namespace like Leadwerks::Sound. FixToLuaNamespaces would replace the strings "Leadwerks::Sound" with "Sound" assuming that's the way ToLua++ named them when they were exposed.