Using the lua state from CEGUILua

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

1337
Just popping in
Just popping in
Posts: 9
Joined: Tue Nov 04, 2008 22:54

Using the lua state from CEGUILua

Postby 1337 » 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.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Wed Nov 05, 2008 14:28

Hi, and welcome :)

Ummmm... :? I think the README file in that directory is the one that comes with tolua++ with a note added with regards to our modifications, so the mention of the Lua 5.0 API is just because that's what the original file said. Though we should probably update that in order to not confuse people.

If you want to use Lua 5.0 with Win32 with CEGUI 0.6.1, you could just delete the newer Lua version in the 0.6.x deps package and replace it with the older Lua version from the 0.5.x dependency package, and then edit the config.lua as you say and regenerate the MSVC++ projects.

With regards to CEGUI 0.5.x only supporting Lua 5.0, you could patch in support for Lua 5.1 if you desire, the code mods were fairly minimal IIRC (I think it's one of the things the Gentoo patch in portage does for 0.5.x so you could look there) - our configure detection of lua version was a more substantial modification, although if you're using prepackaged versions of CEGUI on Linux based platforms you could obviously skip that part anyway. If you are interested in this, and the Gentoo patch route is not doing it for you, ask and I'll try to come up with something.

Umm, so yeah. If you need Lua 5.0 with CEGUI 0.6.1 - use the libs/headers in the CEGUI 0.5.x deps package :)

CE.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 4 guests