static inline int vg_get_button_down( const char *button ) __attribute__((unused));
static inline int vg_get_button_up( const char *button ) __attribute__((unused));
+enum vg_button_state
+{
+ k_button_state_down = 1,
+ k_button_state_up = 3,
+ k_button_state_pressed = 2,
+ k_button_state_none = 0
+};
+
// Input
// ===========================================================================================================
GLFWgamepadstate vg_gamepad;
return bind->prev & (bind->value ^ bind->prev) && !vg_console_enabled();
}
+static inline enum vg_button_state vg_get_button_state( const char *button )
+{
+ if( vg_get_button_down( button ) ) return k_button_state_down;
+ if( vg_get_button_up( button ) ) return k_button_state_up;
+ if( vg_get_button( button ) ) return k_button_state_pressed;
+ return k_button_state_none;
+}
+
static inline int key_is_keyboard( int const id )
{
vg_static_assert( GLFW_MOUSE_BUTTON_LAST < GLFW_KEY_SPACE, "GLFW: Mouse has too many buttons" );