orx 1.16
Portable Game Engine
Loading...
Searching...
No Matches
OrxClock

Data Structures

struct  orxCLOCK_INFO

Macros

#define orxCLOCK_KU32_CLOCK_BANK_SIZE   16
#define orxCLOCK_KU32_FUNCTION_BANK_SIZE   16
#define orxCLOCK_KU32_TIMER_BANK_SIZE   32
#define orxCLOCK_KZ_CONFIG_FREQUENCY   "Frequency"
#define orxCLOCK_KZ_CONFIG_MODIFIER_LIST   "ModifierList"
#define orxCLOCK_KZ_CORE   "orx:clock:core"

Typedefs

typedef struct __orxCLOCK_t orxCLOCK
typedef void(orxFASTCALL * orxCLOCK_FUNCTION) (const orxCLOCK_INFO *_pstClockInfo, void *_pContext)

Enumerations

enum  orxCLOCK_EVENT {
  orxCLOCK_EVENT_RESTART = 0 , orxCLOCK_EVENT_RESYNC , orxCLOCK_EVENT_PAUSE , orxCLOCK_EVENT_UNPAUSE ,
  orxCLOCK_EVENT_NUMBER , orxCLOCK_EVENT_NONE = orxENUM_NONE
}
enum  orxCLOCK_MODIFIER {
  orxCLOCK_MODIFIER_FIXED = 0 , orxCLOCK_MODIFIER_MULTIPLY , orxCLOCK_MODIFIER_MAXED , orxCLOCK_MODIFIER_AVERAGE ,
  orxCLOCK_MODIFIER_NUMBER , orxCLOCK_MODIFIER_NONE = orxENUM_NONE
}
enum  orxCLOCK_PRIORITY {
  orxCLOCK_PRIORITY_LOWEST = 0 , orxCLOCK_PRIORITY_LOWER , orxCLOCK_PRIORITY_LOW , orxCLOCK_PRIORITY_NORMAL ,
  orxCLOCK_PRIORITY_HIGH , orxCLOCK_PRIORITY_HIGHER , orxCLOCK_PRIORITY_HIGHEST , orxCLOCK_PRIORITY_NUMBER ,
  orxCLOCK_PRIORITY_NONE = orxENUM_NONE
}

Functions

orxDLLAPI orxSTATUS orxFASTCALL orxClock_AddGlobalTimer (const orxCLOCK_FUNCTION _pfnCallback, orxFLOAT _fDelay, orxS32 _s32Repetition, void *_pContext)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_AddTimer (orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback, orxFLOAT _fDelay, orxS32 _s32Repetition, void *_pContext)
orxDLLAPI orxFLOAT orxFASTCALL orxClock_ComputeDT (const orxCLOCK *_pstClock, orxFLOAT _fDT)
orxDLLAPI orxCLOCK *orxFASTCALL orxClock_Create (orxFLOAT _fTickSize)
orxDLLAPI orxCLOCK *orxFASTCALL orxClock_CreateFromConfig (const orxSTRING _zConfigID)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_Delete (orxCLOCK *_pstClock)
orxDLLAPI void orxFASTCALL orxClock_Exit ()
orxDLLAPI orxCLOCK *orxFASTCALL orxClock_Get (const orxSTRING _zName)
orxDLLAPI void *orxFASTCALL orxClock_GetContext (const orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback)
orxDLLAPI orxCLOCK *orxFASTCALL orxClock_GetFromInfo (const orxCLOCK_INFO *_pstClockInfo)
orxDLLAPI const orxCLOCK_INFO *orxFASTCALL orxClock_GetInfo (const orxCLOCK *_pstClock)
orxDLLAPI orxFLOAT orxFASTCALL orxClock_GetModifier (orxCLOCK *_pstClock, orxCLOCK_MODIFIER _eModifier)
orxDLLAPI const orxSTRING orxFASTCALL orxClock_GetName (const orxCLOCK *_pstClock)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_Init ()
orxDLLAPI orxBOOL orxFASTCALL orxClock_IsPaused (const orxCLOCK *_pstClock)
orxDLLAPI void orxFASTCALL orxClock_Pause (orxCLOCK *_pstClock, orxBOOL _bPause)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_Register (orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback, void *_pContext, orxMODULE_ID _eModuleID, orxCLOCK_PRIORITY _ePriority)
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_Restart (orxCLOCK *_pstClock)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_Resync (orxCLOCK *_pstClock)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_ResyncAll ()
orxDLLAPI orxSTATUS orxFASTCALL orxClock_SetContext (orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback, void *_pContext)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_SetModifier (orxCLOCK *_pstClock, orxCLOCK_MODIFIER _eModifier, orxFLOAT _fValue)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_SetTickSize (orxCLOCK *_pstClock, orxFLOAT _fTickSize)
orxDLLAPI void orxFASTCALL orxClock_Setup ()
orxDLLAPI orxSTATUS orxFASTCALL orxClock_Unregister (orxCLOCK *_pstClock, const orxCLOCK_FUNCTION _pfnCallback)
orxDLLAPI orxSTATUS orxFASTCALL orxClock_Update ()

Detailed Description

Clock module Module that handles clocks which is the low level kernel part of orx execution.

Macro Definition Documentation

◆ orxCLOCK_KU32_CLOCK_BANK_SIZE

#define orxCLOCK_KU32_CLOCK_BANK_SIZE   16

Clock bank size

Definition at line 51 of file orxClock.h.

◆ orxCLOCK_KU32_FUNCTION_BANK_SIZE

#define orxCLOCK_KU32_FUNCTION_BANK_SIZE   16

Function bank size

Definition at line 54 of file orxClock.h.

◆ orxCLOCK_KU32_TIMER_BANK_SIZE

#define orxCLOCK_KU32_TIMER_BANK_SIZE   32

Timer bank size

Definition at line 52 of file orxClock.h.

◆ orxCLOCK_KZ_CONFIG_FREQUENCY

#define orxCLOCK_KZ_CONFIG_FREQUENCY   "Frequency"

Definition at line 56 of file orxClock.h.

◆ orxCLOCK_KZ_CONFIG_MODIFIER_LIST

#define orxCLOCK_KZ_CONFIG_MODIFIER_LIST   "ModifierList"

Definition at line 57 of file orxClock.h.

◆ orxCLOCK_KZ_CORE

#define orxCLOCK_KZ_CORE   "orx:clock:core"

Definition at line 59 of file orxClock.h.

Typedef Documentation

◆ orxCLOCK

typedef struct __orxCLOCK_t orxCLOCK

Clock structure

Definition at line 126 of file orxClock.h.

◆ orxCLOCK_FUNCTION

typedef void(orxFASTCALL * orxCLOCK_FUNCTION) (const orxCLOCK_INFO *_pstClockInfo, void *_pContext)

Clock callback function type to use with clock bindings

Definition at line 129 of file orxClock.h.

Enumeration Type Documentation

◆ orxCLOCK_EVENT

Event enum

Enumerator
orxCLOCK_EVENT_RESTART 

Event sent when a clock restarts

orxCLOCK_EVENT_RESYNC 

Event sent when a clock resyncs

orxCLOCK_EVENT_PAUSE 

Event sent when a clock is paused

orxCLOCK_EVENT_UNPAUSE 

Event sent when a clock is unpaused

orxCLOCK_EVENT_NUMBER 
orxCLOCK_EVENT_NONE 

Definition at line 111 of file orxClock.h.

◆ orxCLOCK_MODIFIER

Clock modifier enum

Enumerator
orxCLOCK_MODIFIER_FIXED 

The given DT will be constant, set to this modifier value

orxCLOCK_MODIFIER_MULTIPLY 

The given DT will be multiplied by this modifier value

orxCLOCK_MODIFIER_MAXED 

The given DT will be maxed by this modifier value

orxCLOCK_MODIFIER_AVERAGE 

The given DT will be averaged over a number of past updates defined by this modifier value

orxCLOCK_MODIFIER_NUMBER 
orxCLOCK_MODIFIER_NONE 

Definition at line 64 of file orxClock.h.

◆ orxCLOCK_PRIORITY

Clock priority

Enumerator
orxCLOCK_PRIORITY_LOWEST 
orxCLOCK_PRIORITY_LOWER 
orxCLOCK_PRIORITY_LOW 
orxCLOCK_PRIORITY_NORMAL 
orxCLOCK_PRIORITY_HIGH 
orxCLOCK_PRIORITY_HIGHER 
orxCLOCK_PRIORITY_HIGHEST 
orxCLOCK_PRIORITY_NUMBER 
orxCLOCK_PRIORITY_NONE 

Definition at line 80 of file orxClock.h.

Function Documentation

◆ orxClock_AddGlobalTimer()

orxDLLAPI orxSTATUS orxFASTCALL orxClock_AddGlobalTimer ( const orxCLOCK_FUNCTION _pfnCallback,
orxFLOAT _fDelay,
orxS32 _s32Repetition,
void * _pContext )
extern

Adds a global timer function (ie. using the main core clock)

Parameters
[in]_pfnCallbackConcerned timer callback
[in]_fDelayTimer's delay between 2 calls, must be strictly positive
[in]_s32RepetitionNumber of times this timer should be called before removed, -1 for infinite
[in]_pContextContext that will be transmitted to the callback when called
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

◆ orxClock_AddTimer()

orxDLLAPI orxSTATUS orxFASTCALL orxClock_AddTimer ( orxCLOCK * _pstClock,
const orxCLOCK_FUNCTION _pfnCallback,
orxFLOAT _fDelay,
orxS32 _s32Repetition,
void * _pContext )
extern

Adds a timer function to a clock

Parameters
[in]_pstClockConcerned clock
[in]_pfnCallbackConcerned timer callback
[in]_fDelayTimer's delay between 2 calls, must be strictly positive
[in]_s32RepetitionNumber of times this timer should be called before removed, -1 for infinite
[in]_pContextContext that will be transmitted to the callback when called
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

◆ orxClock_ComputeDT()

orxDLLAPI orxFLOAT orxFASTCALL orxClock_ComputeDT ( const orxCLOCK * _pstClock,
orxFLOAT _fDT )
extern

Computes DT according to modifier

Parameters
[in]_pstClockConcerned clock
[in]_fDTReal DT
Returns
Modified DT

◆ orxClock_Create()

orxDLLAPI orxCLOCK *orxFASTCALL orxClock_Create ( orxFLOAT _fTickSize)
extern

Creates a clock

Parameters
[in]_fTickSizeTick size for the clock (in seconds)
Returns
orxCLOCK / orxNULL

◆ orxClock_CreateFromConfig()

orxDLLAPI orxCLOCK *orxFASTCALL orxClock_CreateFromConfig ( const orxSTRING _zConfigID)
extern

Creates a clock from config

Parameters
[in]_zConfigIDConfig ID @ return orxCLOCK / orxNULL

◆ orxClock_Delete()

orxDLLAPI orxSTATUS orxFASTCALL orxClock_Delete ( orxCLOCK * _pstClock)
extern

Deletes a clock

Parameters
[in]_pstClockConcerned clock
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

◆ orxClock_Exit()

orxDLLAPI void orxFASTCALL orxClock_Exit ( )
extern

Exits from the clock module

◆ orxClock_Get()

orxDLLAPI orxCLOCK *orxFASTCALL orxClock_Get ( const orxSTRING _zName)
extern

Gets clock given its name

Parameters
[in]_zNameClock name, orxCLOCK_KZ_CORE for core clock
Returns
orxCLOCK / orxNULL

◆ orxClock_GetContext()

orxDLLAPI void *orxFASTCALL orxClock_GetContext ( const orxCLOCK * _pstClock,
const orxCLOCK_FUNCTION _pfnCallback )
extern

Gets a callback function context

Parameters
[in]_pstClockConcerned clock
[in]_pfnCallbackConcerned callback
Returns
Registered context

◆ orxClock_GetFromInfo()

orxDLLAPI orxCLOCK *orxFASTCALL orxClock_GetFromInfo ( const orxCLOCK_INFO * _pstClockInfo)
extern

Gets clock from its info

Parameters
[in]_pstClockInfoConcerned clock info
Returns
orxCLOCK / orxNULL

◆ orxClock_GetInfo()

orxDLLAPI const orxCLOCK_INFO *orxFASTCALL orxClock_GetInfo ( const orxCLOCK * _pstClock)
extern

Gets clock info

Parameters
[in]_pstClockConcerned clock
Returns
orxCLOCK_INFO / orxNULL

◆ orxClock_GetModifier()

orxDLLAPI orxFLOAT orxFASTCALL orxClock_GetModifier ( orxCLOCK * _pstClock,
orxCLOCK_MODIFIER _eModifier )
extern

Gets a clock's modifier

Parameters
[in]_pstClockConcerned clock
[in]_eModifierConcerned modifier
Returns
Modifier value / orxFLOAT_0 if deactivated

◆ orxClock_GetName()

orxDLLAPI const orxSTRING orxFASTCALL orxClock_GetName ( const orxCLOCK * _pstClock)
extern

Gets clock config name

Parameters
[in]_pstClockConcerned clock
Returns
orxSTRING / orxSTRING_EMPTY

◆ orxClock_Init()

orxDLLAPI orxSTATUS orxFASTCALL orxClock_Init ( )
extern

Inits the clock module

Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

◆ orxClock_IsPaused()

orxDLLAPI orxBOOL orxFASTCALL orxClock_IsPaused ( const orxCLOCK * _pstClock)
extern

Is a clock paused?

Parameters
[in]_pstClockConcerned clock
Returns
orxTRUE if paused, orxFALSE otherwise

◆ orxClock_Pause()

orxDLLAPI void orxFASTCALL orxClock_Pause ( orxCLOCK * _pstClock,
orxBOOL _bPause )
extern

Pauses a clock

Parameters
[in]_pstClockConcerned clock
[in]_bPausePause / unpause

◆ orxClock_Register()

orxDLLAPI orxSTATUS orxFASTCALL orxClock_Register ( orxCLOCK * _pstClock,
const orxCLOCK_FUNCTION _pfnCallback,
void * _pContext,
orxMODULE_ID _eModuleID,
orxCLOCK_PRIORITY _ePriority )
extern

Registers a callback function to a clock

Parameters
[in]_pstClockConcerned clock
[in]_pfnCallbackCallback to register
[in]_pContextContext that will be transmitted to the callback when called
[in]_eModuleIDID of the module related to this callback
[in]_ePriorityPriority for the function
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

◆ orxClock_RemoveGlobalTimer()

orxDLLAPI orxSTATUS orxFASTCALL orxClock_RemoveGlobalTimer ( const orxCLOCK_FUNCTION _pfnCallback,
orxFLOAT _fDelay,
void * _pContext )
extern

Removes a global timer function (ie. from the main core clock)

Parameters
[in]_pfnCallbackConcerned timer callback to remove, orxNULL to remove all occurrences regardless of their callback
[in]_fDelayDelay between 2 calls of the timer to remove, -1.0f to remove all occurrences regardless of their respective delay
[in]_pContextContext of the timer to remove, orxNULL to remove all occurrences regardless of their context
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

◆ orxClock_RemoveTimer()

orxDLLAPI orxSTATUS orxFASTCALL orxClock_RemoveTimer ( orxCLOCK * _pstClock,
const orxCLOCK_FUNCTION _pfnCallback,
orxFLOAT _fDelay,
void * _pContext )
extern

Removes a timer function from a clock

Parameters
[in]_pstClockConcerned clock
[in]_pfnCallbackConcerned timer callback to remove, orxNULL to remove all occurrences regardless of their callback
[in]_fDelayDelay between 2 calls of the timer to remove, -1.0f to remove all occurrences regardless of their respective delay
[in]_pContextContext of the timer to remove, orxNULL to remove all occurrences regardless of their context
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

◆ orxClock_Restart()

orxDLLAPI orxSTATUS orxFASTCALL orxClock_Restart ( orxCLOCK * _pstClock)
extern

Restarts a clock

Parameters
[in]_pstClockConcerned clock
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

◆ orxClock_Resync()

orxDLLAPI orxSTATUS orxFASTCALL orxClock_Resync ( orxCLOCK * _pstClock)
extern

Resyncs a clock (accumulated DT => 0)

Parameters
[in]_pstClockConcerned clock

◆ orxClock_ResyncAll()

orxDLLAPI orxSTATUS orxFASTCALL orxClock_ResyncAll ( )
extern

Resyncs all clocks (accumulated DT => 0)

Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

◆ orxClock_SetContext()

orxDLLAPI orxSTATUS orxFASTCALL orxClock_SetContext ( orxCLOCK * _pstClock,
const orxCLOCK_FUNCTION _pfnCallback,
void * _pContext )
extern

Sets a callback function context

Parameters
[in]_pstClockConcerned clock
[in]_pfnCallbackConcerned callback
[in]_pContextContext that will be transmitted to the callback when called
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

◆ orxClock_SetModifier()

orxDLLAPI orxSTATUS orxFASTCALL orxClock_SetModifier ( orxCLOCK * _pstClock,
orxCLOCK_MODIFIER _eModifier,
orxFLOAT _fValue )
extern

Sets a clock's modifier

Parameters
[in]_pstClockConcerned clock
[in]_eModifierConcerned modifier
[in]_fValueModifier value, orxFLOAT_0 to deactivate the modifier
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

◆ orxClock_SetTickSize()

orxDLLAPI orxSTATUS orxFASTCALL orxClock_SetTickSize ( orxCLOCK * _pstClock,
orxFLOAT _fTickSize )
extern

Sets a clock tick size

Parameters
[in]_pstClockConcerned clock
[in]_fTickSizeTick size, -1 for 'display'
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

◆ orxClock_Setup()

orxDLLAPI void orxFASTCALL orxClock_Setup ( )
extern

Clock module setup

◆ orxClock_Unregister()

orxDLLAPI orxSTATUS orxFASTCALL orxClock_Unregister ( orxCLOCK * _pstClock,
const orxCLOCK_FUNCTION _pfnCallback )
extern

Unregisters a callback function from a clock

Parameters
[in]_pstClockConcerned clock
[in]_pfnCallbackCallback to remove
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

◆ orxClock_Update()

orxDLLAPI orxSTATUS orxFASTCALL orxClock_Update ( )
extern

Updates the clock system

Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

Generated for orx by doxygen 1.8.11