#include <frametimer.h>
Collaboration diagram for FrameTimer:
Public Types | |
typedef BasicObject::Callback | Callback |
Public Member Functions | |
DECLSPEC | FrameTimer () |
DECLSPEC bool | setInterval (CbInfo *id, Uint32 iv) |
DECLSPEC CbInfo * | addCallback (Callback c, BasicObject *d, Uint32 iv) |
DECLSPEC void | removeCallback (CbInfo *pCb) |
Static Public Member Functions | |
static DECLSPEC FrameTimer * | getThe () |
Static Public Attributes | |
static FrameTimer * | the |
Friends | |
class | UiManager |
Classes | |
struct | CbInfo |
This class can only be used in one variable at a time. It is recommended not to initialize it directly, because it will automatically be constructed with UiManager.
This class supports timer events that occur at most once per frame. After this class was initialized once, you can use it by accessing the static member function getThe().
This type is used for functions, that are called by the timer
FrameTimer::FrameTimer | ( | ) |
Constructor
You never need it, if you use UiManager
bool FrameTimer::setInterval | ( | CbInfo * | id, | |
Uint32 | iv | |||
) |
Changes the interval of an initialized timer
id | a pointer to the initialized structure that should be modified | |
iv | the time in msecs to wait between two timer-events, the next event will be called iv msecs from now on. |
FrameTimer::CbInfo * FrameTimer::addCallback | ( | Callback | c, | |
BasicObject * | d, | |||
Uint32 | iv | |||
) |
Initializes a new timer
c | the function to call, when the time elapsed | |
d | the value of the second param in the callback | |
iv | the interval in msecs between two timer events, the next event occurs iv msecs from now on. |
void FrameTimer::removeCallback | ( | CbInfo * | pCb | ) |
Cleans an initialized timer.
pCb | pointer to the timer's data, must be the result of addCallback() |
FrameTimer * FrameTimer::getThe | ( | ) | [static] |
FrameTimer * FrameTimer::the [static] |