Gainput  v1.0.0
Classes | Public Member Functions | List of all members
gainput::InputState Class Reference

State of an input device. More...

#include <GainputInputState.h>

Public Member Functions

 InputState (Allocator &allocator, unsigned int buttonCount)
 Initializes the state. More...
 
 ~InputState ()
 Unitializes the state.
 
unsigned GetButtonCount () const
 Returns the number of buttons in this state. More...
 
bool GetBool (DeviceButtonId buttonId) const
 Returns the bool state of the given device button.
 
void Set (DeviceButtonId buttonId, bool value)
 Sets the bool state of the given device button.
 
float GetFloat (DeviceButtonId buttonId) const
 Returns the float state of the given device button.
 
void Set (DeviceButtonId buttonId, float value)
 Sets the float state of the given device button.
 
InputStateoperator= (const InputState &other)
 Sets the states of all buttons in this input state to the states of all buttons in the given input state.
 

Detailed Description

State of an input device.

Examples:
/samples/gesture/gesturesample.cpp.

Constructor & Destructor Documentation

◆ InputState()

gainput::InputState::InputState ( Allocator allocator,
unsigned int  buttonCount 
)

Initializes the state.

Parameters
allocatorThe allocator to be used for all memory allocations.
buttonCountThe maximum number of device buttons.

Member Function Documentation

◆ GetButtonCount()

unsigned gainput::InputState::GetButtonCount ( ) const
inline

Returns the number of buttons in this state.

Note that not all buttons may be valid.

See also
InputDevice::IsValidButtonId()

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