[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: pushing a table
- From: "Joshua Jensen" <jjensen@...>
- Date: Thu, 21 Oct 2004 22:10:21 -0600
> I want to store a pointer to a table in a c++ class, then
> push the table onto the lua stack, and call a lua method that
> accepts the table as the first param.
> I don't seem to be able to store a table as a void* and then
> push it as a table via the lua c api ...
You'll have to store the table in the registry and look it up when you need
Alternativately, a C++ enhanced distribution of Lua (http://luaplus.org/)
allows tables (and other Lua types) to be stored in regular C++ objects
(called LuaObject) and maintained outside the stack or registry. That is:
m_obj = luaState->GetGlobal("SomeTable");