# File lib/rubygame/joystick.rb, line 82
  def self.activate_all
    # Initialize if it isn't already.
    if( SDL.WasInit(SDL::INIT_JOYSTICK) == 0 )
      if( SDL.Init(SDL::INIT_JOYSTICK) != 0 )
        raise Rubygame::SDLError, "Could not initialize SDL joysticks."
      end
    end

    # Collect Joystick instances in an Array
    joysticks = []

    num_joysticks.times do |i|
      joysticks << new( i )
    end

    return joysticks
  end