/* * call-seq: * buttons -> Integer * * Returns the number of buttons featured on the Joystick. A button can * be in one of two states: neutral, or pushed. See also #button_state() */ VALUE rbgm_joystick_numbuttons( VALUE self ) { SDL_Joystick *joy; Data_Get_Struct(self,SDL_Joystick,joy); SDL_JoystickUpdate(); return INT2FIX(SDL_JoystickNumButtons(joy)); }