Pass Class
Represents a single pass within a game loop phase. More...
Declaration
Friends Index
| class | helios::engine::runtime::gameloop::Phase |
Public Constructors Index
| Pass (Phase &owner) | |
|
Constructs a Pass with a reference to its owning Phase. More... | |
Public Member Functions Index
template <typename T, typename... Args> | |
| Pass & | addSystem (Args &&... args) |
|
Adds a system of type T to this pass. More... | |
| Phase & | addCommitPoint (const CommitPoint commitPoint=CommitPoint::PassEvents) |
|
Marks this pass with a commit point and returns the owning Phase. More... | |
| CommitPoint | commitPoint () const noexcept |
|
Returns the configured commit point for this pass. More... | |
Private Member Functions Index
| void | update (helios::engine::runtime::world::UpdateContext &updateContext) |
|
Updates all systems registered in this pass. More... | |
| void | init (helios::engine::runtime::world::GameWorld &gameWorld) |
|
Initializes all systems registered in this pass. More... | |
Private Member Attributes Index
| helios::engine::runtime::world::SystemRegistry | systemRegistry_ {} |
|
Registry holding all systems for this pass. More... | |
| Phase & | owner_ |
| CommitPoint | commitPoint_ = CommitPoint::None |
|
The CommitPoint configured for this Pass. More... | |
Description
Represents a single pass within a game loop phase.
A Pass contains a registry of systems that are executed sequentially during the game loop update. Passes can be configured with a commit point to synchronize events between passes.
Systems are added to a pass using the fluent `add<T>()` method, and a commit point can be added using `addCommitPoint()`.
Example usage: ```cpp gameLoop.phase(PhaseType::Main) .addPass() .add<MovementSystem>() .add<PhysicsSystem>() .addCommitPoint() .addPass() .add<CollisionSystem>(); ```
- See Also
- See Also
System
Definition at line 52 of file Pass.ixx.
Friends
helios::engine::runtime::gameloop::Phase
|
Definition at line 54 of file Pass.ixx.
Referenced by addCommitPoint and Pass.
Public Constructors
Pass()
| inline explicit |
Public Member Functions
addCommitPoint()
| inline |
Marks this pass with a commit point and returns the owning Phase.
When a commit point is set, the specified synchronization actions are performed after this pass completes. The default is `CommitPoint::PassEvents` which only synchronizes pass-level events.
Available CommitPoint flags:
- `PassEvents` — Events pushed via `UpdateContext::pushPass()` become readable.
- `FlushCommands` — Pending commands from the CommandBuffer are executed.
- `FlushManagers` — Managers process their queued requests.
- `Structural` — Combines all three flags.
Flags can be combined using bitwise OR: ```cpp pass.addCommitPoint(CommitPoint::PassEvents | CommitPoint::FlushCommands); ```
- Parameters
-
commitPoint The flags specifying which actions to perform (default: PassEvents).
- Returns
Reference to the owning Phase for continued configuration.
- See Also
- See Also
UpdateContext::pushPass()
- See Also
UpdateContext::readPass()
- See Also
GameLoop::passCommit()
Definition at line 151 of file Pass.ixx.
References commitPoint, helios::engine::runtime::gameloop::Phase and helios::engine::runtime::gameloop::PassEvents.
addSystem()
| inline |
Adds a system of type T to this pass.
- Template Parameters
-
T The system type to add. Must derive from System.
Args Constructor argument types for the system.
- Parameters
-
args Arguments forwarded to the system constructor.
- Returns
Reference to this Pass for method chaining.
Definition at line 118 of file Pass.ixx.
Reference Pass.
commitPoint()
| inline nodiscard noexcept |
Returns the configured commit point for this pass.
The commit point determines what synchronization actions are performed after this pass completes. If no commit point was added, returns CommitPoint::None.
- Returns
The commit point flags for this pass.
- See Also
- See Also
Definition at line 168 of file Pass.ixx.
Referenced by addCommitPoint.
Private Member Functions
init()
| inline |
Initializes all systems registered in this pass.
- Parameters
-
gameWorld Reference to the game world.
Definition at line 83 of file Pass.ixx.
update()
| inline |
Updates all systems registered in this pass.
- Parameters
-
updateContext The current update context.
Definition at line 71 of file Pass.ixx.
Private Member Attributes
commitPoint_
|
The CommitPoint configured for this Pass.
Definition at line 93 of file Pass.ixx.
owner_
|
systemRegistry_
|
Registry holding all systems for this pass.
Definition at line 59 of file Pass.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.