Original Post
I have a Lua interpreter up and running from my C++ application, and was wondering if there's a way to retrieve Lua's error messages. Right now they just print to stdout or stderr, but I'd like to print them on my in-game console. Also, is this the simplest way to get a global value from Lua to C++?
Real GetReal( lua_State* lua, const Char* szVarName )
{
lua_pushstring(lua, szVarName);
lua_gettable(lua, LUA_GLOBALSINDEX);
Real rValue = lua_tonumber(lua, 1);
lua_pop(lua,1);
return rValue;
}
This works for now, but it seems there should be a simpler way. Thanks for any help.