|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
#include <PhysicsTaskPool.hpp>
Public Member Functions | |
| TaskPool () | |
| ~TaskPool () | |
| TaskPool (const TaskPool &)=delete | |
| TaskPool & | operator= (const TaskPool &)=delete |
| int | workerCount () const |
| void | configure (b2WorldDef &def) |
A fixed pool of worker threads Box2D enqueues onto. Not general purpose: it exists to satisfy b2EnqueueTaskCallback / b2FinishTaskCallback, and its lifetime is the physics world's.
Definition at line 49 of file PhysicsTaskPool.hpp.
| esengine::physics::TaskPool::TaskPool | ( | ) |
Builds a pool sized from the hardware, or an empty one when there is only a single core to schedule on (in which case Box2D solves inline).
Definition at line 21 of file PhysicsTaskPool.cpp.
Referenced by TaskPool(), and operator=().
| esengine::physics::TaskPool::~TaskPool | ( | ) |
Definition at line 40 of file PhysicsTaskPool.cpp.
|
delete |
References TaskPool().
| void esengine::physics::TaskPool::configure | ( | b2WorldDef & | def | ) |
Wire this pool into a world definition. A pool with no workers leaves the definition alone, so the world stays on the calling thread.
Definition at line 51 of file PhysicsTaskPool.cpp.
References TaskPool().
|
inline |
How many workers Box2D should split a step across, counting the calling thread; 0 when the pool is inactive and the world stays single-threaded.
Definition at line 61 of file PhysicsTaskPool.hpp.