Tomasu / LuaGlue

C++11 Lua 5.2 Binding Library
zlib License
79 stars 22 forks source link

Get c++ object instnce from lua #78

Open evangelist88 opened 7 years ago

evangelist88 commented 7 years ago

Hi all,

how can I get a c++ object instance from lua without call a "new" inside lua script?

In other words, I need to get a lua object from c++ code and viceversa.

Someone could help me

Thanks a lot

Tomasu commented 7 years ago

you can pass C++ objects into lua easily. If the method or function you bind to lua takes an object, it'll bind it properly. there are plenty of examples in the examples folder. If you could share a more concrete example of what you want to do I can help further.