Skip to content
Simple C++ bindings for Lua
C++ C Lua
Latest commit 8ba333b Jul 24, 2014 @ignacio Adds get_full_class_name_T function to provide better introspection.
This commit adds the function get_full_class_name_T which can be overriden
by the exposed classes. The returned string is used to populate the __name
field of the exposed class metatable. This allows to provide better introspection
since we can provide the full name of the class (i.e. including the module name)
instead of just using exported class name.

By default, get_full_class_name_T will return the className unless overridden.

LuaCppBridge51 is a library to expose C++ classes to Lua. You pick a class from the library to derive from, add the desired methods, properties, etc and register it into Lua. It is a very simple wrapper that does not aim to expose already existing C++ classes. There are lots of libraries for that (Simple Lua Binder, LuaBind, OOLua, etc).

LuaCppBridge51 builds on ideas from binding classes using Lunar and Lua Technical Note 5. It builds on Lunar, adding the following:

  • allows you to define properties, by means of getter/setter methods in C++.
  • retrieve Lua instances from C++ callbacks

The following were already present in Lunar:

  • add new class methods from Lua
  • simple inheritance (make a C++ class inherit from a "class" in Lua, or viceversa)

More detailed documentation is available on the wiki

Something went wrong with that request. Please try again.