lua-users home
lua-l archive

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


I'm writing a C++ wrapper class that allows me to manipulate variables in a loaded lua script. It works fine, but is very slow because I'm performing these operations many times (in real-time). Is there a way to write directly to the memory location without having to search and push the variable onto the stack by name?

example:

LuaBool myBool ( lua_state, "boolvar_in_script" );
LuaFloat myValue ( lua_state, "floatvar_in_script" );

for loop()
{
   myBool = false; // write to variable
   myValue= 1.25f;

 

   bool tmpBoolean = myBool; // read from variable
}