logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_NSTimerCallback - Function prototype for the nanosecond timer callback function.

Availability

       This datatype is available since SDL 3.2.0.

Description

       The  callback  function  is  passed  the  current  timer interval and returns the next timer interval, in
       nanoseconds. If the returned value is the same as the  one  passed  in,  the  periodic  alarm  continues,
       otherwise a new alarm is scheduled. If the callback returns 0, the periodic alarm is canceled and will be
       removed.

Function Parameters

userdata
              an arbitrary pointer provided by the app through SDL_AddTimer, for its own use.

       timerID
              the current timer being processed.

       interval
              the current callback time interval.

Name

       SDL_NSTimerCallback - Function prototype for the nanosecond timer callback function.

Return Value

       Returns the new callback time interval, or 0 to disable further runs of the callback.

See Also

SDL_AddTimerNS(3)

Simple Directmedia Layer                           SDL 3.2.20                         SDL_NSTimerCallback(3type)

Synopsis

#include<SDL3/SDL_timer.h>typedefUint64(SDLCALL*SDL_NSTimerCallback)(void*userdata,SDL_TimerIDtimerID,Uint64interval);

Thread Safety

       SDL  may  call  this  callback  at  any time from a background thread; the application is responsible for
       locking resources the callback touches that need to be protected.

See Also