Why I must pass @_ to the sub when it was implicit before in this example:
The callbacks are function references. They're not methods; they have no invocants. SDL will invoke those references and pass the parameters it wants to them. SDL doesn't know you're using methods. SDL doesn't know which objects you want to use.
Because you want to call methods on objects, you have to give SDL callbacks which are closures which then invoke methods on your objects.
Because you're using that layer of indirection, you have to pass the arguments to your methods directly.
In reply to Re^5: SDLx handlers and Moose
by chromatic
in thread SDLx handlers and Moose
by Ransom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |