libER 0.1.4.2
ELDEN RING API library
|
Inherit from this minimal task interface to create a custom task. More...
#include <task.hpp>
Public Member Functions | |
void | execute (FD4::FD4TaskData *data) final |
FD4::FD4TaskBase execute method that calls eztask_execute. | |
virtual void | eztask_execute (FD4::FD4TaskData *data)=0 |
Virtual method that is called when a CS::CSEzTask is executed. | |
virtual LIBERAPI void | register_task (CSTaskGroup task_group) |
Register a task to be called in a specified task group. | |
virtual LIBERAPI void | free_task () |
Free the task, suspending its execution after it has been registered. | |
LIBERAPI CSTaskGroup | get_task_group () const noexcept |
Get the task group this task is currently registered at. | |
![]() | |
virtual LIBERAPI DLRF::DLRuntimeClass * | get_runtime_class () noexcept |
Get the runtime class object. | |
Inherit from this minimal task interface to create a custom task.
Used by ELDEN RING to queue and free asynchronous tasks in the task queue. Once a task is registered, it runs every frame when the task group specified to the register_task call is executed. The task group execution order is strict with regard to other task groups, but individual task execution order inside a task group is unspecified.
|
inlinefinalvirtual |
FD4::FD4TaskBase execute method that calls eztask_execute.
Inside the ELDEN RING task system, the FD4::FD4TaskBase interface is used for executing tasks. This method delegates the execution to eztask_execute.
data | a struct with additional data passed to the task |
Implements from::FD4::FD4TaskBase.
|
pure virtual |
Virtual method that is called when a CS::CSEzTask is executed.
Implement this method in a custom task class to provide a callback for when the task is executed.
data | a struct with additional data passed to the task, like delta time and the task group |
Free the task, suspending its execution after it has been registered.
Call this method to stop executing a task. It may still execute on the current pass of the task groups, but will not execute on the next. Keep the task lifetime disclaimer in mind when freeing or destroying a task.
|
noexcept |
Get the task group this task is currently registered at.
|
virtual |
Register a task to be called in a specified task group.
Call this method with a task instance to register it for execution. ELDEN RING task runners execute task groups in a strict order, going from FrameBegin to FrameEnd. After a task is registered, it will be executed in the next pass of all the task groups the following frame, calling its eztask_execute method.
task_group | a value from the CS::CSTaskGroup enum when the task should be executed |