Skip to main content

StateToViewportPolicyUpdateSystem Class Template

Updates the session's active viewport list based on state policy. More...

Declaration

template <typename StateLft, typename StateRgt> class helios::engine::rendering::viewport::systems::StateToViewportPolicyUpdateSystem<StateLft, StateRgt> { ... }

Public Member Typedefs Index

template <typename StateLft, typename StateRgt>
usingEngineRoleTag = helios::engine::runtime::world::tags::SystemRole

Public Constructors Index

template <typename StateLft, typename StateRgt>
StateToViewportPolicyUpdateSystem (StateToIdMapPair< StateLft, StateRgt, ViewportHandle > stateToIdMapPair)

Constructs the system with a state-to-ID map pair. More...

Public Member Functions Index

template <typename StateLft, typename StateRgt>
voidupdate (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, ViewportHandle >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.

Definition at line 56 of file StateToViewportPolicyUpdateSystem.ixx.

Public Member Typedefs

EngineRoleTag

template <typename StateLft, typename StateRgt>
using helios::engine::rendering::viewport::systems::StateToViewportPolicyUpdateSystem< StateLft, StateRgt >::EngineRoleTag = helios::engine::runtime::world::tags::SystemRole

Public Constructors

StateToViewportPolicyUpdateSystem()

template <typename StateLft, typename StateRgt>
helios::engine::rendering::viewport::systems::StateToViewportPolicyUpdateSystem< StateLft, StateRgt >::StateToViewportPolicyUpdateSystem (StateToIdMapPair< StateLft, StateRgt, ViewportHandle > stateToIdMapPair)
inline explicit

Constructs the system with a state-to-ID map pair.

Parameters
stateToIdMapPair

Policy mapping states to viewport IDs.

Definition at line 72 of file StateToViewportPolicyUpdateSystem.ixx.

Public Member Functions

update()

template <typename StateLft, typename StateRgt>
void helios::engine::rendering::viewport::systems::StateToViewportPolicyUpdateSystem< StateLft, StateRgt >::update (helios::engine::runtime::world::UpdateContext & updateContext)
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 83 of file StateToViewportPolicyUpdateSystem.ixx.

84
85 auto& session = updateContext.session();
86
87 auto gameState = session.state<StateLft>();
88 auto matchState = session.state<StateRgt>();
89
90 session.clearViewportHandles();
91
92 auto viewportIds = stateToIdMapPair_.ids(gameState, matchState);
93 session.setViewportHandles(viewportIds);
94
95
96
97
98 }

References helios::engine::state::StateToIdMapPair< LState, RState, TId >::ids and helios::engine::rendering::registerComponents.

Private Member Attributes

stateToIdMapPair_

template <typename StateLft, typename StateRgt>
StateToIdMapPair<StateLft, StateRgt, ViewportHandle> helios::engine::rendering::viewport::systems::StateToViewportPolicyUpdateSystem< StateLft, StateRgt >::stateToIdMapPair_

Policy defining viewport-to-state mappings.

Definition at line 61 of file StateToViewportPolicyUpdateSystem.ixx.


The documentation for this class was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.