00001 /* 00002 SDL - Simple DirectMedia Layer 00003 Copyright (C) 1997-2009 Sam Lantinga 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library; if not, write to the Free Software 00017 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00018 00019 Sam Lantinga 00020 slouken@libsdl.org 00021 */ 00022 00023 #ifndef _SDL_timer_h 00024 #define _SDL_timer_h 00025 00030 #include "SDL_stdinc.h" 00031 #include "SDL_error.h" 00032 00033 #include "begin_code.h" 00034 /* Set up for C function definitions, even when using C++ */ 00035 #ifdef __cplusplus 00036 extern "C" { 00037 #endif 00038 00040 #define SDL_TIMESLICE 10 00041 00043 #define TIMER_RESOLUTION 10 00049 extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); 00050 00052 extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); 00053 00055 typedef Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval); 00056 00086 extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback); 00087 00093 00101 typedef Uint32 (SDLCALL *SDL_NewTimerCallback)(Uint32 interval, void *param); 00102 00104 typedef struct _SDL_TimerID *SDL_TimerID; 00105 00109 extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param); 00110 00115 extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t); 00116 00119 /* Ends C function definitions when using C++ */ 00120 #ifdef __cplusplus 00121 } 00122 #endif 00123 #include "close_code.h" 00124 00125 #endif /* _SDL_timer_h */