[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Saving a Lua table in C/C++?
- From: pixellent@...
- Date: Thu, 13 Feb 2003 15:49:48 -0500
I'm trying to write a simple timer manager in my game, which uses Lua 4 & ToLua.
I have a function called Schedule in my C++ timer manager that is called from
Lua by:
Timer:Schedule("function_to_call_when_timer_expires")
I want to make the Schedule function as flexible as possible. I thought that I
could do this by passing a Lua table as a parameter. The timer manager could
then extract the function name to call and the table and save them somewhere.
When the timer expires, the timer manager could extract the table and pass it
into the given Lua function as a parameter.
Is this possible? I noticed from the mailing lists that Lua 3.2 had a lua_Object
data type, but this doesn't exist in Lua 4. I'm a little confused as to how I
could save the table as there doesn't seem to be a specific "table type". Any
help is greatly appreciate.
Thanks
Mike
http://pixellent.stodge.net/index.php