| | |
| | | /* |
| | | Simple DirectMedia Layer |
| | | Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org> |
| | | Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org> |
| | | |
| | | This software is provided 'as-is', without any express or implied |
| | | warranty. In no event will the authors be held liable for any damages |
| | |
| | | static struct timeval start; |
| | | static SDL_bool ticks_started = SDL_FALSE; |
| | | |
| | | void SDL_InitTicks(void) |
| | | void |
| | | SDL_TicksInit(void) |
| | | { |
| | | if (ticks_started) { |
| | | return; |
| | |
| | | gettimeofday(&start, NULL); |
| | | } |
| | | |
| | | void |
| | | SDL_TicksQuit(void) |
| | | { |
| | | ticks_started = SDL_FALSE; |
| | | } |
| | | |
| | | Uint32 SDL_GetTicks(void) |
| | | { |
| | | if (!ticks_started) { |
| | | SDL_InitTicks(); |
| | | SDL_TicksInit(); |
| | | } |
| | | |
| | | struct timeval now; |