DOSBox-X
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Classes | Static Public Member Functions | Static Protected Attributes
GUI::Timer Class Reference

Timing service. Time is measured in ticks. A tick is about 10 msec. More...

#include <gui_tk.h>

List of all members.

Classes

struct  ltuint
 Compare two integers for 'less-than'. More...

Static Public Member Functions

static void check (Ticks ticks)
 Advance time and check for expired timers.
static void check_to (Ticks ticks)
static void add (Timer_Callback *cb, const Ticks ticks)
 Add a timed callback. ticks is a value relative to now().
static void remove (const Timer_Callback *const timer)
static Ticks now ()
 Return current time (ticks since application start)
static Ticks next ()
 Return number of ticks until next scheduled timer or 0 if no timers.

Static Protected Attributes

static Ticks ticks = 0
 Number of ticks since application start.
static std::multimap< Ticks,
Timer_Callback *, ltuint
timers
 Active timers.

Detailed Description

Timing service. Time is measured in ticks. A tick is about 10 msec.

Note that this is not suitable as a high-accuracy timing service. Timer events can be off by many ticks, and a tick may be slightly more or slightly less than 10 msec. Because of that, Timers are only intended for simple animation effects, input timeouts and similar things.

Definition at line 928 of file gui_tk.h.


Member Function Documentation

static void GUI::Timer::add ( Timer_Callback cb,
const Ticks  ticks 
) [inline, static]

Add a timed callback. ticks is a value relative to now().

cb is not copied.

Definition at line 948 of file gui_tk.h.

References ticks, and timers.

Referenced by check(), and GUI::Input::Input().


The documentation for this class was generated from the following files: