[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Getting the address of Lua variables in C
- From: "Krzysztof Jakubowski" <kjakubowski@...>
- Date: Fri, 7 May 2004 17:08:51 +0200
> I would like to do this in C:
>
> int *p_time;
>
> p_time = (int*)LuaGetVarAddress("time");
>
> and, for every game frame:
>
> *p_time = GetTime();
I assume that GetTime() returns a number (integer or float). Then you change
global variable "time" that way:
lua_pushnumber(L, GetTime());
lua_setglobal(L, "time");