How can I register my C/C++ functions to LUA script module?

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

televoncard
Just popping in
Just popping in
Posts: 4
Joined: Mon Oct 30, 2006 02:28

How can I register my C/C++ functions to LUA script module?

Postby televoncard » Mon Oct 30, 2006 05:28

Hi.

I want to write event handling code in lua scripts, so I want to call some C/C++ functions which I wrote. I hope a function which enables me to register my functions to Lua script module, but I coudn't find such functions.

How can I register my C/C++ functions to LUa script module? Or how can I call my functions from LUA scripts?

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Mon Oct 30, 2006 18:29

This is really outside the scope of CEGUI and CEGUILua.

I can really recommend the Lua manual, it's pretty well written and get straight to the point.

Lua Manual : Defining C Functions

For binding the CEGUI API to Lua we use tolua++ to generate bindings. Depending on the amount of code you want to bind to Lua you might want to consider going that route. CEGUI 0.5 has everything you need to (re)generate the CEGUI bindings right in the svn repository. It might be a nice sample/reference for you to get started.
Note that we are using a customised generator with added exception handling attributes.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 19 guests