additional input binding comments

This commit is contained in:
Noel Berry 2021-03-20 21:58:44 -07:00
parent f3bbda5f6c
commit 3913cf7c02
2 changed files with 13 additions and 5 deletions

View File

@ -7,6 +7,9 @@
namespace Blah
{
// Single input Binding
// You must call Binding::update() every frame to poll the input state.
// Alternatively, bindings can be registered to BindingRegistry which will
// automatically update them.
class Binding
{
public:
@ -158,7 +161,10 @@ namespace Blah
float get_value() const;
};
// Represents a Bound Axis (ex. Left/Right movement, or a Trigger)
// Axis Binding (ex. Left/Right movement, or a Trigger)
// You must call AxisBinding::update() every frame to poll the input state.
// Alternatively, bindings can be registered to BindingRegistry which will
// automatically update them.
class AxisBinding
{
public:
@ -224,6 +230,10 @@ namespace Blah
void clear();
};
// Stick Binding (ex. Joystick, Dpad, Arrow Keys, WASD, etc)
// You must call StickBinding::update() every frame to poll the input state.
// Alternatively, bindings can be registered to BindingRegistry which will
// automatically update them.
class StickBinding
{
public:

View File

@ -9,10 +9,8 @@ namespace Blah
using AxisBindingRef = std::shared_ptr<AxisBinding>;
using StickBindingRef = std::shared_ptr<StickBinding>;
// Optional registry to automatically update bindings.
// You can register different types of bindings here and until they are
// no longer used, they will be updated without having to explicitely call
// their update methods
// An Optional registry to automatically update Input Bindings.
// Once registered here, you do not need to explicitely call their update methods.
class BindingRegistry
{
public: