StateToViewportPolicyUpdateSystem Class Template
Updates the session's active viewport list based on state policy. More...
Declaration
Public Member Typedefs Index
template <typename StateLft, typename StateRgt> | |
| using | EngineRoleTag = helios::engine::common::tags::SystemRole |
Public Constructors Index
template <typename StateLft, typename StateRgt> | |
| StateToViewportPolicyUpdateSystem (StateToIdMapPair< StateLft, StateRgt, ViewportId > stateToIdMapPair) | |
|
Constructs the system with a state-to-ID map pair. More... | |
Public Member Functions Index
template <typename StateLft, typename StateRgt> | |
| void | update (helios::engine::runtime::world::UpdateContext &updateContext) noexcept |
|
Updates the session's active viewport IDs. More... | |
Private Member Attributes Index
template <typename StateLft, typename StateRgt> | |
| StateToIdMapPair< StateLft, StateRgt, ViewportId > | stateToIdMapPair_ |
|
Policy defining viewport-to-state mappings. More... | |
Description
Updates the session's active viewport list based on state policy.
Queries the current states from the session using the configured template parameters, then uses StateToIdMapPair to determine which viewports should be active. The resulting viewport IDs are stored in the session for use by the rendering system.
## Usage
```cpp StateToIdMapPair<GameState, MatchState, ViewportId> policy; policy.add(GameState::Running, ViewportId("game")); policy.add(MatchState::GameOver, ViewportId("game_over")); policy.freeze();
gameLoop.phase(PhaseType::Pre) .addPass<GameState>(GameState::Any) .addSystem<StateToViewportPolicyUpdateSystem<GameState, MatchState>>( std::move(policy) ); ```
- Template Parameters
-
StateLft The left/primary state type (e.g., GameState).
StateRgt The right/secondary state type (e.g., MatchState).
- See Also
- See Also
Session
Definition at line 60 of file StateToViewportPolicyUpdateSystem.ixx.
Public Member Typedefs
EngineRoleTag
|
Definition at line 69 of file StateToViewportPolicyUpdateSystem.ixx.
Public Constructors
StateToViewportPolicyUpdateSystem()
| inline explicit |
Constructs the system with a state-to-ID map pair.
- Parameters
-
stateToIdMapPair Policy mapping states to viewport IDs.
Definition at line 76 of file StateToViewportPolicyUpdateSystem.ixx.
Public Member Functions
update()
| inline noexcept |
Updates the session's active viewport IDs.
Clears the current viewport IDs and sets them based on the current game and match state combination.
- Parameters
-
updateContext The current frame's update context.
Definition at line 87 of file StateToViewportPolicyUpdateSystem.ixx.
Private Member Attributes
stateToIdMapPair_
|
Policy defining viewport-to-state mappings.
Definition at line 65 of file StateToViewportPolicyUpdateSystem.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.