Jump to content

  • Log In with Google      Sign In   
  • Create Account

Mellkor

Member Since 04 Nov 2009
Offline Last Active May 25 2016 03:45 PM

#5292921 Wrapper Function for lua_register?

Posted by Mellkor on 22 May 2016 - 02:16 PM

Hi, 

 

Trying to write a wrapper for a lua virtual machine object that will register functions but am having trouble passing a function pointer parameter to it.

The idea is to pass something like, "Foo.Go" to RegisterFunction and that will associated it with the lua_state member of the virtual machine class.

 

This is what i have:

void LuaVM::RegisterFunction(const char* name, lua_CFunction functionName) 
{	
	lua_register(getState(), name, functionName);
}

I'm getting the error: "a nonstatic member reference must be relative to a specific object", Any ideas on how to tackle this?

 
 



PARTNERS