Jump to content

Getting the Lua state


Laurens
 Share

Recommended Posts

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...