|
NAMEAG_Time —
agar time interface
SYNOPSIS#include <agar/core.h> DESCRIPTIONThese functions provide a low-level interface to monotonically increasing time sources. Different time backends may be implemented (see INTERNAL API below). Agar provides the following backends:
INTERFACEUint32AG_GetTicks (void);
The The The BACKEND INTERFACEThe argument toAG_SetTimeOps () should point to the
following structure:
typedef struct ag_time_ops { const char *name; void (*Init)(void); void (*Destroy)(void); Uint32 (*GetTicks)(void); void (*Delay)(Uint32); } AG_TimeOps;
The EXAMPLESThe following code fragment selects the rendering-aware time backend, agTimeOps_renderer, if it is available:#include <agar/config/have_clock_gettime.h> #include <agar/config/have_pthreads.h> #if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_PTHREADS) AG_SetTimeOps(&agTimeOps_renderer); #endif SEE ALSOAG_Intro(3), AG_Timer(3)HISTORYTheAG_Time interface first appeared in Agar 1.3.4
Visit the GSP FreeBSD Man Page Interface. |