orx  stable
Portable Game Engine
orxClock.h
Go to the documentation of this file.
1 /* Orx - Portable Game Engine
2  *
3  * Copyright (c) 2008-2017 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 
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
54 #define orxCLOCK_KU32_FUNCTION_BANK_SIZE 16
59 typedef enum __orxCLOCK_TYPE_t
60 {
63 
65 
67 
68  orxCLOCK_TYPE_NONE = orxENUM_NONE
69 
71 
72 
75 typedef enum __orxCLOCK_MOD_TYPE_t
76 {
82 
83  orxCLOCK_MOD_TYPE_NONE = orxENUM_NONE,
84 
86 
87 
90 typedef enum __orxCLOCK_PRIORITY_t
91 {
99 
101 
102  orxCLOCK_PRIORITY_NONE = orxENUM_NONE,
103 
105 
106 
109 typedef struct __orxCLOCK_INFO_t
110 {
112  orxFLOAT fTickSize;
114  orxFLOAT fModValue;
115  orxFLOAT fDT;
116  orxFLOAT fTime;
118 } orxCLOCK_INFO;
119 
120 
123 typedef enum __orxCLOCK_EVENT_t
124 {
131 
132  orxCLOCK_EVENT_NONE = orxENUM_NONE
133 
135 
136 
138 typedef struct __orxCLOCK_t orxCLOCK;
139 
141 typedef void (orxFASTCALL *orxCLOCK_FUNCTION)(const orxCLOCK_INFO *_pstClockInfo, void *_pContext);
142 
143 
146 extern orxDLLAPI void orxFASTCALL orxClock_Setup();
147 
151 extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_Init();
152 
155 extern orxDLLAPI void orxFASTCALL orxClock_Exit();
156 
157 
161 extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_Update();
162 
168 extern orxDLLAPI orxCLOCK *orxFASTCALL orxClock_Create(orxFLOAT _fTickSize, orxCLOCK_TYPE _eType);
169 
174 extern orxDLLAPI orxCLOCK *orxFASTCALL orxClock_CreateFromConfig(const orxSTRING _zConfigID);
175 
180 extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_Delete(orxCLOCK *_pstClock);
181 
185 extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_Resync(orxCLOCK *_pstClock);
186 
190 extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_ResyncAll();
191 
196 extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_Restart(orxCLOCK *_pstClock);
197 
202 extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_Pause(orxCLOCK *_pstClock);
203 
208 extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_Unpause(orxCLOCK *_pstClock);
209 
214 extern orxDLLAPI orxBOOL orxFASTCALL orxClock_IsPaused(const orxCLOCK *_pstClock);
215 
220 extern orxDLLAPI const orxCLOCK_INFO *orxFASTCALL orxClock_GetInfo(const orxCLOCK *_pstClock);
221 
226 extern orxDLLAPI orxCLOCK *orxFASTCALL orxClock_GetFromInfo(const orxCLOCK_INFO *_pstClockInfo);
227 
228 
235 extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_SetModifier(orxCLOCK *_pstClock, orxCLOCK_MOD_TYPE _eModType, orxFLOAT _fModValue);
236 
242 extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_SetTickSize(orxCLOCK *_pstClock, orxFLOAT _fTickSize);
243 
244 
253 extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_Register(orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback, void *_pContext, orxMODULE_ID _eModuleID, orxCLOCK_PRIORITY _ePriority);
254 
260 extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_Unregister(orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback);
261 
267 extern orxDLLAPI void *orxFASTCALL orxClock_GetContext(const orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback);
268 
275 extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_SetContext(orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback, void *_pContext);
276 
277 
283 extern orxDLLAPI orxCLOCK *orxFASTCALL orxClock_FindFirst(orxFLOAT _fTickSize, orxCLOCK_TYPE _eType);
284 
289 extern orxDLLAPI orxCLOCK *orxFASTCALL orxClock_FindNext(const orxCLOCK *_pstClock);
290 
295 extern orxDLLAPI orxCLOCK *orxFASTCALL orxClock_GetNext(const orxCLOCK *_pstClock);
296 
301 extern orxDLLAPI orxCLOCK *orxFASTCALL orxClock_Get(const orxSTRING _zName);
302 
307 extern orxDLLAPI const orxSTRING orxFASTCALL orxClock_GetName(const orxCLOCK *_pstClock);
308 
309 
318 extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_AddTimer(orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback, orxFLOAT _fDelay, orxS32 _s32Repetition, void *_pContext);
319 
327 extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_RemoveTimer(orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback, orxFLOAT _fDelay, void *_pContext);
328 
336 extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_AddGlobalTimer(const orxCLOCK_FUNCTION _pfnCallback, orxFLOAT _fDelay, orxS32 _s32Repetition, void *_pContext);
337 
344 extern orxDLLAPI orxSTATUS orxFASTCALL orxClock_RemoveGlobalTimer(const orxCLOCK_FUNCTION _pfnCallback, orxFLOAT _fDelay, void *_pContext);
345 
346 
347 #endif /* _orxCLOCK_H_ */
348 
orxDLLAPI void orxFASTCALL orxClock_Exit()
orxFLOAT fTickSize
Definition: orxClock.h:112
orxCLOCK_PRIORITY
Definition: orxClock.h:90
orxDLLAPI orxCLOCK *orxFASTCALL orxClock_FindFirst(orxFLOAT _fTickSize, orxCLOCK_TYPE _eType)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_Delete(orxCLOCK *_pstClock)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_Update()
orxDLLAPI orxSTATUS orxFASTCALL orxClock_RemoveGlobalTimer(const orxCLOCK_FUNCTION _pfnCallback, orxFLOAT _fDelay, void *_pContext)
orxMODULE_ID
Definition: orxModule.h:53
struct __orxCLOCK_t orxCLOCK
Definition: orxClock.h:138
orxCLOCK_MOD_TYPE eModType
Definition: orxClock.h:113
orxDLLAPI orxCLOCK *orxFASTCALL orxClock_Get(const orxSTRING _zName)
orxDLLAPI const orxCLOCK_INFO *orxFASTCALL orxClock_GetInfo(const orxCLOCK *_pstClock)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_ResyncAll()
orxCLOCK_MOD_TYPE
Definition: orxClock.h:75
orxDLLAPI orxSTATUS orxFASTCALL orxClock_Resync(orxCLOCK *_pstClock)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_SetContext(orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback, void *_pContext)
void(orxFASTCALL * orxCLOCK_FUNCTION)(const orxCLOCK_INFO *_pstClockInfo, void *_pContext)
Definition: orxClock.h:141
orxDLLAPI orxSTATUS orxFASTCALL orxClock_Register(orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback, void *_pContext, orxMODULE_ID _eModuleID, orxCLOCK_PRIORITY _ePriority)
orxDLLAPI orxCLOCK *orxFASTCALL orxClock_GetNext(const orxCLOCK *_pstClock)
orxCLOCK_TYPE
Definition: orxClock.h:59
orxDLLAPI void orxFASTCALL orxClock_Setup()
orxDLLAPI const orxSTRING orxFASTCALL orxClock_GetName(const orxCLOCK *_pstClock)
orxSTATUS
Definition: orxType.h:243
orxDLLAPI orxSTATUS orxFASTCALL orxClock_SetModifier(orxCLOCK *_pstClock, orxCLOCK_MOD_TYPE _eModType, orxFLOAT _fModValue)
orxDLLAPI orxCLOCK *orxFASTCALL orxClock_FindNext(const orxCLOCK *_pstClock)
orxDLLAPI orxCLOCK *orxFASTCALL orxClock_Create(orxFLOAT _fTickSize, orxCLOCK_TYPE _eType)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_RemoveTimer(orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback, orxFLOAT _fDelay, void *_pContext)
typedef void(orxFASTCALL *orxMODULE_EXIT_FUNCTION)()
#define orxDLLAPI
Definition: orxDecl.h:387
orxCLOCK_TYPE eType
Definition: orxClock.h:111
orxDLLAPI orxSTATUS orxFASTCALL orxClock_AddTimer(orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback, orxFLOAT _fDelay, orxS32 _s32Repetition, void *_pContext)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_AddGlobalTimer(const orxCLOCK_FUNCTION _pfnCallback, orxFLOAT _fDelay, orxS32 _s32Repetition, void *_pContext)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_Pause(orxCLOCK *_pstClock)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_Unregister(orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_Restart(orxCLOCK *_pstClock)
orxFLOAT fDT
Definition: orxClock.h:115
orxDLLAPI orxCLOCK *orxFASTCALL orxClock_GetFromInfo(const orxCLOCK_INFO *_pstClockInfo)
orxDLLAPI orxBOOL orxFASTCALL orxClock_IsPaused(const orxCLOCK *_pstClock)
orxDLLAPI orxCLOCK *orxFASTCALL orxClock_CreateFromConfig(const orxSTRING _zConfigID)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_SetTickSize(orxCLOCK *_pstClock, orxFLOAT _fTickSize)
orxFLOAT fTime
Definition: orxClock.h:116
orxDLLAPI orxSTATUS orxFASTCALL orxClock_Unpause(orxCLOCK *_pstClock)
orxFLOAT fModValue
Definition: orxClock.h:114
orxDLLAPI orxSTATUS orxFASTCALL orxClock_Init()
orxCLOCK_EVENT
Definition: orxClock.h:123
orxDLLAPI void *orxFASTCALL orxClock_GetContext(const orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback)

Generated for orx by doxygen 1.5.6