accessing c++ class members with luaplus

Posted by cppanda on Game Development See other posts from Game Development or by cppanda
Published on 2011-02-25T00:02:41Z Indexed on 2011/02/25 7:33 UTC
Read the original article Hit count: 362

Filed under:
|

i've implemented LuaPlus in my engine eventmanager successfully and really like the flexibility i gained.

but i'm still not exactly where i want to by, because i can't link my c++ classes to a lua class.

for example i have a Actor class in c++, and i want to be able to create the same class in lua and gain access to members with luaplus, but i can't figure how i can achieve that.

Is this actually luaplus built in functionality, or do i have to write my own interface that exchanges data tables between c++ and lua?

my current approach would be to fire an event in luascript that creates an new actor class in c++ code, and transfer its id and the data i need to back to lua. when i modify the data i send the modifications back to c++ code again, but i actually thought there's something in luaplus that exposes this functionality already.

© Game Development or respective owner

Related posts about c++

Related posts about lua