Crimson Engine 1.0.0
A high-performance C++20 game engine prototype showcasing a custom ECS, Vulkan renderer, and ImGui editor.
Loading...
Searching...
No Matches
InputSystem Class Reference

System that handles input from keyboard and mouse, updating InputComponents and switching camera modes. More...

#include <InputSystem.hpp>

Inheritance diagram for InputSystem:
System

Public Member Functions

 InputSystem (Registry &reg, VulkanRenderer &renderer, EditorModeState &editorMode)
 Construct a new Input System object.
void update (float dt) override
 Updates inputs for entities and handles cursor mode switches.
void switchMode (double &lastY, double &lastX)
 Toggles between editor/fly mode and handles cursor state cache.
void applyCursorMode ()
 Configures GLFW cursor modes based on current fly/editor state.
Public Member Functions inherited from System
virtual ~System ()=default
 Virtual destructor.
void addEntity (Entity e)
 Adds an entity to the system tracking list.
void removeEntity (Entity e)
 Removes an entity from system tracking.

Private Attributes

Registry & registry
 Reference to the entity registry.
VulkanRenderer & renderer
 Reference to the renderer.
EditorModeState & editorMode
 Reference to the editor mode state.

Additional Inherited Members

Protected Attributes inherited from System
std::vector< Entity > entities
 List of entities tracked by this system.

Detailed Description

System that handles input from keyboard and mouse, updating InputComponents and switching camera modes.

Constructor & Destructor Documentation

◆ InputSystem()

InputSystem::InputSystem ( Registry & reg,
VulkanRenderer & renderer,
EditorModeState & editorMode )
inline

Construct a new Input System object.

Parameters
regReference to the ECS Registry.
rendererReference to the Vulkan Renderer.
editorModeReference to the Editor Mode State.

Member Function Documentation

◆ applyCursorMode()

void InputSystem::applyCursorMode ( )
inline

Configures GLFW cursor modes based on current fly/editor state.

◆ switchMode()

void InputSystem::switchMode ( double & lastY,
double & lastX )
inline

Toggles between editor/fly mode and handles cursor state cache.

Parameters
lastYReference to stored last Y position of the cursor.
lastXReference to stored last X position of the cursor.

◆ update()

void InputSystem::update ( float dt)
inlineoverridevirtual

Updates inputs for entities and handles cursor mode switches.

Parameters
dtDelta time in seconds.

Implements System.

Member Data Documentation

◆ editorMode

EditorModeState& InputSystem::editorMode
private

Reference to the editor mode state.

◆ registry

Registry& InputSystem::registry
private

Reference to the entity registry.

◆ renderer

VulkanRenderer& InputSystem::renderer
private

Reference to the renderer.


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