orx 1.16
Portable Game Engine
Loading...
Searching...
No Matches
orxClock.h
Go to the documentation of this file.
1/* Orx - Portable Game Engine
2 *
3 * Copyright (c) 2008- Orx-Project
4 *
5 * This software is provided 'as-is', without any express or implied
6 * warranty. In no event will the authors be held liable for any damages
7 * arising from the use of this software.
8 *
9 * Permission is granted to anyone to use this software for any purpose,
10 * including commercial applications, and to alter it and redistribute it
11 * freely, subject to the following restrictions:
12 *
13 * 1. The origin of this software must not be misrepresented; you must not
14 * claim that you wrote the original software. If you use this software
15 * in a product, an acknowledgment in the product documentation would be
16 * appreciated but is not required.
17 *
18 * 2. Altered source versions must be plainly marked as such, and must not be
19 * misrepresented as being the original software.
20 *
21 * 3. This notice may not be removed or altered from any source
22 * distribution.
23 */
24
33
41
42#ifndef _orxCLOCK_H_
43#define _orxCLOCK_H_
44
45
46#include "orxInclude.h"
47#include "core/orxSystem.h"
48#include "utils/orxString.h"
49
50
51#define orxCLOCK_KU32_CLOCK_BANK_SIZE 16
52#define orxCLOCK_KU32_TIMER_BANK_SIZE 32
53
54#define orxCLOCK_KU32_FUNCTION_BANK_SIZE 16
55
56#define orxCLOCK_KZ_CONFIG_FREQUENCY "Frequency"
57#define orxCLOCK_KZ_CONFIG_MODIFIER_LIST "ModifierList"
58
59#define orxCLOCK_KZ_CORE "orx:clock:core"
60
61
76
77
95
96
99typedef struct __orxCLOCK_INFO_t
100{
101 orxFLOAT fTickSize;
102 orxFLOAT fDT;
103 orxFLOAT fTime;
105
107
108
123
124
126typedef struct __orxCLOCK_t orxCLOCK;
127
129typedef void (orxFASTCALL *orxCLOCK_FUNCTION)(const orxCLOCK_INFO *_pstClockInfo, void *_pContext);
130
131
134extern orxDLLAPI void orxFASTCALL orxClock_Setup();
135
139extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_Init();
140
143extern orxDLLAPI void orxFASTCALL orxClock_Exit();
144
145
151extern orxDLLAPI orxFLOAT orxFASTCALL orxClock_ComputeDT(const orxCLOCK *_pstClock, orxFLOAT _fDT);
152
157
162extern orxDLLAPI orxCLOCK *orxFASTCALL orxClock_Create(orxFLOAT _fTickSize);
163
168extern orxDLLAPI orxCLOCK *orxFASTCALL orxClock_CreateFromConfig(const orxSTRING _zConfigID);
169
174extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_Delete(orxCLOCK *_pstClock);
175
179extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_Resync(orxCLOCK *_pstClock);
180
185
190extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_Restart(orxCLOCK *_pstClock);
191
196extern orxDLLAPI void orxFASTCALL orxClock_Pause(orxCLOCK *_pstClock, orxBOOL _bPause);
197
202extern orxDLLAPI orxBOOL orxFASTCALL orxClock_IsPaused(const orxCLOCK *_pstClock);
203
208extern orxDLLAPI const orxCLOCK_INFO *orxFASTCALL orxClock_GetInfo(const orxCLOCK *_pstClock);
209
214extern orxDLLAPI orxCLOCK *orxFASTCALL orxClock_GetFromInfo(const orxCLOCK_INFO *_pstClockInfo);
215
216
223extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_SetModifier(orxCLOCK *_pstClock, orxCLOCK_MODIFIER _eModifier, orxFLOAT _fValue);
224
230extern orxDLLAPI orxFLOAT orxFASTCALL orxClock_GetModifier(orxCLOCK *_pstClock, orxCLOCK_MODIFIER _eModifier);
231
237extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_SetTickSize(orxCLOCK *_pstClock, orxFLOAT _fTickSize);
238
239
248extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_Register(orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback, void *_pContext, orxMODULE_ID _eModuleID, orxCLOCK_PRIORITY _ePriority);
249
255extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_Unregister(orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback);
256
262extern orxDLLAPI void *orxFASTCALL orxClock_GetContext(const orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback);
263
270extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_SetContext(orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback, void *_pContext);
271
272
277extern orxDLLAPI orxCLOCK *orxFASTCALL orxClock_Get(const orxSTRING _zName);
278
283extern orxDLLAPI const orxSTRING orxFASTCALL orxClock_GetName(const orxCLOCK *_pstClock);
284
285
294extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_AddTimer(orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback, orxFLOAT _fDelay, orxS32 _s32Repetition, void *_pContext);
295
303extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_RemoveTimer(orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback, orxFLOAT _fDelay, void *_pContext);
304
312extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_AddGlobalTimer(const orxCLOCK_FUNCTION _pfnCallback, orxFLOAT _fDelay, orxS32 _s32Repetition, void *_pContext);
313
320extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_RemoveGlobalTimer(const orxCLOCK_FUNCTION _pfnCallback, orxFLOAT _fDelay, void *_pContext);
321
322
323#endif /* _orxCLOCK_H_ */
324
orxDLLAPI orxSTATUS orxFASTCALL orxClock_Register(orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback, void *_pContext, orxMODULE_ID _eModuleID, orxCLOCK_PRIORITY _ePriority)
orxDLLAPI orxFLOAT orxFASTCALL orxClock_ComputeDT(const orxCLOCK *_pstClock, orxFLOAT _fDT)
orxDLLAPI orxFLOAT orxFASTCALL orxClock_GetModifier(orxCLOCK *_pstClock, orxCLOCK_MODIFIER _eModifier)
orxDLLAPI void *orxFASTCALL orxClock_GetContext(const orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_AddGlobalTimer(const orxCLOCK_FUNCTION _pfnCallback, orxFLOAT _fDelay, orxS32 _s32Repetition, void *_pContext)
orxDLLAPI void orxFASTCALL orxClock_Pause(orxCLOCK *_pstClock, orxBOOL _bPause)
orxDLLAPI orxCLOCK *orxFASTCALL orxClock_Create(orxFLOAT _fTickSize)
void(orxFASTCALL * orxCLOCK_FUNCTION)(const orxCLOCK_INFO *_pstClockInfo, void *_pContext)
Definition orxClock.h:129
orxDLLAPI const orxSTRING orxFASTCALL orxClock_GetName(const orxCLOCK *_pstClock)
orxDLLAPI orxCLOCK *orxFASTCALL orxClock_GetFromInfo(const orxCLOCK_INFO *_pstClockInfo)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_SetContext(orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback, void *_pContext)
orxCLOCK_MODIFIER
Definition orxClock.h:65
orxCLOCK_EVENT
Definition orxClock.h:112
orxDLLAPI orxSTATUS orxFASTCALL orxClock_Resync(orxCLOCK *_pstClock)
orxDLLAPI orxCLOCK *orxFASTCALL orxClock_Get(const orxSTRING _zName)
orxDLLAPI void orxFASTCALL orxClock_Exit()
orxDLLAPI orxSTATUS orxFASTCALL orxClock_RemoveGlobalTimer(const orxCLOCK_FUNCTION _pfnCallback, orxFLOAT _fDelay, void *_pContext)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_RemoveTimer(orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback, orxFLOAT _fDelay, void *_pContext)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_Delete(orxCLOCK *_pstClock)
orxDLLAPI orxCLOCK *orxFASTCALL orxClock_CreateFromConfig(const orxSTRING _zConfigID)
orxDLLAPI const orxCLOCK_INFO *orxFASTCALL orxClock_GetInfo(const orxCLOCK *_pstClock)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_SetTickSize(orxCLOCK *_pstClock, orxFLOAT _fTickSize)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_Restart(orxCLOCK *_pstClock)
orxDLLAPI orxBOOL orxFASTCALL orxClock_IsPaused(const orxCLOCK *_pstClock)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_SetModifier(orxCLOCK *_pstClock, orxCLOCK_MODIFIER _eModifier, orxFLOAT _fValue)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_Update()
orxDLLAPI orxSTATUS orxFASTCALL orxClock_AddTimer(orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback, orxFLOAT _fDelay, orxS32 _s32Repetition, void *_pContext)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_Init()
orxCLOCK_PRIORITY
Definition orxClock.h:81
orxDLLAPI orxSTATUS orxFASTCALL orxClock_Unregister(orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback)
orxDLLAPI void orxFASTCALL orxClock_Setup()
orxDLLAPI orxSTATUS orxFASTCALL orxClock_ResyncAll()
@ orxCLOCK_MODIFIER_MAXED
Definition orxClock.h:68
@ orxCLOCK_MODIFIER_MULTIPLY
Definition orxClock.h:67
@ orxCLOCK_MODIFIER_NUMBER
Definition orxClock.h:71
@ orxCLOCK_MODIFIER_FIXED
Definition orxClock.h:66
@ orxCLOCK_MODIFIER_NONE
Definition orxClock.h:73
@ orxCLOCK_MODIFIER_AVERAGE
Definition orxClock.h:69
@ orxCLOCK_EVENT_PAUSE
Definition orxClock.h:115
@ orxCLOCK_EVENT_RESTART
Definition orxClock.h:113
@ orxCLOCK_EVENT_NUMBER
Definition orxClock.h:118
@ orxCLOCK_EVENT_RESYNC
Definition orxClock.h:114
@ orxCLOCK_EVENT_NONE
Definition orxClock.h:120
@ orxCLOCK_EVENT_UNPAUSE
Definition orxClock.h:116
@ orxCLOCK_PRIORITY_NUMBER
Definition orxClock.h:90
@ orxCLOCK_PRIORITY_LOWEST
Definition orxClock.h:82
@ orxCLOCK_PRIORITY_HIGHEST
Definition orxClock.h:88
@ orxCLOCK_PRIORITY_LOWER
Definition orxClock.h:83
@ orxCLOCK_PRIORITY_LOW
Definition orxClock.h:84
@ orxCLOCK_PRIORITY_HIGH
Definition orxClock.h:86
@ orxCLOCK_PRIORITY_NORMAL
Definition orxClock.h:85
@ orxCLOCK_PRIORITY_HIGHER
Definition orxClock.h:87
@ orxCLOCK_PRIORITY_NONE
Definition orxClock.h:92
#define orxDLLAPI
Definition orxDecl.h:381
orxMODULE_ID
Definition orxModule.h:54
#define orxCLOCK(STRUCTURE)
orxSTATUS
Definition orxType.h:270
orxFLOAT afModifierList[orxCLOCK_MODIFIER_NUMBER]
Definition orxClock.h:104
orxFLOAT fTime
Definition orxClock.h:103
orxFLOAT fTickSize
Definition orxClock.h:101
orxFLOAT fDT
Definition orxClock.h:102

Generated for orx by doxygen 1.8.11