Unravel Engine C++ Reference
Loading...
Searching...
No Matches
button_state.hpp
Go to the documentation of this file.
1#pragma once
2
3namespace input
4{
5enum class button_state
6{
7 up,
9 down,
11};
12
13// ----------------------------------------------------------------------------
14inline auto button_state_to_analog_value(const button_state state) -> float
15{
16 switch(state)
17 {
20 return 1.0f;
21
24 default:
25 return 0.0f;
26 }
27}
28
29// ----------------------------------------------------------------------------
30inline auto button_state_to_digital_value(const button_state state) -> bool
31{
32 switch(state)
33 {
36 return true;
37
40 default:
41 return false;
42 }
43}
44} // namespace input
auto button_state_to_digital_value(const button_state state) -> bool
auto button_state_to_analog_value(const button_state state) -> float