do anybody knows of sane lua binding generator?

Problems building or running the engine, queries about how to use features etc.
slapin
Bronze Sponsor
Bronze Sponsor
Posts: 250
Joined: Fri May 23, 2025 5:04 pm
x 16

do anybody knows of sane lua binding generator?

Post by slapin »

Hi, all!
I have a set of data only-structs which represent world in my Ogre game and want to export these to Lua scripts among things like Ogre::Vector3.
I got really tired from manual writing of code for each struct and debug errors in there... I tried the following things:

  1. sol2 OMG what a mess... It magically makes mess out of the project with basic C++ things stopping working, it does not namespace anything and forces its guts on you...
  2. LuaBridge - did not reduce amount of boilerplate much
  3. LuaBind - supports only older versions of Lua
  4. toloa++ - works best but does no support modern Lua features...

So have anybody used any binding generator in practice?

paroj
OGRE Team Member
OGRE Team Member
Posts: 2237
Joined: Sun Mar 30, 2014 2:51 pm
x 1216

Re: do anybody knows of sane lua binding generator?

Post by paroj »

Ogre uses swig to generate python and c# bindings. Swig also supports lua. Actually our bindings are based on some lua project i found on github. However it seems to be gone now. Still the swig route is worth checking

Actually procedural still has some working lua stuff
https://github.com/OGRECave/ogre-proced ... /extrusion

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 250
Joined: Fri May 23, 2025 5:04 pm
x 16

Re: do anybody knows of sane lua binding generator?

Post by slapin »

I found luaaa project https://github.com/gengyong/luaaa which almost does what I want... But it is impossible to use bound classes as return values of c++ functions,
which is sad... (as class bindings are separate from type bindings as for class it is assumed it is created on Lua side). Swig bindings are quite generic thanks for the idea. I do not plan to export engine guts to Lua, just my world data, so the most complex thing would be Ogre::Vector3. Will struggle for a bit with less complex solutions first and will take Swig in case of failure... Need to keep Lua under control and prefer manuall approach where feasible...