#ifndef JOYSTICKSDL_H
#define JOYSTICKSDL_H

#include "Joystick.h"
#include "Vehicle.h"
#include "MultiVehicleManager.h"

#ifdef Q_OS_MAC
    #include <SDL.h>
#else
    #include <SDL/SDL.h>
#endif


class JoystickSDL : public Joystick
{
public:
    JoystickSDL(const QString& name, int axisCount, int buttonCount, int index, MultiVehicleManager* multiVehicleManager);

    static QMap<QString, Joystick*> discover(MultiVehicleManager* _multiVehicleManager); 

private:
    virtual bool open();
    virtual void close();
    virtual bool update();

    virtual bool getButton(int i);
    virtual int getAxis(int i);

    SDL_Joystick *sdlJoystick;
    int     _index;      ///< Index for SDL_JoystickOpen
};

#endif // JOYSTICKSDL_H
