lua-users home
lua-l archive

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


Hi. I’m using toLua++ to make my c++ game engine accessible from lua scripts. All is working as expected but I’m wondering if there is any way to access internal structures of c++ classes (structs, enums…) from lua. The problem is that I don’t know how to specify the scope of those structures in lua scripts. Given the following class in c++ (which is parsed correctly by toLua++):


class Channel

{

      enum ChannelDirection

      {

            INVERSE = -1, DIRECT = 1

      };

     

      ...

};


How can I use the enum values in a lua script? I’ve tried something like


x = Channel:ChannelDirection:INVERSE


but I get the following error: “function arguments expected near ':'”


Thanks in advance,

Alberto