lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Tue, Apr 16, 2002 at 03:46:41PM +0200, wrote:
> no reference to the original object. Is there some easy way of 
> storing my custom pointer within the lua_state or is there some 
> other solution to this problem?

One possibility is to use a userdata to store a pointer to your C++ class
instance, and then ensure that the userdata is passed to each of those
static functions (by using closures -- look at push_cclosure in your manual)

> I'm sorry if this is a stupid question. I'm a lua newbie.

We all were newbies once :)


Daniel Silverstone                     
Hostmaster, Webmaster, and Chief Code Wibbler          Digital-Scurf Unlimited
GPG Public key available from               KeyId: 20687895
You will soon forget this.