[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua Embedding Question
- From: "Peter Shook" <pshook@...>
- Date: Fri, 25 Apr 2003 00:16:58 -0400
> If anybody can give me any insight into the best way to work this system
> I'd appreciate it greatly.
I'm not a gamer, but as a Lua fanatic, I don't like letting newbie questions
go unanswered. If you want to call Lua functions from C++, you'll need
to stash them in a sub-table of either the Registry or the table of globals,
and then you can invoke them with lua_pcall from your C++ code.
I've put another example on the wiki here
http://lua-users.org/wiki/CallingLuaFromCpp
If you need to store Lua values associated with a C++ object, you can use
lightuserdata
(pointers to C++ objects) as keys to Lua values stored in a table.
Cheers,
- Peter Shook