1234567891011121314151617181920212223242526272829303132333435 |
- #ifndef CONTROLLER_H
- #define CONTROLLER_H
- #include <GL/glew.h>
- #include <GLFW/glfw3.h>
- #include "utils/Array.h"
- #include "input/Button.h"
- class Controller final {
- int index;
- Array<Button, 2 + GLFW_JOYSTICK_LAST> buttons;
- public:
- Controller();
- void tick();
- bool isDown(int button) const;
- int getDownTime(int button) const;
- bool isUp(int button) const;
- int getUpTime(int button) const;
- private:
- int getRangeMask(int button) const;
- /*bool findController();
- void reset();
- void increment(uint button, const u8* mapping, uint index);
- void increment(uint button, bool notReleased);
- uint activeController;*/
- };
- #endif
|