I would like to use function such as
r = engine->RegisterObjectMethod("EventManager", "int RegisterSomeCallback(?&in ,const string &in)", asMETHODPR(EventManager, RegisterSomeCallback, (void *,const string &), int), asCALL_THISCALL);assert( r >= 0 );
Angelscript Code
class Npc
{
int callbackid;
Npc()
{
// pass object pointer to engine with function name
callbackid = EM.RegisterSomeCallback(@this, "CallBackFunction");
}
void CallBackFunction()
{
print("Success!");
}
~Npc()
{
EM.UnregisterCallback(callbackid);
}
}
passing @this as a pointer is not possible as i figured. or am i doing it wrong?
also is ?&in correct way to register void* parameter?
thank you.