b2TaskCallback

Type Alias b2TaskCallback 

Source
pub type b2TaskCallback = Option<unsafe extern "C" fn(startIndex: c_int, endIndex: c_int, workerIndex: u32, taskContext: *mut c_void)>;
Expand description

Task interface This is prototype for a Box2D task. Your task system is expected to invoke the Box2D task with these arguments. The task spans a range of the parallel-for: [startIndex, endIndex) The worker index must correctly identify each worker in the user thread pool, expected in [0, workerCount). A worker must only exist on only one thread at a time and is analogous to the thread index. The task context is the context pointer sent from Box2D when it is enqueued. The startIndex and endIndex are expected in the range [0, itemCount) where itemCount is the argument to b2EnqueueTaskCallback below. Box2D expects startIndex < endIndex and will execute a loop like this:

@code{.c} for (int i = startIndex; i < endIndex; ++i) { DoWork(); } @endcode @ingroup world

Aliased Type§

pub enum b2TaskCallback {
    None,
    Some(unsafe extern "C" fn(i32, i32, u32, *mut c_void)),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(i32, i32, u32, *mut c_void))

Some value of type T.