Fx2D
A C++20 2D rigid-body physics engine
Loading...
Searching...
No Matches
FxInput Class Reference

Input state read by gameplay code or injected by a headless producer. More...

#include <Input.h>

Public Member Functions

bool key_down (FxKey key) const
 
bool key_pressed (FxKey key) const
 
bool key_released (FxKey key) const
 
bool mouse_down (FxMouseButton button) const
 
bool mouse_pressed (FxMouseButton button) const
 
bool mouse_released (FxMouseButton button) const
 
const FxVec2f & mouse_position () const
 
const FxVec2f & mouse_screen_position () const
 
FxVec2f mouse_delta () const
 
float wheel_delta () const
 
bool available () const
 
void begin_frame ()
 
void set_key (FxKey key, bool down)
 
void set_mouse_button (FxMouseButton button, bool down)
 
void set_mouse_position (const FxVec2f &world, const FxVec2f &screen)
 
void set_wheel_delta (float delta)
 
void release_all ()
 
void clear ()
 

Static Public Attributes

static constexpr size_t kKeyCount = static_cast<size_t>(FxKey::Count)
 
static constexpr size_t kButtonCount = static_cast<size_t>(FxMouseButton::Count)
 

Detailed Description

Input state read by gameplay code or injected by a headless producer.

Definition at line 28 of file Input.h.

Member Function Documentation

◆ available()

bool FxInput::available ( ) const
inline

Definition at line 60 of file Input.h.

◆ begin_frame()

void FxInput::begin_frame ( )
inline

Definition at line 66 of file Input.h.

◆ clear()

void FxInput::clear ( )
inline

Definition at line 89 of file Input.h.

◆ key_down()

bool FxInput::key_down ( FxKey  key) const
inline

Definition at line 36 of file Input.h.

◆ key_pressed()

bool FxInput::key_pressed ( FxKey  key) const
inline

Definition at line 39 of file Input.h.

◆ key_released()

bool FxInput::key_released ( FxKey  key) const
inline

Definition at line 40 of file Input.h.

◆ mouse_delta()

FxVec2f FxInput::mouse_delta ( ) const
inline

Definition at line 55 of file Input.h.

◆ mouse_down()

bool FxInput::mouse_down ( FxMouseButton  button) const
inline

Definition at line 42 of file Input.h.

◆ mouse_position()

const FxVec2f & FxInput::mouse_position ( ) const
inline

Definition at line 51 of file Input.h.

◆ mouse_pressed()

bool FxInput::mouse_pressed ( FxMouseButton  button) const
inline

Definition at line 43 of file Input.h.

◆ mouse_released()

bool FxInput::mouse_released ( FxMouseButton  button) const
inline

Definition at line 46 of file Input.h.

◆ mouse_screen_position()

const FxVec2f & FxInput::mouse_screen_position ( ) const
inline

Definition at line 53 of file Input.h.

◆ release_all()

void FxInput::release_all ( )
inline

Definition at line 83 of file Input.h.

◆ set_key()

void FxInput::set_key ( FxKey  key,
bool  down 
)
inline

Definition at line 74 of file Input.h.

◆ set_mouse_button()

void FxInput::set_mouse_button ( FxMouseButton  button,
bool  down 
)
inline

Definition at line 75 of file Input.h.

◆ set_mouse_position()

void FxInput::set_mouse_position ( const FxVec2f &  world,
const FxVec2f &  screen 
)
inline

Definition at line 76 of file Input.h.

◆ set_wheel_delta()

void FxInput::set_wheel_delta ( float  delta)
inline

Definition at line 80 of file Input.h.

◆ wheel_delta()

float FxInput::wheel_delta ( ) const
inline

Definition at line 57 of file Input.h.

Member Data Documentation

◆ kButtonCount

constexpr size_t FxInput::kButtonCount = static_cast<size_t>(FxMouseButton::Count)
staticconstexpr

Definition at line 31 of file Input.h.

◆ kKeyCount

constexpr size_t FxInput::kKeyCount = static_cast<size_t>(FxKey::Count)
staticconstexpr

Definition at line 30 of file Input.h.


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