lua-users home
lua-l archive

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


Title: C++ ==> Lua ==> C++

Hello,

Here's one:

We use toLua++ to bind our C++ game-engine to Lua.
Quite naturally, the game-engine must run full-out.

Still, from the game-engine we create a Lua environment and do some stuff in Lua: populate and query our game engine, and use wxLua to graphically do this.  Very nice.

The goal is to have the game engine continually running, as fast as possible, and also be able to influence it from Lua (which is started from C++).


Here's the question:  When Lua is started (via the interface generated by toLua++), Lua has control, i.e. the game-engine doesn't run, unless we "tick" it from Lua.

Would you recommend:
a)  Starting the Lua environment from a sub-thread of the main C++ game-engine, or
b)  Creating a Lua co-routine with the single responsibility of continually ticking the game-engine



Thankyou,
m'ed