Re: C++ Object pointers in Lua
Teto <[email protected]>
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <[email protected]> |
you can do: MyObject* a = new MyObject(); luabind::object global_vars = luabind::globals(_script.mLuaState); global_vars["a"] = a; On Wed, Jan 13, 2010 at 10:49 PM, Peter Dam <[email protected]> wrote: > Hello, > I have a class exported with Luabind which works perfectly if is always > inside Lua. > a = MyObject() > a:doSomething() > This all works perfectly... But I haven't figured out how to work on an > instance created in C++, for example: > MyObject* a = new MyObject(); > /* pass the pointer to Lua here */ > And now in Lua: > a:doSomething(); > So my previously created instance in C++ can be worked upon in Lua, and once > finished will be updated and working in C++ > > > How can I do this? > > Thanks in advance, > Peter. > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > luabind-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/luabind-user > > ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev