[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua in C++
- From: Daniel Silverstone <dsilvers@...>
- Date: Tue, 16 Apr 2002 15:10:57 +0100
On Tue, Apr 16, 2002 at 03:46:41PM +0200, firstname.lastname@example.org 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 http://www.digital-scurf.org/
Hostmaster, Webmaster, and Chief Code Wibbler Digital-Scurf Unlimited
GPG Public key available from keyring.debian.org KeyId: 20687895
You will soon forget this.