Ignore:
Timestamp:
Sep 14, 2013, 8:55:42 PM (6 years ago)
Author:
benlitz
Message:

input: added a name the controllers, and a static Get() function to easily retrieve a registered controller

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/input/controller.h

    r2924 r2925  
    7474protected:
    7575    void Update() { m_previous = m_current; m_current = IsBound() ? RetrieveCurrentValue() : 0.0f; }
    76         float RetrieveCurrentValue();
     76    float RetrieveCurrentValue();
    7777
    7878    const InputDevice* m_device;
     
    8787
    8888
    89 class Controller : Entity
     89class Controller : public Entity
    9090{
    9191public:
    92     Controller(int nb_keys, int nb_axis);
     92    Controller(char const* name, int nb_keys, int nb_axis);
    9393    ~Controller();
    9494
     
    105105    AxisBinding& GetAxis(int index) { return m_axis[index]; }
    106106
     107    static Controller* Get(char const* name);
     108
    107109protected:
    108110    Array<KeyBinding> m_keys;
     
    111113private:
    112114    static Array<Controller*> controllers;
     115    String m_name;
    113116    bool m_activate_nextframe;
    114117    bool m_deactivate_nextframe;
Note: See TracChangeset for help on using the changeset viewer.