Hi,
My C++ project already uses both Lua and CEGUI (+ Ogre, ODE, SDL, etc) and I'd like to combine CEGUI's scripting ability with the one I've already set up. I don't want to end up with two Lua "dialects" (and namespaces) in the same project. The project runs on Win32, 32 bit Linux and 64 bit linux, hopefully with OS X support to follow.
Currently we use Lua 5.1.2 whereas CEGUI seems to be built against 5.0.? (the svn copy of CEGUI's ./configure certainly refuses to compile the Lua module on my machine.)
I know that the CEGUI Lua scripting module provides a way to access it's Lua "state" (struct lua_State *) so hopefully I can just alter my code to use CEGUI's state instead of my own.
My question is really about organising the project in the least painful way. I need to distribute a source package to various developers and artists working on the project. I can see two options:
1) Ask all the developers to downgrade to the older Lua version, checkout CEGUI from svn and do ./configure --enable-toluacegui. This seems like a lot to ask of the other users. Or is it possible to compile CEGUI with the newer version of Lua? And how would I go about it?
2) The other possibility (as I see it) is to import both CEGUI and Lua 5.0.x into my source tree and compile them as part of my project (i.e. make vendor branches). My project doesn't even use autotools yet (and I'm basically unfamiliar) so I envisage this being tricky (for me, easier for everyone else). Does anyone have any tips for getting CEGUI to compile in these conditions?
Obviously I may be missing something so if there's another way to do it I'd be glad to hear about it!
Any help/pointers gratefully received.
--
Bull
http://sourceforge.net/projects/bugrdspace
[Solved] Integrating CEGUI Lua with existing Lua
Moderators: CEGUI MVP, CEGUI Team
[Solved] Integrating CEGUI Lua with existing Lua
Last edited by bull on Tue Jul 10, 2007 19:05, edited 1 time in total.
The easiest way to use the same lua state is probably just to give your scripting systems' instance to the cegui script module like so:
As for using Lua 5.1, there is a post on the forum about upgrading, it doesn't require that much work to get it working.
Code: Select all
CEGUI::LuaScriptModule* scriptModule = new CEGUI::LuaScriptModule( mScriptSystem->getState() );
As for using Lua 5.1, there is a post on the forum about upgrading, it doesn't require that much work to get it working.
Taharez: thanks for the tip, I'll definitely do it that way.
Appologies but I can't find the post you mention.
I think I've managed to get it to compile myself though. I had to fixup the Lua installation as it's a bit munged currently. Installing Lua 5.1.2 from source sets the permissions incorrectly. You need to edit the Makefile and comment out the INSTALL_EXEC and INSTALL_DATA lines involving $(CP) and comment the ones using $(INSTALL) back in. (I've sent a bug report about that, and they're fixing it.) You also need to copy <build-dir>/etc/lua.pc into it's usual install directory of /usr/local/lib/pkgconfig and set the permissions correctly (again they're fixing that).
After that I just changed the test in <cegui-build-dir>/acinclude.m4 near [CEGUI_CHECK_LUA] to be 'lua >= 5.0 lua < 6.0' instead of 'lua >= 5.0 lua < 5.1' and then ./configure seemed to build the cegui Lua module ok (but with, possibly unrelated, errors compiling Demo8). I'll report back when I know more. I also had to use the patch provided by ldb (see http://www.cegui.org.uk/phpBB2/viewtopic.php?t=2678 ).
Appologies but I can't find the post you mention.
I think I've managed to get it to compile myself though. I had to fixup the Lua installation as it's a bit munged currently. Installing Lua 5.1.2 from source sets the permissions incorrectly. You need to edit the Makefile and comment out the INSTALL_EXEC and INSTALL_DATA lines involving $(CP) and comment the ones using $(INSTALL) back in. (I've sent a bug report about that, and they're fixing it.) You also need to copy <build-dir>/etc/lua.pc into it's usual install directory of /usr/local/lib/pkgconfig and set the permissions correctly (again they're fixing that).
After that I just changed the test in <cegui-build-dir>/acinclude.m4 near [CEGUI_CHECK_LUA] to be 'lua >= 5.0 lua < 6.0' instead of 'lua >= 5.0 lua < 5.1' and then ./configure seemed to build the cegui Lua module ok (but with, possibly unrelated, errors compiling Demo8). I'll report back when I know more. I also had to use the patch provided by ldb (see http://www.cegui.org.uk/phpBB2/viewtopic.php?t=2678 ).
bull wrote:Appologies but I can't find the post you mention.
This was the thread I referred to, good luck.
Thanks! Yep that worked. The only other thing I needed was one extra line in src/Makefile.am:
Code: Select all
@@ -42,6 +42,7 @@
CEGUISchemeManager.cpp \
CEGUIScheme_xmlHandler.cpp \
CEGUIScriptModule.cpp \
+ CEGUIScriptWindowHelper.cpp \
CEGUISize.cpp \
CEGUIString.cpp \
CEGUISubscriberSlot.cpp \
Who is online
Users browsing this forum: No registered users and 4 guests