For some reason, I keep getting this error when my IdleTimer is inside my Application class:
function call ‘[Aspire].NewEventLoopTimerUPP(void)’ does not match NewEventLoopTimerUPP(pascal void(*)(OpaqueEventLoopTimerRef , void))’
Now basically it’s telling me that the IdleTimer I’m supplying to NewEventLoopTimerUPP is wrong… but I see nothing wrong with it. It is declared in my class Aspire(the application class) as:
class Aspire
{
public:
…
pascal void GameIdleTimer(EventLoopTimerRef inTimer, void* userData);
…
};
It is used in the function Aspire::Setup like this:
EventLoopTimerUPP sTimerUPP = NewEventLoopTimerUPP (GameIdleTimer);
Since my IdleTimer contains a member function : DoUpdate(), will I need to make DoUpdate static as well? Or how would I write my IdleTimer then, since userData->DoUpdate(); doesn’t work
If you want the timer to call an instance method, you can do something like this, passing the address of an object of type Foo as the userData parameter to InstallEventLoopTimer.
If you want it to call a static function, that’s fine too.