clarified what Input::register_binding does. It returns a handle!

This commit is contained in:
Noel Berry 2022-08-21 17:39:58 -07:00
parent a1baaaf298
commit 05b58706d7
2 changed files with 12 additions and 12 deletions

View File

@ -791,13 +791,13 @@ namespace Blah
// sets the string contents of the clipboard // sets the string contents of the clipboard
void set_clipboard(const String& text); void set_clipboard(const String& text);
// registers a new binding // registers a new binding and returns a handle to it
ButtonBindingRef register_binding(const ButtonBinding& binding); ButtonBindingRef register_binding(const ButtonBinding& binding_data);
// registers a new axis binding // registers a new binding and returns a handle to it
AxisBindingRef register_binding(const AxisBinding& binding); AxisBindingRef register_binding(const AxisBinding& binding_data);
// registers a new stick binding // registers a new binding and returns a handle to it
StickBindingRef register_binding(const StickBinding& binding); StickBindingRef register_binding(const StickBinding& binding_data);
} }
} }

View File

@ -403,23 +403,23 @@ void Input::set_clipboard(const String& text)
App::Internal::platform->set_clipboard(text); App::Internal::platform->set_clipboard(text);
} }
ButtonBindingRef Input::register_binding(const ButtonBinding& binding) ButtonBindingRef Input::register_binding(const ButtonBinding& binding_data)
{ {
auto result = Ref<ButtonBinding>(new ButtonBinding(binding)); auto result = Ref<ButtonBinding>(new ButtonBinding(binding_data));
g_buttons.push_back(result); g_buttons.push_back(result);
return result; return result;
} }
AxisBindingRef Input::register_binding(const AxisBinding& binding) AxisBindingRef Input::register_binding(const AxisBinding& binding_data)
{ {
auto result = Ref<AxisBinding>(new AxisBinding(binding)); auto result = Ref<AxisBinding>(new AxisBinding(binding_data));
g_axes.push_back(result); g_axes.push_back(result);
return result; return result;
} }
StickBindingRef Input::register_binding(const StickBinding& binding) StickBindingRef Input::register_binding(const StickBinding& binding_data)
{ {
auto result = Ref<StickBinding>(new StickBinding(binding)); auto result = Ref<StickBinding>(new StickBinding(binding_data));
g_sticks.push_back(result); g_sticks.push_back(result);
return result; return result;
} }