|
Hi.I'm using lua embended in a game engine.i have
the
folowing problem: i've crated a c++ object where i have an array of lua_State * variables(one for history, one for simple interpretor, one for renderer,..and so on).i use lua to give orders to other objects stored in dlls.what i want to do is to switch between states, so the command from the console goes to the current state.so i've made another member of the c++ object like this: lua_State * currentstate; and i've initialized it with NULL;so when i want to change the states i assign to this memeber a lua state from the array and the commands are executed only in the current state.well the problem is it isn't working only if i declare all the threads whom i want to assign another thread as a static memeber.and this is not very good for my program design.if i don't do this thing when i'm executing the program i get some adress 0x00..bla00bla cannot be "read".so i cannot go on.please tell me why does this happens and how can i avoid the static members. thanks |