Shader = { Label, SHandler, SType, Qual };
Shader.Label = "Proto Vertex Shader - Difuse";
Shader.Qual = 100;
int Qual = lua_getglobal(L, "Shader.Qual");
temp = (int)lua_tonumber(L, 1);
lua_pop(L, 1);
Shader = { Label, SHandler, SType, Qual };
Shader.Label = "Proto Vertex Shader - Difuse";
Shader.Qual = 100;
int Qual = lua_getglobal(L, "Shader.Qual");
temp = (int)lua_tonumber(L, 1);
lua_pop(L, 1);
#include <luabind/luabind.hpp>#include <luabind/object.hpp>using namespace luabind;lua_State* L;object shader = get_globals(L)["Shader"];int Qual = object_cast<int>(shader["Qual"]);string Label = object_cast<string>(shader["Label"]);
Quote: Original post by Sneftel
"Shader.Qual" isn't a global variable. "Shader" is. "Qual" is a key in that table. You'll need to get the "Shader" global, push the string "Qual" onto the stack, and use gettable to retrieve that value.
lua_pushstring(state, "Shader");lua_gettable(state, LUA_GLOBALSINDEX);lua_pushstring(state, "Qual");lua_gettable(state, -2);int Qual = lua_tonumber(state, -1);lua_pop(state, 2);