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 namespace Blah
{ {
// Single input Binding // 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 class Binding
{ {
public: public:
@ -158,7 +161,10 @@ namespace Blah
float get_value() const; 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 class AxisBinding
{ {
public: public:
@ -224,6 +230,10 @@ namespace Blah
void clear(); 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 class StickBinding
{ {
public: public:

View File

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