R-Type 0.1
Loading...
Searching...
No Matches
rtk::systems::InputSystem< WindowType > Class Template Referencefinal

Polls window events and turns bound controls into action bits. More...

#include <systems/InputSystem.hpp>

Inheritance diagram for rtk::systems::InputSystem< WindowType >:
[legend]

Public Member Functions

 InputSystem (std::reference_wrapper< WindowType > window, rtk::InputState &inputState, const rtk::Input::InputMapping &mapping)
 Creates the system.
 
void onStart (rtk::ecs::Registry &) override
 Logs that the system is loaded.
 
void onStop (rtk::ecs::Registry &) override
 Does nothing.
 
void update (rtk::ecs::Registry &reg, float) override
 Rebuilds the action mask from the current controls.
 

Detailed Description

template<ecs::concepts::IsRenderWindow WindowType>
class rtk::systems::InputSystem< WindowType >

Polls window events and turns bound controls into action bits.

Escape requests the window to close, and F3 held with B toggles the debug overlay.

Template Parameters
WindowTypeWindow satisfying IsRenderWindow.

Constructor & Destructor Documentation

◆ InputSystem()

template<ecs::concepts::IsRenderWindow WindowType>
rtk::systems::InputSystem< WindowType >::InputSystem ( std::reference_wrapper< WindowType > window,
rtk::InputState & inputState,
const rtk::Input::InputMapping & mapping )
inline

Creates the system.

Parameters
windowWindow to poll.
inputStateState written every frame.
mappingBindings between controls and actions.