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?
How can I register my C/C++ functions to LUA script module?
Moderators: CEGUI MVP, CEGUI Team
-
- Just popping in
- Posts: 4
- Joined: Mon Oct 30, 2006 02:28
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
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.
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.
Who is online
Users browsing this forum: Bing [Bot] and 25 guests