openTRI 0.1
triTimer.h
1/*
2 * triTimer.h: Header for timers
3 * This file is part of the "tri Engine".
4 *
5 * Copyright (C) 2007 tri
6 * Copyright (C) 2007 InsertWittyName <tias_dp@hotmail.com>
7 *
8 * $Id: $
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24
25#ifndef __TRITIMER_H__
26#define __TRITIMER_H__
27
28#include "triTypes.h"
29
37typedef struct
38{
39 triFloat deltaTime;
40 triU64 timeNow;
41 triU64 timeLastAsk;
42 triU64 totalTime;
44} triTimer;
45
52
60triVoid triTimerUpdate(triTimer *timer);
61
70
79
85triVoid triTimerFree(triTimer *timer);
86
89#endif // __TRITIMER_H__
triTimer * triTimerCreate()
Create a timer.
triFloat triTimerGetDeltaTime(triTimer *timer)
Get the delta time of a timer.
triVoid triTimerFree(triTimer *timer)
Free a timer.
triVoid triTimerUpdate(triTimer *timer)
Update a timer.
triFloat triTimerPeekDeltaTime(triTimer *timer)
Get the delta time of a timer without changing its status.
A timer struct.
Definition: triTimer.h:38
triU64 totalTime
Time passed since creation.
Definition: triTimer.h:42
triFloat deltaTime
The delta time.
Definition: triTimer.h:39
triUInt tickResolution
Tick resolution.
Definition: triTimer.h:43
triU64 timeNow
Current time.
Definition: triTimer.h:40
triU64 timeLastAsk
Time of last update.
Definition: triTimer.h:41