lua-users home
lua-l archive

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

Title: Exposing class instances as globals

I've been playing around with Lua a bit, and I've been able to expose my classes to Lua as tables.  However, I'm not sure how I can create an instance of a class in C++, and expose this instance to Lua as a global.  I can register the instance functions, but I don't know how to associate a name with the functions.

Any tips?  I could perhaps expose a function that works like Luna's constructor, registering an existing instance's functions, but this seems less than optimal.