|
Kanzi Graphics Engine
|
Task scheduler for periodically calling a set of functions. More...
Typedefs | |
| typedef kzsError(* | KzuTaskFunction )(kzUint deltaTime, void *userData, kzBool *out_done) |
| Scheduled task function. More... | |
Functions | |
| kzsError | kzuTaskSchedulerCreate (const struct KzcMemoryManager *memoryManager, struct KzuTaskScheduler **out_taskScheduler) |
| Create a new task scheduler. More... | |
| kzsError | kzuTaskSchedulerDelete (struct KzuTaskScheduler *taskScheduler) |
| Delete a task scheduler. More... | |
| kzsError | kzuTaskSchedulerAddRecurringTask (const struct KzuTaskScheduler *taskScheduler, KzuTaskFunction taskFunction, void *userParameters) |
| Add a recurring task to the task scheduler. More... | |
| kzsError | kzuTaskSchedulerAttachAnimationPlayer (const struct KzuTaskScheduler *taskScheduler, struct KzuAnimationPlayer *animationPlayer) |
| Attach an animation player to the master animation player in the task scheduler. More... | |
| void | kzuTaskSchedulerSetRootAnimationPlayer_private (struct KzuTaskScheduler *taskScheduler, struct KzuAnimationPlayer *rootPlayer) |
| Sets the root animation player for task scheduler. More... | |
| struct KzuAnimationPlayer * | kzuTaskSchedulerGetAnimationPlayer (const struct KzuTaskScheduler *taskScheduler) |
| Get the master animation player for this task scheduler. More... | |
| kzsError | kzuTaskSchedulerRemoveTask (const struct KzuTaskScheduler *taskScheduler, KzuTaskFunction taskFunction, const void *userParameters) |
| Remove a task from the task scheduler. More... | |
| kzsError | kzuTaskSchedulerExecuteAllTasks (struct KzuTaskScheduler *taskScheduler, kzUint deltaTime, struct KzuObjectNode *rootNode) |
| Execute all tasks in the task scheduler. More... | |
Task scheduler for periodically calling a set of functions.
When the application framework is used, Kanzi will automatically create a task scheduler accessible with kzaApplicationGetTaskScheduler(). That is used for e.g. playing animations.
Copyright 2008-2019 by Rightware. All rights reserved.
Scheduled task function.
| deltaTime | Elapsed time in milliseconds. |
| userData | Arbitrary pointer previously passed to kzuTaskSchedulerAddRecurringTask(). |
| out_done | Set this to KZ_TRUE to remove the task from the scheduler or KZ_FALSE to keep the the task in execution. |
| kzsError kzuTaskSchedulerCreate | ( | const struct KzcMemoryManager * | memoryManager, |
| struct KzuTaskScheduler ** | out_taskScheduler | ||
| ) |
Create a new task scheduler.
| kzsError kzuTaskSchedulerDelete | ( | struct KzuTaskScheduler * | taskScheduler) |
Delete a task scheduler.
| kzsError kzuTaskSchedulerAddRecurringTask | ( | const struct KzuTaskScheduler * | taskScheduler, |
| KzuTaskFunction | taskFunction, | ||
| void * | userParameters | ||
| ) |
Add a recurring task to the task scheduler.
| taskScheduler | The task scheduler to use. |
| taskFunction | The function to call periodically. |
| userParameters | Arbitrary pointer that will be passed to the task function. |
| kzsError kzuTaskSchedulerAttachAnimationPlayer | ( | const struct KzuTaskScheduler * | taskScheduler, |
| struct KzuAnimationPlayer * | animationPlayer | ||
| ) |
Attach an animation player to the master animation player in the task scheduler.
| void kzuTaskSchedulerSetRootAnimationPlayer_private | ( | struct KzuTaskScheduler * | taskScheduler, |
| struct KzuAnimationPlayer * | rootPlayer | ||
| ) |
Sets the root animation player for task scheduler.
| struct KzuAnimationPlayer* kzuTaskSchedulerGetAnimationPlayer | ( | const struct KzuTaskScheduler * | taskScheduler) |
Get the master animation player for this task scheduler.
| kzsError kzuTaskSchedulerRemoveTask | ( | const struct KzuTaskScheduler * | taskScheduler, |
| KzuTaskFunction | taskFunction, | ||
| const void * | userParameters | ||
| ) |
Remove a task from the task scheduler.
| taskScheduler | The task scheduler to use. |
| taskFunction | The function to remove from execution. |
| userParameters | The pointer that was specified when the task was added to the task scheduler. |
| kzsError kzuTaskSchedulerExecuteAllTasks | ( | struct KzuTaskScheduler * | taskScheduler, |
| kzUint | deltaTime, | ||
| struct KzuObjectNode * | rootNode | ||
| ) |
Execute all tasks in the task scheduler.
| taskScheduler | The task scheduler to use. |
| deltaTime | Usually this should be milliseconds elapsed since the last execution, but other values can also be used to e.g. control animations. |
| rootNode | The root node of the scheduler. Normally this should be the KzuScreen of the application. This is used to disable animations that are attached to nodes under other root nodes, such as nodes which do not belong to any scene. |