Skip to main content

gameloop Namespace

Central game loop orchestration module. More...

Definition

namespace helios::engine::runtime::gameloop { ... }

Classes Index

classGameLoop

Central orchestrator for the game update cycle. More...

classPass

Abstract base class for game loop passes. More...

classPassCommitListener

Interface for receiving notifications when a pass reaches its commit point. More...

classPhase

Represents a phase in the game loop containing multiple passes. More...

classTypedPass<StateType>

State-filtered pass that only executes in specific states. More...

Enumerations Index

enum classCommitPoint : uint8_t { ... }

Flags defining synchronization actions at the end of a pass. More...

enum classPhaseType { ... }

Enumeration of game loop phase types. More...

Operators Index

CommitPoint constexproperator& (CommitPoint a, CommitPoint b) noexcept

Bitwise AND operator for CommitPoint flags. More...

CommitPoint constexproperator| (CommitPoint a, CommitPoint b) noexcept

Bitwise OR operator for CommitPoint flags. More...

Description

Central game loop orchestration module.

Provides the GameLoop, Phase, and Pass classes for managing phased system execution with deterministic ordering and event synchronization.

Enumerations

CommitPoint

enum class helios::engine::runtime::gameloop::CommitPoint : uint8_t
strong

Flags defining synchronization actions at the end of a pass.

Enumeration values
NoneNo commit action (= 0)
PassEventsCommits pass-level events (= 1 << 0)
FlushCommandsFlushes the command buffer (= 1 << 1)
FlushManagersFlushes all registered managers (= 1 << 2)
StructuralFull structural commit (= PassEvents | FlushCommands | FlushManagers)

A CommitPoint specifies what operations should be performed when a pass completes. Multiple flags can be combined using bitwise OR to trigger several actions at once.

Commit points are essential for the deterministic ordering of the game loop:

  • Commands are queued during passes and executed at commit points
  • Pass-level events become readable only after a commit
  • Managers process their queued requests at commit points

Example usage: ```cpp pass.addCommitPoint(CommitPoint::PassEvents | CommitPoint::FlushCommands); ```

See Also

Pass::addCommitPoint()

See Also

GameLoop::passCommit()

Definition at line 35 of file CommitPoint.ixx.

35 enum class CommitPoint : uint8_t {
36
37 /**
38 * @brief No commit action.
39 */
40 None = 0,
41
42 /**
43 * @brief Commits pass-level events.
44 *
45 * Events pushed via `UpdateContext::pushPass()` become readable in subsequent
46 * passes through `UpdateContext::readPass()`. Pass events are discarded at the
47 * end of the phase.
48 */
49 PassEvents = 1 << 0,
50
51 /**
52 * @brief Flushes the command buffer.
53 *
54 * Pending commands are dispatched to their registered handlers and executed.
55 */
56 FlushCommands = 1 << 1,
57
58 /**
59 * @brief Flushes all registered managers.
60 *
61 * Managers process their queued requests (e.g., ProjectileManager spawns
62 * projectiles from its request queue).
63 */
64 FlushManagers = 1 << 2,
65
66 /**
67 * @brief Full structural commit.
68 *
69 * Combines PassEvents, FlushManagers, and FlushCommands for a complete
70 * synchronization point.
71 */
73 };

PhaseType

enum class helios::engine::runtime::gameloop::PhaseType
strong

Enumeration of game loop phase types.

Enumeration values
PrePre-update phase for input and command processing
MainMain update phase for core gameplay systems
PostPost-update phase for cleanup and scene synchronization

The game loop is divided into three sequential phases:

  • **Pre:** Input processing and command generation.
  • **Main:** Core gameplay simulation (physics, AI, game logic).
  • **Post:** Synchronization, cleanup, and preparation for rendering.

Definition at line 40 of file Phase.ixx.

40 enum class PhaseType {
41 /**
42 * @brief Pre-update phase for input and command processing.
43 */
45
46 /**
47 * @brief Main update phase for core gameplay systems.
48 */
50
51 /**
52 * @brief Post-update phase for cleanup and scene synchronization.
53 */
55 };

Operators

operator&()

CommitPoint constexpr helios::engine::runtime::gameloop::operator& (CommitPoint a, CommitPoint b)
constexpr noexcept

Bitwise AND operator for CommitPoint flags.

Parameters
a

First operand.

b

Second operand.

Returns

The combined flags.

Definition at line 83 of file CommitPoint.ixx.

83 CommitPoint constexpr operator &(CommitPoint a, CommitPoint b) noexcept {
84 return static_cast<CommitPoint>(std::to_underlying(a) & std::to_underlying(b));
85 }

operator|()

CommitPoint constexpr helios::engine::runtime::gameloop::operator| (CommitPoint a, CommitPoint b)
constexpr noexcept

Bitwise OR operator for CommitPoint flags.

Parameters
a

First operand.

b

Second operand.

Returns

The combined flags.

Definition at line 95 of file CommitPoint.ixx.

95 CommitPoint constexpr operator |(CommitPoint a, CommitPoint b) noexcept {
96 return static_cast<CommitPoint>(std::to_underlying(a) | std::to_underlying(b));
97 }

The documentation for this namespace was generated from the following files:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.