// function to be called
lua_getglobal(CLuaScript::L, l_pcFunctionName);
void *test = (void *)&(a_callback.report);
//pushing collision report onto the stack
lua_pushlightuserdata(CLuaScript::L, &test);
// do the call (0 arguments, 0 result)
lua_pcall(CLuaScript::L, 1, 0, 0);
At the script, theres a function with the specified name and it is called. But I can't get the report back. Then I tried casting IN THE SCRIPT to the correct type:
tolua.cast(variable, "Report");
And everything works. I don't want to cast inside the script. How can I make the callback specifying the type of the argument?
Thanks very much.
Callback problem (newbie question!)
Hi!
Our team is developing a game engine and we will use callbacks to let script writers deal with collisions and other stuff detected by the engine.
So I write a test function which at some point goes like this:
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement