[SDL] SDL Timers
merlecorey at crosswinds.net
merlecorey at crosswinds.net
Sun Oct 1 10:20:57 PDT 2000
>I wanted a timer that expires after the first interval. Therefore I
used
>SDL_SetTimer(msecs, my_timer_callback).
>When I call SDL_SetTimer(0, NULL) in the timercallback, I alway got a
segfault.
>Accidentally I returned 0 in the timercallback function and now it
works. But
>I don't think that this is the default behaviour.
>
>If this is not a bug, it should be documented. And how do I implement
this
>with SDL_AddTimer. The return 0 trick doesn't work (so I think this is
a bug).
>And calling SDL_RemoveTimer even doesn't work in the callback.
I think if your SDL_AddTimer( ) callback returns a negative value,
the timer stops. (Hope it wasn't just a bug in my code! :) )
M.C.
More information about the SDL
mailing list