lua-users home
lua-l archive

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


I figured it out. I just cahnged the lua_State* to luabind::object like so:
Timer::Timer( float delay, int repetitions, luabind::object luaFunction ) :
m_fDelay( delay ), m_iRepetitions( repetitions ), m_fInitialTime(
gpGlobals->curtime )
{
	if ( luabind::type( luaFunction ) != LUA_TFUNCTION )
		throw std::runtime_error("Invalid parameter for Timer constructor. A
function must be used\n");
	m_luaFunction = luaFunction;
}

void Timer::Execute()
{
	m_luaFunction();
}

I honestly don't know the non-luabind way and I'm curious about it but
this will do.