Laurens Posted August 30, 2011 Posted August 30, 2011 Hi guys, I am trying to get CEGUI to play nice with Leadwerks' already opened Lua state: byte* lua = GetLuaState(); _ceguiScriptModule = CEGUI::LuaScriptModule::create(lua); but this doesn't fly. CEGUI is expecting a lua_State object and not a byte pointer. Is there any way I can get an actual lua_State from Leadwerks? Thanks! Quote
Rick Posted August 30, 2011 Posted August 30, 2011 Just throwing this out there but can you cast it? Quote
Laurens Posted August 30, 2011 Author Posted August 30, 2011 I have not tried that yet. I suspect that would require me to pull the Lua headers in and I was hoping to avoid yet another complication. If there is no way to get it from Leadwerks I guess I'll give it a go though. Quote
Rick Posted August 30, 2011 Posted August 30, 2011 Try casting it to lua_State without bringing in the Lua headers and see what happens. I suspect LE.DLL had to link in Lua so maybe it comes through to our projects. If not then yeah you'll probably have to bring in the headers. Quote
Laurens Posted August 30, 2011 Author Posted August 30, 2011 Well it's compiling now, but it won't run: _ceguiScriptModule = &CEGUI::LuaScriptModule::create(reinterpret_cast<lua_State*> (lua)); The application failed with exit code -1073741515 (0xc0000135). This could indicate that no required .dll was found in the PATH. I suspect I cannot cast the lua state from Leadwerks and pass it to CEGUI the way I am doing because I do have CEGUILuaScriptModule_d on the path and there seem to be no other scripting-related DLL's in the archive. I've asked on the CEGUI forum what DLL's to actually include so I can rule that out though: http://www.cegui.org.uk/phpBB2/viewtopic.php?f=10&t=5794 Quote
Laurens Posted August 30, 2011 Author Posted August 30, 2011 Well, appearantly I was missing both lua_d.dll and tolua++_d.dll from my path but I was unable to find any documentation on that. Anyway, now I can hand CEGUI Leadwerks' lua_State but now Leadwerks crashes on running the first script. I guess these two aren't meant to be. I already asked on the CEGUI forum but I'd like to hear from you guys as well, would there be any objection against having multiple Lua states open at the same time? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.