lua-users home
lua-l archive

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


Hello,

after the VERY usefull help from Björn De Meyer I'm really considering lua
as a first choice for my (small and parttime) game project...
Six months ago I've done some tests with a skeleton application just to wrap
and handle C++ <--> lua calls and that was fine.

But, now I'm facing another problem. My first idea was (as in this skeleton
app) to attach a script context to every instance of a class that would need
it.
For example :
CWorld (1 instance)
CScene (few instances)
CCharacter (several instances)
CItems (many instances)
CSectors (several)

Each C++ instance run its own lua context. This is very easy to do and very
clean to code. But unfortunately I have now a main render loop that can't
wait for a script to spend too long in its bytecode run. I can control which
instance is eligible to call lua (or maybe next time if we allready spent
too long in the instances loop)

How could I do to interrupt a vm and switch it back later to continue
execution ? Is the debugger hook the one and only solution ? Is the overall
idea ok ?

Thank you

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com