pub type b2EnqueueTaskCallback = Option<unsafe extern "C" fn(task: b2TaskCallback, itemCount: c_int, minRange: c_int, taskContext: *mut c_void, userContext: *mut c_void) -> *mut c_void>;Expand description
These functions can be provided to Box2D to invoke a task system. These are designed to work well with enkiTS. Returns a pointer to the user’s task object. May be nullptr. A nullptr indicates to Box2D that the work was executed serially within the callback and there is no need to call b2FinishTaskCallback. The itemCount is the number of Box2D work items that are to be partitioned among workers by the user’s task system. This is essentially a parallel-for. The minRange parameter is a suggestion of the minimum number of items to assign per worker to reduce overhead. For example, suppose the task is small and that itemCount is 16. A minRange of 8 suggests that your task system should split the work items among just two workers, even if you have more available. In general the range [startIndex, endIndex) send to b2TaskCallback should obey: endIndex - startIndex >= minRange The exception of course is when itemCount < minRange. @ingroup world
Aliased Type§
pub enum b2EnqueueTaskCallback {
None,
Some(unsafe extern "C" fn(Option<unsafe extern "C" fn(i32, i32, u32, *mut c_void)>, i32, i32, *mut c_void, *mut c_void) -> *mut c_void),
}