Using the lua state from CEGUILua
Posted: Tue Nov 04, 2008 23:15
I'm working on a game project where we use tolua++ ourselves to integrate some c++ functions into lua.
We completely script the GUI happenings in lua and make all calls to a C++ command interpreter. It accepts strings, so we can supply it with almost everything. Sounds like extra work (we could have only used tolua interfaces), but we needed some more flexibility with arguments and temporal restrictions.
Anyway we get a lua state from the scripting module and we call our own FooBar_open() method to initialize our tolua interface. That worked for now except when trying to unload it properly. But that's a smaller issue.
What my mind actually is troubling is the fact that we support both lua 5.1 and 5.0 and both cegui 0.6 and 0.5, where cegui 0.6 supports both lua verions. And I'm guessing mixing both not such a good idea, right?
Currently we've restricted our build system (cmake) to only use lua 5.0 as this is used according to cegui-0.6.1/ScriptingModules/CEGUILua/tolua++bin/README (in v0.5 anyway, no support for lua 5.1 there).
But when building under windows, I have observed that cegui 0.6.1 uses lua 5.1.3. This can be configure in config.lua, but then we can't use the dependencies archive anymore.
What should we do?
About our systems:
Linux (debian, ubuntu, gentoo) and Windows (Visual Studio, MinGW)
We don't build the libraries ourselves under linux, so we have to stick to how the packages have been built. However under windows we supply dependency archives (like cegui), which we build ourselves.
Versions:
CEGUI v0.5 or higher, lua 5.0 or higher, current tolua plus CEGUI modifications with exceptions.
We completely script the GUI happenings in lua and make all calls to a C++ command interpreter. It accepts strings, so we can supply it with almost everything. Sounds like extra work (we could have only used tolua interfaces), but we needed some more flexibility with arguments and temporal restrictions.
Anyway we get a lua state from the scripting module and we call our own FooBar_open() method to initialize our tolua interface. That worked for now except when trying to unload it properly. But that's a smaller issue.
What my mind actually is troubling is the fact that we support both lua 5.1 and 5.0 and both cegui 0.6 and 0.5, where cegui 0.6 supports both lua verions. And I'm guessing mixing both not such a good idea, right?
Currently we've restricted our build system (cmake) to only use lua 5.0 as this is used according to cegui-0.6.1/ScriptingModules/CEGUILua/tolua++bin/README (in v0.5 anyway, no support for lua 5.1 there).
But when building under windows, I have observed that cegui 0.6.1 uses lua 5.1.3. This can be configure in config.lua, but then we can't use the dependencies archive anymore.
What should we do?
About our systems:
Linux (debian, ubuntu, gentoo) and Windows (Visual Studio, MinGW)
We don't build the libraries ourselves under linux, so we have to stick to how the packages have been built. However under windows we supply dependency archives (like cegui), which we build ourselves.
Versions:
CEGUI v0.5 or higher, lua 5.0 or higher, current tolua plus CEGUI modifications with exceptions.