[SDL] Timer callback function return value

Luis Anton anton_canalis at hotmail.com
Mon Aug 20 05:48:24 PDT 2007


Hello,

I'm using sdl_addTimer to create a user event, and it works. However, I do not
want my callback function to be called again, as I only need this event once.
Please do not ask why, it's just that way. I could remove the timer when I get
the event in the event loop, but the callback function could have been called
again. 

However, addTimer callback functions return a value, 'interval', which means
when the timer will call this function again. If the callback function returns
zero or a negative value, it is not called again (as expected. It was that or a
nice error). What happens with the timer if I do that? Should I still kill the
timer when I get the user event?

Thank you!



More information about the SDL mailing list