include/SDL_timer.h
branchSDL-1.2
changeset 4217 4c4113c2162c
parent 4159 a1b03ba2fcd0
child 6137 4720145f848b
     1.1 --- a/include/SDL_timer.h	Mon Sep 21 09:27:08 2009 +0000
     1.2 +++ b/include/SDL_timer.h	Mon Sep 21 09:38:10 2009 +0000
     1.3 @@ -23,7 +23,9 @@
     1.4  #ifndef _SDL_timer_h
     1.5  #define _SDL_timer_h
     1.6  
     1.7 -/* Header for the SDL time management routines */
     1.8 +/** @file SDL_timer.h
     1.9 + *  Header for the SDL time management routines
    1.10 + */
    1.11  
    1.12  #include "SDL_stdinc.h"
    1.13  #include "SDL_error.h"
    1.14 @@ -34,24 +36,26 @@
    1.15  extern "C" {
    1.16  #endif
    1.17  
    1.18 -/* This is the OS scheduler timeslice, in milliseconds */
    1.19 +/** This is the OS scheduler timeslice, in milliseconds */
    1.20  #define SDL_TIMESLICE		10
    1.21  
    1.22 -/* This is the maximum resolution of the SDL timer on all platforms */
    1.23 -#define TIMER_RESOLUTION	10	/* Experimentally determined */
    1.24 +/** This is the maximum resolution of the SDL timer on all platforms */
    1.25 +#define TIMER_RESOLUTION	10	/**< Experimentally determined */
    1.26  
    1.27 -/* Get the number of milliseconds since the SDL library initialization.
    1.28 +/**
    1.29 + * Get the number of milliseconds since the SDL library initialization.
    1.30   * Note that this value wraps if the program runs for more than ~49 days.
    1.31   */ 
    1.32  extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
    1.33  
    1.34 -/* Wait a specified number of milliseconds before returning */
    1.35 +/** Wait a specified number of milliseconds before returning */
    1.36  extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
    1.37  
    1.38 -/* Function prototype for the timer callback function */
    1.39 +/** Function prototype for the timer callback function */
    1.40  typedef Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval);
    1.41  
    1.42 -/* Set a callback to run after the specified number of milliseconds has
    1.43 +/**
    1.44 + * Set a callback to run after the specified number of milliseconds has
    1.45   * elapsed. The callback function is passed the current timer interval
    1.46   * and returns the next timer interval.  If the returned value is the 
    1.47   * same as the one passed in, the periodic alarm continues, otherwise a
    1.48 @@ -68,7 +72,7 @@
    1.49   * later on an unloaded system.  If you wanted to set a flag signaling
    1.50   * a frame update at 30 frames per second (every 33 ms), you might set a 
    1.51   * timer for 30 ms:
    1.52 - *   SDL_SetTimer((33/10)*10, flag_update);
    1.53 + *   @code SDL_SetTimer((33/10)*10, flag_update); @endcode
    1.54   *
    1.55   * If you use this function, you need to pass SDL_INIT_TIMER to SDL_Init().
    1.56   *
    1.57 @@ -81,11 +85,14 @@
    1.58   */
    1.59  extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback);
    1.60  
    1.61 -/* New timer API, supports multiple timers
    1.62 +/** @name New timer API
    1.63 + * New timer API, supports multiple timers
    1.64   * Written by Stephane Peter <megastep@lokigames.com>
    1.65   */
    1.66 +/*@{*/
    1.67  
    1.68 -/* Function prototype for the new timer callback function.
    1.69 +/**
    1.70 + * Function prototype for the new timer callback function.
    1.71   * The callback function is passed the current timer interval and returns
    1.72   * the next timer interval.  If the returned value is the same as the one
    1.73   * passed in, the periodic alarm continues, otherwise a new alarm is
    1.74 @@ -93,19 +100,22 @@
    1.75   */
    1.76  typedef Uint32 (SDLCALL *SDL_NewTimerCallback)(Uint32 interval, void *param);
    1.77  
    1.78 -/* Definition of the timer ID type */
    1.79 +/** Definition of the timer ID type */
    1.80  typedef struct _SDL_TimerID *SDL_TimerID;
    1.81  
    1.82 -/* Add a new timer to the pool of timers already running.
    1.83 -   Returns a timer ID, or NULL when an error occurs.
    1.84 +/** Add a new timer to the pool of timers already running.
    1.85 + *  Returns a timer ID, or NULL when an error occurs.
    1.86   */
    1.87  extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param);
    1.88  
    1.89 -/* Remove one of the multiple timers knowing its ID.
    1.90 +/**
    1.91 + * Remove one of the multiple timers knowing its ID.
    1.92   * Returns a boolean value indicating success.
    1.93   */
    1.94  extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t);
    1.95  
    1.96 +/*@}*/
    1.97 +
    1.98  /* Ends C function definitions when using C++ */
    1.99  #ifdef __cplusplus
   1.100  }