SDL_GetTicks function

SDL_GetTicks -- Gets the number of milliseconds since SDL library initialization.

Syntax

Uint32 SDL_GetTicks(void)

Description

Returns the number of milliseconds since SDL library initialization. This value wraps around if the program runs for more than 49.7 days.

Parameter

nothing

Return value

An unsigned 32 bit integer number

See also

SDL_Delay

Example

This function can be used to build a double click handling routine. In fact, in the SDL event subsystem, there's currently no such mouse event. One solution consists of calculating the interval between two mouse clicks by saving the values returned by SDL_GetTicks. Then if the difference between two values returned by SDL_GetTicks is inside a predefined threshold, the application can fire a software double click event.

Requirements

Header

SDL.h

Version

1.2.13

Shared object

libSDL.so

DLL

SDL.dll


CategorySDLTime

SDL_GetTicks (last edited 2008-12-10 09:29:35 by mickael)