Flint Engine
Modular C++20 2D game engine powered by SDL3
Loading...
Searching...
No Matches
Flint::InputSnapshot Struct Reference

Immutable snapshot of all input device states at a single point in time. More...

#include <flint/input/input.h>

+ Collaboration diagram for Flint::InputSnapshot:

Public Attributes

std::set< SDL_Keycode > keysDown
 
std::set< Flint::GamepadButton > buttonsDown
 
Vec2f leftStick {0, 0}
 
Vec2f rightStick {0, 0}
 
float rightTrigger = 0.f
 

Detailed Description

Immutable snapshot of all input device states at a single point in time.

Produced by InputManager::pollCurrentState(). Callers compare snapshots frame-to-frame to detect pressed/released transitions.

Definition at line 21 of file input.h.

Member Data Documentation

◆ buttonsDown

std::set<Flint::GamepadButton> Flint::InputSnapshot::buttonsDown

All gamepad buttons currently held.

Definition at line 23 of file input.h.

◆ keysDown

std::set<SDL_Keycode> Flint::InputSnapshot::keysDown

All keyboard keys currently held.

Definition at line 22 of file input.h.

◆ leftStick

Vec2f Flint::InputSnapshot::leftStick {0, 0}

Left stick position in [-1, 1].

Definition at line 24 of file input.h.

◆ rightStick

Vec2f Flint::InputSnapshot::rightStick {0, 0}

Right stick position in [-1, 1].

Definition at line 25 of file input.h.

◆ rightTrigger

float Flint::InputSnapshot::rightTrigger = 0.f

Right trigger value in [0, 1].

Definition at line 26 of file input.h.


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